Skip to content

Commit

Permalink
Merge pull request #1267 from yuntai/fix_in_strategy_report
Browse files Browse the repository at this point in the history
Fix strategy_report filing when `risk_overlay` is not configured
  • Loading branch information
robcarver17 authored Oct 11, 2023
2 parents 923832c + 5cbb2ed commit c82a225
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion sysproduction/strategy_code/report_system_classic.py
Original file line number Diff line number Diff line change
Expand Up @@ -529,7 +529,11 @@ def risk_scaling_string(backtest) -> str:
backtest_system_portfolio_stage.get_leverage_for_original_position().iloc[-1]
)
percentage_vol_target = backtest_system_portfolio_stage.get_percentage_vol_target()
risk_scalar_final = backtest_system_portfolio_stage.get_risk_scalar().iloc[-1]
risk_scalar = backtest_system_portfolio_stage.get_risk_scalar()
if type(risk_scalar) is pd.Series:
risk_scalar_final = risk_scalar.iloc[-1]
else:
risk_scalar_final = risk_scalar
risk_overlay_config = (
backtest_system_portfolio_stage.config.get_element_or_arg_not_supplied(
"risk_overlay"
Expand Down

0 comments on commit c82a225

Please sign in to comment.