trim trades to the available ohlcv data before plotting profits

This commit is contained in:
orehunt
2020-04-06 15:49:59 +02:00
parent 4e907e2304
commit 20abb379aa
2 changed files with 13 additions and 3 deletions

View File

@@ -385,6 +385,9 @@ def generate_profit_graph(pairs: str, data: Dict[str, pd.DataFrame],
# Combine close-values for all pairs, rename columns to "pair"
df_comb = combine_dataframes_with_mean(data, "close")
# Trim trades to available OHLCV data
trades = extract_trades_of_period(df_comb, trades, date_index=True)
# Add combined cumulative profit
df_comb = create_cum_profit(df_comb, trades, 'cum_profit', timeframe)