backtesting._get_ohlcv_as_lists removed # TODO-lev: Candle-type should be conditional, either "spot" or futures

This commit is contained in:
Sam Germain 2022-02-02 13:30:05 -06:00
parent 64bfa118e0
commit 73d10b5c02
1 changed files with 6 additions and 2 deletions

View File

@ -333,8 +333,12 @@ class Backtesting:
df_analyzed.loc[:, col] = 0 if not tag_col else None
# Update dataprovider cache
self.dataprovider._set_cached_df(pair, self.timeframe, df_analyzed, CandleType.SPOT)
# TODO-lev: Candle-type should be conditional, either "spot" or futures
self.dataprovider._set_cached_df(
pair,
self.timeframe,
df_analyzed,
CandleType.FUTURES if self.trading_mode == TradingMode.FUTURES else CandleType.SPOT
)
df_analyzed = df_analyzed.drop(df_analyzed.head(1).index)