mirror of
https://github.com/freqtrade/freqtrade.git
synced 2024-11-10 18:23:55 +00:00
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() ``` |
||
---|---|---|
.. | ||
space | ||
__init__.py | ||
backtesting.py | ||
default_hyperopt_loss.py | ||
edge_cli.py | ||
hyperopt_auto.py | ||
hyperopt_interface.py | ||
hyperopt_loss_interface.py | ||
hyperopt_loss_onlyprofit.py | ||
hyperopt_loss_sharpe_daily.py | ||
hyperopt_loss_sharpe.py | ||
hyperopt_loss_sortino_daily.py | ||
hyperopt_loss_sortino.py | ||
hyperopt_tools.py | ||
hyperopt.py | ||
optimize_reports.py |