quantpylib.simulator.performance
performance_measures(r, w, periods_in_year=252, plot=False, path='./output')
Calculate and visualize various performance measures of a trading strategy.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
r
|
Series
|
Time series of returns. |
required |
w
|
DataFrame
|
DataFrame of weights corresponding to each asset over time, with same index as r. |
required |
periods_in_year
|
int
|
Number of time periods in a year for the granularity of return series passed in. Defaults to 252, the number of trading days in a year. |
252
|
plot
|
bool
|
Whether to generate and save plots. Defaults to True. |
False
|
path
|
str
|
Path to save generated plots, if plot=True |
'./output'
|
Returns:
Type | Description |
---|---|
dict
|
A dictionary containing various performance metrics:
|