4aa2ae37bd
added extra key daily_profit in return of optimize_reports.generate_daily_stats this allows us to analyze and plot a daily profit chart / equity line using snippet below inside jupyter notebook ``` # Plotting equity line (starting with 0 on day 1 and adding daily profit for each backtested day) from freqtrade.configuration import Configuration from freqtrade.data.btanalysis import load_backtest_data, load_backtest_stats import plotly.express as px import pandas as pd # strategy = 'Strat' # config = Configuration.from_files(["user_data/config.json"]) # backtest_dir = config["user_data_dir"] / "backtest_results" stats = load_backtest_stats(backtest_dir) strategy_stats = stats['strategy'][strategy] equity = 0 equity_daily = [] for dp in strategy_stats['daily_profit']: equity_daily.append(equity) equity += float(dp) dates = pd.date_range(strategy_stats['backtest_start'], strategy_stats['backtest_end']) df = pd.DataFrame({'dates':dates,'equity_daily':equity_daily}) fig = px.line(df, x="dates", y="equity_daily") fig.show() ``` |
||
---|---|---|
.. | ||
commands | ||
configuration | ||
data | ||
edge | ||
enums | ||
exchange | ||
mixins | ||
optimize | ||
persistence | ||
plot | ||
plugins | ||
resolvers | ||
rpc | ||
strategy | ||
templates | ||
vendor | ||
__init__.py | ||
__main__.py | ||
constants.py | ||
exceptions.py | ||
freqtradebot.py | ||
loggers.py | ||
main.py | ||
misc.py | ||
wallets.py | ||
worker.py |