Course Name: Trading with Machine Learning: Regression, Section No: 3, Unit No: 17, Unit type: Video
In the python script given, why is correlation only calculated between price and 3 day moving average? What is the use of other moving avergaes in the model ?
Hi Ankit,
The correlation between price and the 3-day moving average is a feature which we made and named as 'corr' in the data frame. The features in the X dataset in the code ('Open', 'S_3', 'S_15', 'S_60', 'OD',' OL', 'Corr') are all passed to the regression fit done as 'reg.fit(X[:split],yU[:split])'.
So the 'y' value is fit on the above-mentioned features.
You may tweak the code to design new features, or combine different features before you try to fit the regressor.
Hope this helps!