Backtest Statistics¶
The Backtest Statistics worker calculates a pro-forma backtest of a portfolio versus a benchmark over a specified date range, returning risk-adjusted performance statistics and drawdown metrics as a datastore.

Parameters¶
Input¶
| Field | Description |
|---|---|
| Portfolio | The target portfolio. Accepts Fixed Portfolio, Get Latest, or Upstream Data |
| Workspace | Workspace of the portfolio. Accepts Fixed Workspace. Defaults to the current workspace |
| Benchmark | Benchmark symbol for the backtest. Accepts Symbol. Defaults to IND:SPX |
| Risk Free Rate Index | The risk-free rate index used in statistics calculations |
| Date Range | The date range for calculations. Choose Custom Range (start and end dates), Last N Periods (Days, Weeks, Months, or Years), or Period to Date (Month, Quarter, or Year) |

Output¶
| Field | Description |
|---|---|
| Name | Name of the output datastore. Accepts Template Text or Upstream Data. Defaults to the portfolio name |
| Date | Date of the output datastore. Accepts Fixed Date or Upstream Data. Defaults to the portfolio date |
| Workspace | Workspace where the output datastore will be saved. Accepts Fixed Workspace. Defaults to the portfolio workspace |
| Tags | Tags for the output datastore. Accepts Fixed Tags or Upstream Data. Defaults to the portfolio tags |
| Storage Mode | Transient — exists only within the current workflow run (default); Create — saves the datastore to the platform |

Advanced¶
| Field | Description |
|---|---|
| Header Suffix | Suffix appended to the end of column names in the output datastore. Accepts Template Text or Upstream Data. Default is no suffix |

Result¶
Once the worker finishes successfully, it returns a result object containing the datastore. You can check the Output Types article to learn more about result object types.
- Datastore (datastore)
- ID (string)
- Name (string)
- Date (date)
- Tags (list of strings)
- Data (list of lists)
The Data component includes the following columns:
port_bt_start_dateport_bt_end_dateport_bt_monthly_return_averageport_bt_monthly_return_highport_bt_monthly_return_lowport_bt_monthly_return_compoundedport_bt_annual_return_compoundedport_bt_monthly_return_cummulativeport_bt_percent_positive_monthsport_bt_percent_negative_monthsport_bt_average_positive_monthport_bt_average_negative_monthport_bt_profit_to_lossport_bt_maximum_drawdownport_bt_maximum_drawdown_startport_bt_maximum_drawdown_endport_bt_streak_positive_monthsport_bt_streak_positive_startport_bt_streak_positive_endport_bt_streak_negative_monthsport_bt_streak_negative_startport_bt_streak_negative_endport_bt_monthly_standard_deviationport_bt_annual_standard_deviationport_bt_annual_varport_bt_annual_var_confidenceport_bt_monthly_downside_deviationport_bt_annual_downside_deviationport_bt_skewnessport_bt_excess_kurtosisport_bt_risk_free_rateport_bt_risk_free_rate_averageport_bt_monthly_sharpe_ratioport_bt_annual_sharpe_ratioport_bt_monthly_sortino_ratioport_bt_annual_sortino_ratioport_bt_monthly_treynor_ratioport_bt_annual_treynor_ratioport_bt_monthly_information_ratioport_bt_annual_information_ratioport_bt_benchmarkport_bt_monthly_alphaport_bt_annual_alphaport_bt_betaport_bt_correlationport_bt_r2port_bt_monthly_tracking_errorport_bt_annual_tracking_errorport_bt_upside_captureport_bt_downside_capture