From bce5dc4a492da8cd8c9e63f50a4e13fb1b56a04b Mon Sep 17 00:00:00 2001 From: Matthias Date: Sat, 16 Mar 2024 16:23:20 +0100 Subject: [PATCH] Simplify formatting --- freqtrade/data/converter/orderflow.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/freqtrade/data/converter/orderflow.py b/freqtrade/data/converter/orderflow.py index fb9a2a4de..8266a44de 100644 --- a/freqtrade/data/converter/orderflow.py +++ b/freqtrade/data/converter/orderflow.py @@ -50,8 +50,7 @@ def _calculate_ohlcv_candle_start_and_end(df: DataFrame, timeframe: str): df['datetime'] = pd.to_datetime(df['date'], unit='ms') df['candle_start'] = df['datetime'].dt.floor(timeframe_frequency) # used in _now_is_time_to_refresh_trades - df['candle_end'] = df['candle_start'] + \ - pd.Timedelta(minutes=timeframe_minutes) + df['candle_end'] = df['candle_start'] + pd.Timedelta(minutes=timeframe_minutes) df.drop(columns=['datetime'], inplace=True) @@ -90,8 +89,7 @@ def populate_dataframe_with_trades(config: Config, is_between = (candle_start == df['candle_start']) if np.any(is_between == True): # noqa: E712 (_, timeframe_minutes) = _convert_timeframe_to_pandas_frequency(timeframe) - candle_next = candle_start + \ - pd.Timedelta(minutes=timeframe_minutes) + candle_next = candle_start + pd.Timedelta(minutes=timeframe_minutes) # skip if there are no trades at next candle # because that this candle isn't finished yet if candle_next not in trades_grouped_by_candle_start.groups: