Neural Networks in Trading - LSTM

Hi

In LSTM Based strategy section from Neural Networks in Trading course, line 5 we have :

timestep = 1

X_list =

y_list =

for i in range(timestep, len(X)):

    X_list.append(np.array(X.iloc[i-timestep:i]))

    y_list.append(y.iloc[i:i+timestep].values)



I think for y_list we should take 1 instead of timesteps because we need to achieve the next day's last price. if I want to improve code I may :

y_list.append(y[i,0].values)



is it ok ? or there is anything that I did not get it ?

Hi Amir,



We assigned 1 to timestep in the code, as you can see at the top of the line. Therefore, instead of the timestep, you can directly use 1.

Regarding y_list.append(y[i,0].values), I don't think y[i,0] is a correct indexing. 



Hope this helps

Thanks:)