AI4Finance-Foundation / FinRL-Meta

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

FinRL_PaperTrading_Demo np.hstack() #259

Open josh0tt opened 1 year ago

josh0tt commented 1 year ago

When executing the example here without any modifications except for including Alpaca API key, I get the following error:

ValueError: all the input array dimensions for the concatenation axis must match exactly, but along dimension 0, the array at index 0 has size 1192 and the array at index 1 has size 1177

which is coming from this line here. Anyone else run into this issue?

zhumingpassional commented 1 year ago

thanks for reporting it. some values may be missing, so that the dims do not match.

josh0tt commented 1 year ago

Seems like this should be handled in df_to_array() (or higher up) since missing data seems to be pretty common when interfacing with the Alpaca API regardless of the date ranges used.

usmanaminch commented 1 year ago

I am facing the same problem when executing this line of code

price_array, tech_array, turbulence_array = DP.df_to_array(data, if_vix=True)

I get the error

ValueError: all the input array dimensions for the concatenation axis must match exactly, but along dimension 0, the array at index 0 has size 2001 and the array at index 1 has size 1964

Any suggestions on how to fix this?