Can i specify the coins in Multiple coins one exchange ? thanks.
littleworm2018 opened this issue · 2 comments
littleworm2018 commented
Hi, Thank you for your work.
some coins i don't want to get, Can i specify the coins in Multiple coins one exchange ? thanks?
wardbradt commented
I do not have the time right now to add this in, but, to do this, you have two options. Both of them require modifying this piece of code in peregrinearb/utils/single_exchange.py.
tasks = [_add_weighted_edge_to_graph(exchange, market_name, graph,
log=True, fee=fee, suppress=suppress, ticker=ticker, depth=depth)
for market_name, ticker in tickers.items()]
- Make
load_exchange_graph
take a parametermarkets
, alist
or other iterable.markets
is the markets (trading pairs) you are interested in. Change the above piece of code to:
tasks = [_add_weighted_edge_to_graph(exchange, market_name, graph,
log=True, fee=fee, suppress=suppress, ticker=tickers[market_name], depth=depth)
for market_name in markets]
- Make
load_exchange_graph
takecurrencies
, alist
of the currencies you are interested in, as a parameter. Change the piece of code to:
tasks = [_add_weighted_edge_to_graph(exchange, market_name, graph,
log=True, fee=fee, suppress=suppress, ticker=ticker, depth=depth)
for market_name, ticker in tickers.items() if (market_name.split('/')[0] in currencies or market_name.split('/')[1] in currencies)]
For option 2, you can replace or
with and
if you want to.
littleworm2018 commented
roger that.
Thank you for your detailed explanation.