Remove deprecated pandas option
This commit is contained in:
		| @@ -246,14 +246,8 @@ def _load_backtest_data_df_compatibility(df: pd.DataFrame) -> pd.DataFrame: | ||||
|     """ | ||||
|     Compatibility support for older backtest data. | ||||
|     """ | ||||
|     df['open_date'] = pd.to_datetime(df['open_date'], | ||||
|                                      utc=True, | ||||
|                                      infer_datetime_format=True | ||||
|                                      ) | ||||
|     df['close_date'] = pd.to_datetime(df['close_date'], | ||||
|                                       utc=True, | ||||
|                                       infer_datetime_format=True | ||||
|                                       ) | ||||
|     df['open_date'] = pd.to_datetime(df['open_date'], utc=True) | ||||
|     df['close_date'] = pd.to_datetime(df['close_date'], utc=True) | ||||
|     # Compatibility support for pre short Columns | ||||
|     if 'is_short' not in df.columns: | ||||
|         df['is_short'] = False | ||||
|   | ||||
| @@ -34,7 +34,7 @@ def ohlcv_to_dataframe(ohlcv: list, timeframe: str, pair: str, *, | ||||
|     cols = DEFAULT_DATAFRAME_COLUMNS | ||||
|     df = DataFrame(ohlcv, columns=cols) | ||||
|  | ||||
|     df['date'] = to_datetime(df['date'], unit='ms', utc=True, infer_datetime_format=True) | ||||
|     df['date'] = to_datetime(df['date'], unit='ms', utc=True) | ||||
|  | ||||
|     # Some exchanges return int values for Volume and even for OHLC. | ||||
|     # Convert them since TA-LIB indicators used in the strategy assume floats | ||||
|   | ||||
| @@ -63,10 +63,7 @@ class FeatherDataHandler(IDataHandler): | ||||
|         pairdata.columns = self._columns | ||||
|         pairdata = pairdata.astype(dtype={'open': 'float', 'high': 'float', | ||||
|                                           'low': 'float', 'close': 'float', 'volume': 'float'}) | ||||
|         pairdata['date'] = to_datetime(pairdata['date'], | ||||
|                                        unit='ms', | ||||
|                                        utc=True, | ||||
|                                        infer_datetime_format=True) | ||||
|         pairdata['date'] = to_datetime(pairdata['date'], unit='ms', utc=True) | ||||
|         return pairdata | ||||
|  | ||||
|     def ohlcv_append( | ||||
|   | ||||
| @@ -75,10 +75,7 @@ class JsonDataHandler(IDataHandler): | ||||
|             return DataFrame(columns=self._columns) | ||||
|         pairdata = pairdata.astype(dtype={'open': 'float', 'high': 'float', | ||||
|                                           'low': 'float', 'close': 'float', 'volume': 'float'}) | ||||
|         pairdata['date'] = to_datetime(pairdata['date'], | ||||
|                                        unit='ms', | ||||
|                                        utc=True, | ||||
|                                        infer_datetime_format=True) | ||||
|         pairdata['date'] = to_datetime(pairdata['date'], unit='ms', utc=True) | ||||
|         return pairdata | ||||
|  | ||||
|     def ohlcv_append( | ||||
|   | ||||
| @@ -62,10 +62,7 @@ class ParquetDataHandler(IDataHandler): | ||||
|         pairdata.columns = self._columns | ||||
|         pairdata = pairdata.astype(dtype={'open': 'float', 'high': 'float', | ||||
|                                           'low': 'float', 'close': 'float', 'volume': 'float'}) | ||||
|         pairdata['date'] = to_datetime(pairdata['date'], | ||||
|                                        unit='ms', | ||||
|                                        utc=True, | ||||
|                                        infer_datetime_format=True) | ||||
|         pairdata['date'] = to_datetime(pairdata['date'], unit='ms', utc=True) | ||||
|         return pairdata | ||||
|  | ||||
|     def ohlcv_append( | ||||
|   | ||||
		Reference in New Issue
	
	Block a user