Skip to content
This repository has been archived by the owner on Nov 19, 2021. It is now read-only.

Can i specify the coins in Multiple coins one exchange ? thanks. #43

Closed
littleworm2018 opened this issue Nov 27, 2018 · 2 comments
Closed
Assignees
Labels
question Further information is requested

Comments

@littleworm2018
Copy link

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?

@littleworm2018 littleworm2018 changed the title Can i specify the coins in Multiple coins one exchange ? thanks? Can i specify the coins in Multiple coins one exchange ? thanks. Nov 27, 2018
@wardbradt
Copy link
Owner

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()]
  1. Make load_exchange_graph take a parameter markets, a list 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]
  1. Make load_exchange_graph take currencies, a list 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.

@wardbradt wardbradt added the question Further information is requested label Nov 28, 2018
@wardbradt wardbradt self-assigned this Nov 28, 2018
@littleworm2018
Copy link
Author

roger that.
Thank you for your detailed explanation.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants