mirror of
https://github.com/freqtrade/freqtrade.git
synced 2024-11-10 10:21:59 +00:00
list-available-pairs should be tradingmode dependent
This commit is contained in:
parent
b578e31255
commit
e0e4369c8e
|
@ -254,8 +254,8 @@ def list_available_pairs(timeframe: Optional[str] = None, stake_currency: Option
|
|||
|
||||
dh = get_datahandler(config['datadir'], config.get('dataformat_ohlcv', None))
|
||||
|
||||
# TODO-lev: xmatt to decide: use candle-type or market mode for this endpoint??
|
||||
pair_interval = dh.ohlcv_get_available_data(config['datadir'], 'spot')
|
||||
pair_interval = dh.ohlcv_get_available_data(config['datadir'],
|
||||
config.get('trading_mode', 'spot'))
|
||||
|
||||
if timeframe:
|
||||
pair_interval = [pair for pair in pair_interval if pair[1] == timeframe]
|
||||
|
|
|
@ -1353,6 +1353,13 @@ def test_list_available_pairs(botclient):
|
|||
assert rc.json()['pairs'] == ['XRP/ETH']
|
||||
assert len(rc.json()['pair_interval']) == 1
|
||||
|
||||
ftbot.config['trading_mode'] = 'futures'
|
||||
rc = client_get(
|
||||
client, f"{BASE_URI}/available_pairs?timeframe=1h")
|
||||
assert_response(rc)
|
||||
assert rc.json()['length'] == 1
|
||||
assert rc.json()['pairs'] == ['XRP/USDT']
|
||||
|
||||
rc = client_get(
|
||||
client, f"{BASE_URI}/available_pairs?timeframe=1h&candletype=mark")
|
||||
assert_response(rc)
|
||||
|
|
Loading…
Reference in New Issue
Block a user