AI4Finance-Foundation / FinRL

FinRL: Financial Reinforcement Learning. 🔥
https://ai4finance.org
MIT License
9.37k stars 2.28k forks source link

Unable to add technical indicators for BSE500 (Indian) tickers #1177

Closed avipul751 closed 3 months ago

avipul751 commented 4 months ago

Describe the bug I have been trying to test the notebook https://github.com/AI4Finance-Foundation/FinRL-Tutorials/blob/master/1-Introduction/Stock_NeurIPS2018_SB3.ipynb for Indian Market data with initially only a limited number of stocks but I am stuck at the part where technical indicators are added to the daily price data.

I'm getting the error as: KeyError: "None of [Index(['tic', 'date', 'macd'], dtype='object')] are in the [columns]"

I noticed a couple of more issues here from other users saying the same thing, but those were not helpful either.

Expected behavior Technical indicators should have been added just like it happened for dow30 tickers

Screenshots Screenshot 2024-02-29 054711

zhumingpassional commented 3 months ago

have you connected Indian stocks correctly?

nishantsolanki89 commented 3 months ago

I guess Indian Stock market is not supported. I have gone through architecture and studying from few weeks if you can provide some pointers for changes required. Yahoo provides data for NSE indian stock exchange for example TCS.NS. While processing below comand existing

df_summary = ensemble_agent.run_ensemble_strategy(A2C_model_kwargs, PPO_model_kwargs, DDPG_model_kwargs, timesteps_dict)

avipul751 commented 3 months ago

have you connected Indian stocks correctly?

Yes, also I was able to solve the issue I posted above. Somehow just copying the functions in the FeatureEngineer class worked

avipul751 commented 3 months ago

I guess Indian Stock market is not supported. I have gone through architecture and studying from few weeks if you can provide some pointers for changes required. Yahoo provides data for NSE indian stock exchange for example TCS.NS. While processing below comand existing

df_summary = ensemble_agent.run_ensemble_strategy(A2C_model_kwargs, PPO_model_kwargs, DDPG_model_kwargs, timesteps_dict)

I have not yet ran the ensemble strategy, I'll do it in a day or 2 and will let you know if it works for me.

avipul751 commented 2 months ago

I guess Indian Stock market is not supported. I have gone through architecture and studying from few weeks if you can provide some pointers for changes required. Yahoo provides data for NSE indian stock exchange for example TCS.NS. While processing below comand existing

df_summary = ensemble_agent.run_ensemble_strategy(A2C_model_kwargs, PPO_model_kwargs, DDPG_model_kwargs, timesteps_dict)

I was able to run the ensemble strategy notebook without any issues, just that the agent took around 3.5 hrs to train. If you could share the errors you're getting then maybe I could help.

xprabhudayal commented 15 hours ago

indian stocks can be trained but you cant be able to trade ig with paper trading on alpaca platform