In the code for the SVM pgm, two of the features are (Today Open minus Yesterday Open), and another feature is Today Open minus Yesterday Close, however the code shows ['Open] - ['Close'], and should say imo ['Open'] - ['Close'].shift(1). Am I right?
Hi German,
The code is correct. The last minute's "Close" price is stored in the "close" column of Df dataframe.
Df['close'] = Df['Close'].shift(1)
So, the code for the feature current minute's open minus last minute's close is
Df['OC'] = Df['Open']-Df['close']
here,
Df['Open'] = current minute's open
Df['close'] = last minute's close
Thanks!
Your're right! Close with capital letter is current period but close is time period-1.
Thanks Vibhu!