'f_norm_...' features in spy_features_target_2009_2022.csv' for forecasting direction of the price

Course Name: Machine Learning for Options Trading



In Section 5/Unit 5, the Notebook for forecasting direction of the price move of the underlying asset uses 'spy_features_target_2009_2022.csv' data file which contains 'f_norm_upper', 'f_norm_lower' and 'f_norm_middle' features. These features, especially 'f_norm_upper', make significant difference in prefictive performace, from the usual 'nearly no predictive power' to very interesting.



So I'm just wondering what are these features and if they introduce look-ahead bias (e.g. by being normalized over the full data set, not only the train part)?

Hi Roman,



This is an interesting question. If you refer to the previous notebook i.e. Section 4 Unit 7, you will find the code for creating the predictor and target variables.



In code cell 6, first, you are using the TA-Lib library to compute the Bollinger bands which are stored as upper, middle, lower, signifying the upper band, middle band and lower Bollinger bands respectively.



Further, you are normalising the 'upper band' variable by dividing it by that day's close price. This is stored in the 'f_norm_upper' column. Thus, we are not incorporating any look-ahead bias over here.



I hope this helps.



 

Thank you, Rekhit - that actually works! Simple, yet surprisingly helpful features indeed.