Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added Support for Crypto-Currencies list on Binance #13

Merged
merged 3 commits into from Sep 9, 2020

Conversation

MohanVashist1
Copy link
Contributor

This PR is to support Crypto-Currencies listed on Binance. With some simple modifications you can add support for more data sources/exchanges with ease.

List of changes:

  • requirements.txt: Included python-binance as well as the supported packages required by python-binance
  • Readme.md: Added section about how to use Binance as a data source and how to use an alternative ticker list
  • crypto_list.txt: Sample list of crypto currencies from Binance
  • detection_engine.py: added two new arguments; the data source and the stocks list. Data source tells the program where to go to fetch data (currently either yahoo finance(default) or binance). Stocks list is the file in the stocks folder which contains the list of tickers to use.
    - Added argument checking. Data source must be either 'yahoo_finance' or 'binance', stocks list must exist in the stocks folder
  • data_loader.py
    - Added new two input parameters to data_loader.py,
    - changed how the stocks list is read by using the file indicated by the stocks_list parameter
    - added the ability to get data from the binance client
    - line 188-190 fixed bug with saving dictionary every 100 iterations. Due to the continue statements, the size of the dictionary can increase but checking if you need to save the file may not occur. Thus, I moved the statement which checks if we need to save the dictionary immediately after we add to the dictionary

@tradytics
Copy link
Owner

This looks awesome. Just one question, did you test the program again with both stocks and crypto?

@MohanVashist1
Copy link
Contributor Author

Apologies, I should have included this in the PR but yes I did test it here is the output:
For the command:

python detection_engine.py --top_n 25 --min_volume 5000 --data_granularity_minutes 60 --history_to_use 14 --is_load_from_dictionary 0 --data_dictionary_path 'dictionaries/data_dict.npy' --is_save_dictionary 1 --is_test 0 --future_bars 0

supriver_out_1

For the command:

python detection_engine.py --top_n 25 --min_volume 5000 --data_granularity_minutes 60 --history_to_use 14 --is_load_from_dictionary 1 --data_dictionary_path 'dictionaries/data_dict.npy' --is_save_dictionary 0 --is_test 0 --future_bars 0 --output_format 'CLI'

supriver_out_2

For the command:

python detection_engine.py --top_n 25 --min_volume 500 --data_granularity_minutes 60 --history_to_use 14 --is_load_from_dictionary 0 --data_dictionary_pata_source binance --stock_list cryptos.txt

supriver_out_3

Also note that I will be watching the Github issues for any problems that may arise. Also, feel free to contact me if you find anything else.

Thanks,
Mohan
mohan.vashist@mail.utoronto.ca

@tradytics
Copy link
Owner

This is awesome. Thank you so much. Merging it now.

@tradytics tradytics merged commit cbcc7a3 into tradytics:master Sep 9, 2020
@MohanVashist1
Copy link
Contributor Author

Appreciate the kind words :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants