scrtlabs / catalyst

An Algorithmic Trading Library for Crypto-Assets in Python
http://enigma.co
Apache License 2.0
2.49k stars 725 forks source link

Symbol not found on exchange Binance #102

Closed jmootoosamy closed 6 years ago

jmootoosamy commented 6 years ago

Dear Catalyst Maintainers,

Before I tell you about my issue, let me describe my environment:

Environment

Now that you know a little about me, let me tell you about the issue I am having:

Description of Issue

In this case, I executed this:

catalyst ingest-exchange -x binance -f daily -i btc_usdt

Running the algo will then throw the following error:

SymbolNotFoundOnExchange: Symbol BTC_USDT not found on exchange Binance. Choose from: ['123_456', 'ada_btc', 'ada_eth', 'adx_bnb', 'adx_btc', 'adx_eth', 'amb_bnb', 'amb_btc', 'amb_eth', 'ark_btc', 'ark_eth', 'arn_btc', 'arn_eth', 'ast_btc', 'ast_eth', 'bat_bnb', 'bat_btc', 'bat_eth', 'bcd_btc', 'bcd_eth', 'bch_bnb', 'bch_btc', 'bch_eth', 'bch_usdt', 'bcpt_bnb', 'bcpt_btc', 'bcpt_eth', 'bnb_btc', 'bnb_eth', 'bnb_usdt', 'bnt_btc', 'bnt_eth', 'bqx_btc', 'bqx_eth', 'btc_usdt', 'btg_btc', 'btg_eth', 'bts_bnb', 'bts_btc', 'bts_eth', 'cdt_btc', 'cdt_eth', 'cmt_bnb', 'cmt_btc', 'cmt_eth', 'cnd_bnb', 'cnd_btc', 'cnd_eth', 'ctr_btc', 'ctr_eth', 'dash_btc', 'dash_eth', 'dgd_btc', 'dgd_eth', 'dlt_bnb', 'dlt_btc', 'dlt_eth', 'dnt_btc', 'dnt_eth', 'eng_btc', 'eng_eth', 'enj_btc', 'enj_eth', 'eos_btc', 'eos_eth', 'etc_btc', 'etc_eth', 'eth_btc', 'eth_usdt', 'evx_btc', 'evx_eth', 'fuel_btc', 'fuel_eth', 'fun_btc', 'fun_eth', 'gas_btc', 'gvt_btc', 'gvt_eth', 'gxs_btc', 'gxs_eth', 'hsr_btc', 'hsr_eth', 'icn_btc', 'icn_eth', 'iota_bnb', 'iota_btc', 'iota_eth', 'kmd_btc', 'kmd_eth', 'knc_btc', 'knc_eth', 'lend_btc', 'lend_eth', 'link_btc', 'link_eth', 'lrc_btc', 'lrc_eth', 'lsk_bnb', 'lsk_btc', 'lsk_eth', 'ltc_bnb', 'ltc_btc', 'ltc_eth', 'ltc_usdt', 'mana_btc', 'mana_eth', 'mco_btc', 'mco_eth', 'mda_btc', 'mda_eth', 'mod_btc', 'mod_eth', 'mth_btc', 'mth_eth', 'mtl_btc', 'mtl_eth', 'neo_bnb', 'neo_btc', 'neo_eth', 'neo_usdt', 'nuls_bnb', 'nuls_btc', 'nuls_eth', 'oax_btc', 'oax_eth', 'omg_btc', 'omg_eth', 'poe_btc', 'poe_eth', 'powr_bnb', 'powr_btc', 'powr_eth', 'ppt_btc', 'ppt_eth', 'qsp_bnb', 'qsp_btc', 'qsp_eth', 'qtum_btc', 'qtum_eth', 'rcn_bnb', 'rcn_btc', 'rcn_eth', 'rdn_bnb', 'rdn_btc', 'rdn_eth', 'req_btc', 'req_eth', 'salt_btc', 'salt_eth', 'sngls_btc', 'sngls_eth', 'snm_btc', 'snm_eth', 'snt_btc', 'snt_eth', 'storj_btc', 'storj_eth', 'strat_btc', 'strat_eth', 'sub_btc', 'sub_eth', 'tnb_btc', 'tnb_eth', 'tnt_btc', 'tnt_eth', 'trx_btc', 'trx_eth', 'ven_bnb', 'ven_btc', 'ven_eth', 'vib_btc', 'vib_eth', 'wabi_bnb', 'wabi_btc', 'wabi_eth', 'waves_bnb', 'waves_btc', 'waves_eth', 'wtc_bnb', 'wtc_btc', 'wtc_eth', 'xlm_bnb', 'xlm_btc', 'xlm_eth', 'xmr_btc', 'xmr_eth', 'xrp_btc', 'xrp_eth', 'xvg_btc', 'xvg_eth', 'xzc_bnb', 'xzc_btc', 'xzc_eth', 'yoyo_bnb', 'yoyo_btc', 'yoyo_eth', 'zec_btc', 'zec_eth', 'zrx_btc', 'zrx_eth']

Here is how you can reproduce this issue on your machine:

Reproduction Steps

1.Ingest Binance BTC/USDT data

catalyst ingest-exchange -x binance -f daily -i btc_usdt

2.Run test algo

import time import pandas as pd from logbook import Logger from catalyst import run_algorithm from catalyst.api import symbol

NAMESPACE = 'test' log = Logger(NAMESPACE)

def initialize(context): context.market = symbol('btc_usdt') context.CANDLE_SIZE = '1d'

def handle_data(context, data): price_history = data.history( context.market, fields='close', bar_count=10, frequency=context.CANDLE_SIZE )

def analyze(context=None, perf=None): end = time.time() log.info('elapsed time: {}'.format(end - context.start_time)) pass

if name == 'main': run_algorithm( capital_base=10000, data_frequency='daily', initialize=initialize, handle_data=handle_data, analyze=analyze, exchange_name='binance', algo_namespace=NAMESPACE, base_currency='usdt', start=pd.to_datetime('2017-12-14', utc=True), end=pd.to_datetime('2017-12-15', utc=True) )

What steps have you taken to resolve this already?

I have tried using other symbols and currency pairs but haven't managed to make it work.

Thanks for your help!

fredfortier commented 6 years ago

Historical data not yet available for Binance.

On Sun, Dec 17, 2017 at 2:01 AM jmootoosamy notifications@github.com wrote:

Dear Catalyst Maintainers,

Before I tell you about my issue, let me describe my environment: Environment

  • Operating System: Ubuntu 16
  • Python Version: 2.7
  • Python Bitness: 64
  • How did you install Catalyst: conda
  • Python packages: asn1crypto==0.22.0 certifi==2017.7.27.1 cffi==1.10.0 chardet==3.0.4 conda==4.3.30 cryptography==2.0.3 decorator==4.1.2 enum34==1.1.6 functools32==3.2.3.post2 idna==2.6 ipaddress==1.0.18 ipython-genutils==0.2.0 jsonschema==2.6.0 jupyter-core==4.4.0 nbformat==4.4.0 numpy==1.13.3 plotly==2.2.3 pycosat==0.6.2 pycparser==2.18 pyOpenSSL==17.2.0 PySocks==1.6.7 pytz==2017.3 requests==2.18.4 ruamel-yaml==0.11.14 scipy==1.0.0 six==1.10.0 TA-Lib==0.4.10 traitlets==4.3.2 urllib3==1.22

Now that you know a little about me, let me tell you about the issue I am having: Description of Issue

-

What did you expect to happen? Using Catalyst v0.4, I expected to be able to run my algo on Binance

What happened instead? Ingesting data from binance runs without throwing an error, what ever the frequency or currency pair (even "ingest-exchange -x binance -f daily -i xxxxxxxx" will run)

In this case, I executed this:

catalyst ingest-exchange -x binance -f daily -i btc_usdt

Running the algo will then throw the following error:

SymbolNotFoundOnExchange: Symbol BTC_USDT not found on exchange Binance. Choose from: ['123_456', 'ada_btc', 'ada_eth', 'adx_bnb', 'adx_btc', 'adx_eth', 'amb_bnb', 'amb_btc', 'amb_eth', 'ark_btc', 'ark_eth', 'arn_btc', 'arn_eth', 'ast_btc', 'ast_eth', 'bat_bnb', 'bat_btc', 'bat_eth', 'bcd_btc', 'bcd_eth', 'bch_bnb', 'bch_btc', 'bch_eth', 'bch_usdt', 'bcpt_bnb', 'bcpt_btc', 'bcpt_eth', 'bnb_btc', 'bnb_eth', 'bnb_usdt', 'bnt_btc', 'bnt_eth', 'bqx_btc', 'bqx_eth', 'btc_usdt', 'btg_btc', 'btg_eth', 'bts_bnb', 'bts_btc', 'bts_eth', 'cdt_btc', 'cdt_eth', 'cmt_bnb', 'cmt_btc', 'cmt_eth', 'cnd_bnb', 'cnd_btc', 'cnd_eth', 'ctr_btc', 'ctr_eth', 'dash_btc', 'dash_eth', 'dgd_btc', 'dgd_eth', 'dlt_bnb', 'dlt_btc', 'dlt_eth', 'dnt_btc', 'dnt_eth', 'eng_btc', 'eng_eth', 'enj_btc', 'enj_eth', 'eos_btc', 'eos_eth', 'etc_btc', 'etc_eth', 'eth_btc', 'eth_usdt', 'evx_btc', 'evx_eth', 'fuel_btc', 'fuel_eth', 'fun_btc', 'fun_eth', 'gas_btc', 'gvt_btc', 'gvt_eth', 'gxs_btc', 'gxs_eth', 'hsr_btc', 'hsr_eth', 'icn_btc', 'icn_eth', 'iota_bnb', 'iota_btc', 'iota_eth', 'kmd_btc', 'kmd_eth', 'knc_btc', 'knc_eth', 'lend_btc', 'lend_eth', 'link_btc', 'link_eth', 'lrc_btc', 'lrc_eth', 'lsk_bnb', 'lsk_btc', 'lsk_eth', 'ltc_bnb', 'ltc_btc', 'ltc_eth', 'ltc_usdt', 'mana_btc', 'mana_eth', 'mco_btc', 'mco_eth', 'mda_btc', 'mda_eth', 'mod_btc', 'mod_eth', 'mth_btc', 'mth_eth', 'mtl_btc', 'mtl_eth', 'neo_bnb', 'neo_btc', 'neo_eth', 'neo_usdt', 'nuls_bnb', 'nuls_btc', 'nuls_eth', 'oax_btc', 'oax_eth', 'omg_btc', 'omg_eth', 'poe_btc', 'poe_eth', 'powr_bnb', 'powr_btc', 'powr_eth', 'ppt_btc', 'ppt_eth', 'qsp_bnb', 'qsp_btc', 'qsp_eth', 'qtum_btc', 'qtum_eth', 'rcn_bnb', 'rcn_btc', 'rcn_eth', 'rdn_bnb', 'rdn_btc', 'rdn_eth', 'req_btc', 'req_eth', 'salt_btc', 'salt_eth', 'sngls_btc', 'sngls_eth', 'snm_btc', 'snm_eth', 'snt_btc', 'snt_eth', 'storj_btc', 'storj_eth', 'strat_btc', 'strat_eth', 'sub_btc', 'sub_eth', 'tnb_btc', 'tnb_eth', 'tnt_btc', 'tnt_eth', 'trx_btc', 'trx_eth', 'ven_bnb', 'ven_btc', 'ven_eth', 'vib_btc', 'vib_eth', 'wabi_bnb', 'wabi_btc', 'wabi_eth', 'waves_bnb', 'waves_btc', 'waves_eth', 'wtc_bnb', 'wtc_btc', 'wtc_eth', 'xlm_bnb', 'xlm_btc', 'xlm_eth', 'xmr_btc', 'xmr_eth', 'xrp_btc', 'xrp_eth', 'xvg_btc', 'xvg_eth', 'xzc_bnb', 'xzc_btc', 'xzc_eth', 'yoyo_bnb', 'yoyo_btc', 'yoyo_eth', 'zec_btc', 'zec_eth', 'zrx_btc', 'zrx_eth']

Here is how you can reproduce this issue on your machine: Reproduction Steps

1.Ingest Binance BTC/USDT data

catalyst ingest-exchange -x binance -f daily -i btc_usdt

2.Run test algo

import time import pandas as pd from logbook import Logger from catalyst import run_algorithm from catalyst.api import symbol

NAMESPACE = 'test' log = Logger(NAMESPACE)

def initialize(context): context.market = symbol('btc_usdt') context.CANDLE_SIZE = '1d'

def handle_data(context, data): price_history = data.history( context.market, fields='close', bar_count=10, frequency=context.CANDLE_SIZE )

def analyze(context=None, perf=None): end = time.time() log.info('elapsed time: {}'.format(end - context.start_time)) pass

if name == 'main': run_algorithm( capital_base=10000, data_frequency='daily', initialize=initialize, handle_data=handle_data, analyze=analyze, exchange_name='binance', algo_namespace=NAMESPACE, base_currency='usdt', start=pd.to_datetime('2017-12-14', utc=True), end=pd.to_datetime('2017-12-15', utc=True) ) What steps have you taken to resolve this already?

I have tried using other symbols and currency pairs but haven't managed to make it work.

Thanks for your help!

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/enigmampc/catalyst/issues/102, or mute the thread https://github.com/notifications/unsubscribe-auth/ABZ-QpPaG-2duTvLifKkLul-L5qZ2ji9ks5tBLw2gaJpZM4REkZV .

jmootoosamy commented 6 years ago

OK thanks , looking forward to using the new features!

fredfortier commented 6 years ago

This is coming soon. We were able to download most of the Binance historical data already. On Sun, Dec 17, 2017 at 8:29 PM jmootoosamy notifications@github.com wrote:

OK thanks , looking forward to using the new features!

— You are receiving this because you commented.

Reply to this email directly, view it on GitHub https://github.com/enigmampc/catalyst/issues/102#issuecomment-352323265, or mute the thread https://github.com/notifications/unsubscribe-auth/ABZ-QsK_sh2nifdM6TImNaYshfPzpxXOks5tBeongaJpZM4REkZV .

7AC commented 6 years ago

Is there another issue tracking historical data from binance? If not can we keep this one open @jmootoosamy?

jmootoosamy commented 6 years ago

Done