added test_VolumePairList_range to test_pairlist.py

This commit is contained in:
nightshift2k
2021-07-05 20:59:27 +02:00
parent 85c7b55750
commit 1e87225e91
2 changed files with 96 additions and 2 deletions

View File

@@ -171,13 +171,12 @@ class VolumePairList(IPairList):
candles = self._exchange.refresh_latest_ohlcv(
needed_pairs, since_ms=since_ms, cache=False
)
for i, p in enumerate(filtered_tickers):
pair_candles = candles[
(p['symbol'], self._lookback_timeframe)
] if (p['symbol'], self._lookback_timeframe) in candles else None
# in case of candle data calculate typical price and quoteVolume for candle
if not pair_candles.empty:
if pair_candles is not None and not pair_candles.empty:
pair_candles['typical_price'] = (pair_candles['high'] + pair_candles['low']
+ pair_candles['close']) / 3
pair_candles['quoteVolume'] = (