AI4Finance-Foundation / FinRL-Meta

FinRL­-Meta: Dynamic datasets and market environments for FinRL.
https://ai4finance.org
MIT License
1.2k stars 560 forks source link

ValueError: Data source input is NOT supported yet. For Binance #204

Closed tmgondal closed 1 year ago

tmgondal commented 2 years ago

Hello everyone, I am trying to implement FinRL_PaperTrading_Demo.ipynb for Binance rather than Alpaca. But it gives me this error. I tried to alter code as per data_processor and Binance core file. But nothing happens. How it can be modified?

in () 2 API_KEY = API_KEY, 3 API_SECRET = API_SECRET, ----> 4 API_BASE_URL = API_BASE_URL 5 )

/usr/local/lib/python3.7/dist-packages/finrl/meta/data_processor.py in init(self, data_source, **kwargs) 31 32 else: ---> 33 raise ValueError("Data source input is NOT supported yet.") 34 35 def download_data(

ValueError: Data source input is NOT supported yet.

zhumingpassional commented 2 years ago

The newest version of finrl-meta has not been moved to finrl. pls use the data sources that finrl supports.

tmgondal commented 2 years ago

So, it means finrl-meta only works with Alpaca, wrds, and YahooFinance? I am trying to modify it, I guess its not possible then?

zhumingpassional commented 2 years ago

No. there are two finrl-meta, https://github.com/AI4Finance-Foundation/FinRL-Meta and finrl.meta (https://github.com/AI4Finance-Foundation/FinRL/tree/master/finrl/meta). the former one is the newest, but has not been moved to finrl.

which one do you denote?

tmgondal commented 2 years ago

https://github.com/AI4Finance-Foundation/FinRL-Meta , I was using this one

zhumingpassional commented 2 years ago

However, /usr/local/lib/python3.7/dist-packages/finrl/meta/data_processor.py in init(self, data_source, **kwargs) 31 32 else: ---> 33 raise ValueError("Data source input is NOT supported yet.") denote that the folder is finrl/meta

If you use finrl-meta, you should git clone https://github.com/AI4Finance-Foundation/FinRL-Meta.git. Have you added it in your notebook?

tmgondal commented 2 years ago

Yes, I have added it in y notebook. I tried to modify my code by modifying /usr/local/lib/python3.7/dist-packages/finrl/meta/data_processor.py. In this file, I tried to input it as "from finrl.meta.data_processors.processor_alpaca import AlpacaProcessor as Alpaca" to from finrl.meta.data_processors.processor_binance import BinanceProcessor as Binance.

I thought if the binance file is present in meta/data_preprocessors then it should work

zhumingpassional commented 2 years ago

pls read https://github.com/AI4Finance-Foundation/FinRL-Meta/blob/master/tests/test_binance.py make sure that the import is correct, and the binance code you added is correct.

tmgondal commented 2 years ago

I have rechecked, the issue remains. Meanwhile, "FinRL_PaperTrading_Demo.ipynb", also has issues while working with Alpaca API. I don't know why is so, but I think, may be repo is still getting changes may be thats why there are many issues i.e.,

/usr/local/lib/python3.7/dist-packages/elegantrl/train/config.py in init(self, agent, env, env_func, env_args) 27 self.net_dim = 2 ** 7 # the network width 28 self.num_layer = 2 # layer number of MLP (Multi-layer perception, assert layer_num>=2) ---> 29 self.if_off_policy = self.get_if_off_policy() # agent is on-policy or off-policy 30 self.if_use_old_traj = True # continue the last exploration 31 self.obs_norm = False

AttributeError: 'Arguments' object has no attribute 'get_if_off_policy'

zhumingpassional commented 2 years ago

recently elegantrl is updated frequently.

YangletLiu commented 2 years ago

Is it fixed now after some updates at ElegantRL?