Fix last occurances of pair splitting
This commit is contained in:
parent
d34515a5de
commit
31ac4598ba
@ -232,13 +232,13 @@ class Exchange:
|
|||||||
"""
|
"""
|
||||||
Return a pair's quote currency
|
Return a pair's quote currency
|
||||||
"""
|
"""
|
||||||
return self.markets[pair].get('quote')
|
return self.markets.get(pair, {}).get('quote')
|
||||||
|
|
||||||
def get_pair_base_currency(self, pair: str) -> str:
|
def get_pair_base_currency(self, pair: str) -> str:
|
||||||
"""
|
"""
|
||||||
Return a pair's quote currency
|
Return a pair's quote currency
|
||||||
"""
|
"""
|
||||||
return self.markets[pair].get('base')
|
return self.markets.get(pair, {}).get('base')
|
||||||
|
|
||||||
def klines(self, pair_interval: Tuple[str, str], copy: bool = True) -> DataFrame:
|
def klines(self, pair_interval: Tuple[str, str], copy: bool = True) -> DataFrame:
|
||||||
if pair_interval in self._klines:
|
if pair_interval in self._klines:
|
||||||
|
@ -91,9 +91,9 @@ class VolumePairList(IPairList):
|
|||||||
|
|
||||||
if self._pairlist_pos == 0:
|
if self._pairlist_pos == 0:
|
||||||
# If VolumePairList is the first in the list, use fresh pairlist
|
# If VolumePairList is the first in the list, use fresh pairlist
|
||||||
# check length so that we make sure that '/' is actually in the string
|
# check base currency equals to stake currency.
|
||||||
filtered_tickers = [v for k, v in tickers.items()
|
filtered_tickers = [v for k, v in tickers.items()
|
||||||
if (len(k.split('/')) == 2 and k.split('/')[1] == base_currency
|
if (self._exchange.get_pair_quote_currency(k) == base_currency
|
||||||
and v[key] is not None)]
|
and v[key] is not None)]
|
||||||
else:
|
else:
|
||||||
# If other pairlist is in front, use the incomming pairlist.
|
# If other pairlist is in front, use the incomming pairlist.
|
||||||
|
@ -462,7 +462,7 @@ class RPC:
|
|||||||
|
|
||||||
# Check pair is in stake currency
|
# Check pair is in stake currency
|
||||||
stake_currency = self._freqtrade.config.get('stake_currency')
|
stake_currency = self._freqtrade.config.get('stake_currency')
|
||||||
if not pair.endswith(stake_currency):
|
if not self._freqtrade.exchange.get_pair_quote_currency(pair) == stake_currency:
|
||||||
raise RPCException(
|
raise RPCException(
|
||||||
f'Wrong pair selected. Please pairs with stake {stake_currency} pairs only')
|
f'Wrong pair selected. Please pairs with stake {stake_currency} pairs only')
|
||||||
# check if valid pair
|
# check if valid pair
|
||||||
@ -517,7 +517,7 @@ class RPC:
|
|||||||
if add:
|
if add:
|
||||||
stake_currency = self._freqtrade.config.get('stake_currency')
|
stake_currency = self._freqtrade.config.get('stake_currency')
|
||||||
for pair in add:
|
for pair in add:
|
||||||
if (pair.endswith(stake_currency)
|
if (self._freqtrade.exchange.get_pair_quote_currency(pair) == stake_currency
|
||||||
and pair not in self._freqtrade.pairlists.blacklist):
|
and pair not in self._freqtrade.pairlists.blacklist):
|
||||||
self._freqtrade.pairlists.blacklist.append(pair)
|
self._freqtrade.pairlists.blacklist.append(pair)
|
||||||
|
|
||||||
|
@ -687,7 +687,7 @@ def test_rpcforcebuy(mocker, default_conf, ticker, fee, limit_buy_order) -> None
|
|||||||
|
|
||||||
# Test buy pair not with stakes
|
# Test buy pair not with stakes
|
||||||
with pytest.raises(RPCException, match=r'Wrong pair selected. Please pairs with stake.*'):
|
with pytest.raises(RPCException, match=r'Wrong pair selected. Please pairs with stake.*'):
|
||||||
rpc._rpc_forcebuy('XRP/ETH', 0.0001)
|
rpc._rpc_forcebuy('LTC/ETH', 0.0001)
|
||||||
pair = 'XRP/BTC'
|
pair = 'XRP/BTC'
|
||||||
|
|
||||||
# Test not buying
|
# Test not buying
|
||||||
|
Loading…
Reference in New Issue
Block a user