Skip to content

Commit

Permalink
fix: error in sharpee ratio
Browse files Browse the repository at this point in the history
  • Loading branch information
dev-abuke committed Jun 27, 2024
1 parent d898d8b commit f7829fe
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,5 @@ mlflow
passlib
python-jose
kafka-python
tensorflow
tensorflow
apache-airflow
2 changes: 1 addition & 1 deletion scripts/backtesting/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ def run_backtest(config):
mlflow.log_param("indicator", indicator)

final_value = cerebro.broker.getvalue()
sharpe_ratio = strat.analyzers.sharperatio.get_analysis()['sharperatio']
sharpe_ratio = strat.analyzers.sharperatio.get_analysis()['sharperatio'] or 0
metrics_analyzer = strat.analyzers.getbyname('MetricsAnalyzer')
metrics = metrics_analyzer.get_analysis()
percentage_return = metrics['return']
Expand Down

0 comments on commit f7829fe

Please sign in to comment.