Futures volumepairlist to account for contract size

This commit is contained in:
Matthias 2022-09-02 07:11:20 +02:00
parent 11fbfd3402
commit b53791fef2

View File

@ -186,6 +186,7 @@ class VolumePairList(IPairList):
needed_pairs, since_ms=since_ms, cache=False needed_pairs, since_ms=since_ms, cache=False
) )
for i, p in enumerate(filtered_tickers): for i, p in enumerate(filtered_tickers):
contract_size = self._exchange.markets[p['symbol']].get('contractSize', 1.0) or 1.0
pair_candles = candles[ pair_candles = candles[
(p['symbol'], self._lookback_timeframe, self._def_candletype) (p['symbol'], self._lookback_timeframe, self._def_candletype)
] if ( ] if (
@ -199,6 +200,7 @@ class VolumePairList(IPairList):
pair_candles['quoteVolume'] = ( pair_candles['quoteVolume'] = (
pair_candles['volume'] * pair_candles['typical_price'] pair_candles['volume'] * pair_candles['typical_price']
* contract_size
) )
else: else:
# Exchange ohlcv data is in quote volume already. # Exchange ohlcv data is in quote volume already.