From fcded264e6d04fe1f8553c70ac4ad6dc30697d39 Mon Sep 17 00:00:00 2001 From: Sam Germain Date: Sat, 1 Jan 2022 13:53:26 -0600 Subject: [PATCH] removed exchange._get_mark_price_history --- freqtrade/exchange/exchange.py | 40 ---------------------------------- 1 file changed, 40 deletions(-) diff --git a/freqtrade/exchange/exchange.py b/freqtrade/exchange/exchange.py index cdb6de52a..4c9736bbe 100644 --- a/freqtrade/exchange/exchange.py +++ b/freqtrade/exchange/exchange.py @@ -1904,46 +1904,6 @@ class Exchange: except ccxt.BaseError as e: raise OperationalException(e) from e - @retrier - def _get_mark_price_history(self, pair: str, since: int) -> Dict: - """ - Get's the mark price history for a pair - :param pair: The quote/base pair of the trade - :param since: The earliest time to start downloading candles, in ms. - """ - - try: - candles = self._api.fetch_ohlcv( - pair, - timeframe="1h", - since=since, - params={ - 'price': self._ft_has["mark_ohlcv_price"] - } - ) - history = {} - for candle in candles: - d = datetime.fromtimestamp(int(candle[0] / 1000), timezone.utc) - # Round down to the nearest hour, in case of a delayed timestamp - # The millisecond timestamps can be delayed ~20ms - time = timeframe_to_prev_date('1h', d).timestamp() * 1000 - opening_mark_price = candle[1] - history[time] = opening_mark_price - return history - except ccxt.NotSupported as e: - raise OperationalException( - f'Exchange {self._api.name} does not support fetching historical ' - f'mark price candle (OHLCV) data. Message: {e}') from e - except ccxt.DDoSProtection as e: - raise DDosProtection(e) from e - except (ccxt.NetworkError, ccxt.ExchangeError) as e: - raise TemporaryError(f'Could not fetch historical mark price candle (OHLCV) data ' - f'for pair {pair} due to {e.__class__.__name__}. ' - f'Message: {e}') from e - except ccxt.BaseError as e: - raise OperationalException(f'Could not fetch historical mark price candle (OHLCV) data ' - f'for pair {pair}. Message: {e}') from e - def _calculate_funding_fees( self, pair: str,