Add 'Is pair' in the list-markets tabular output

This commit is contained in:
hroff-1902 2019-10-14 13:48:33 +03:00
parent 6e27c47dee
commit 4111734637

View File

@ -10,7 +10,8 @@ from freqtrade import OperationalException
from freqtrade.configuration import Configuration, TimeRange from freqtrade.configuration import Configuration, TimeRange
from freqtrade.configuration.directory_operations import create_userdata_dir from freqtrade.configuration.directory_operations import create_userdata_dir
from freqtrade.data.history import refresh_backtest_ohlcv_data from freqtrade.data.history import refresh_backtest_ohlcv_data
from freqtrade.exchange import (available_exchanges, ccxt_exchanges, market_is_active) from freqtrade.exchange import (available_exchanges, ccxt_exchanges, market_is_active,
market_is_pair)
from freqtrade.misc import plural from freqtrade.misc import plural
from freqtrade.resolvers import ExchangeResolver from freqtrade.resolvers import ExchangeResolver
from freqtrade.state import RunMode from freqtrade.state import RunMode
@ -157,10 +158,12 @@ def start_list_pairs(args: Dict[str, Any], pairs_only: bool = False) -> None:
(f": {sorted(pairs.keys())}" if len(pairs) else "") + ".") (f": {sorted(pairs.keys())}" if len(pairs) else "") + ".")
else: else:
# print data as a table # print data as a table
headers = ['Id', 'Symbol', 'Base', 'Quote', 'Active']
if not pairs_only:
headers.append('Is pair')
tabular_data = [] tabular_data = []
for _, v in pairs.items(): for _, v in pairs.items():
tabular_data.append([v['id'], v['symbol'], v['base'], v['quote'], tabular_data.append([v['id'], v['symbol'], v['base'], v['quote'],
"Yes" if market_is_active(v) else "No"]) "Yes" if market_is_active(v) else "No",
"Yes" if market_is_pair(v) else "No"])
headers = ['Id', 'Symbol', 'Base', 'Quote', 'Active']
print(tabulate(tabular_data, headers=headers, tablefmt='pipe')) print(tabulate(tabular_data, headers=headers, tablefmt='pipe'))