When past values in a time series are correlated with each other, it is a good idea to perform autoregression on the past values to extract the relationship between the past values in order to predict the future values.
This is precisely what we we do here. We fit an autoregressive model on closing price and then use that model to predict the future price.
This autoregression indicator is based on R.
In the blog post I explain how you are going to connect R with MT4.
I have also provided the MQL4 code for the indicator.
First you will need to download R software. R is a powerful machine learning software that is open source.
Install it on your computer.
Then put the path in the MQL4 code.
This will allow MT4 to use R in making the calculations.