From 03861945a39af7441f8898f00bf7416f11f7d7ca Mon Sep 17 00:00:00 2001 From: Matthias Date: Thu, 8 Jul 2021 20:04:47 +0200 Subject: [PATCH] Update documentation page too. --- docs/strategy_analysis_example.md | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/docs/strategy_analysis_example.md b/docs/strategy_analysis_example.md index 27c620c3d..27192aa2f 100644 --- a/docs/strategy_analysis_example.md +++ b/docs/strategy_analysis_example.md @@ -148,13 +148,18 @@ import pandas as pd stats = load_backtest_stats(backtest_dir) strategy_stats = stats['strategy'][strategy] +dates = [] +profits = [] +for date_profit in strategy_stats['daily_profit']: + dates.append(date_profit[0]) + profits.append(date_profit[1]) + equity = 0 equity_daily = [] -for dp in strategy_stats['daily_profit']: +for daily_profit in profits: equity_daily.append(equity) - equity += float(dp) + equity += float(daily_profit) -dates = pd.date_range(strategy_stats['backtest_start'], strategy_stats['backtest_end']) df = pd.DataFrame({'dates': dates,'equity_daily': equity_daily})