**JonathanSPECS:**

Dear Forum,

I'm attempting to utilize linear regression in order to trade. Specifically, I want to be able to use offsets with linear regression, in order to predict with the probability model.

I'm trying to calculate the Linear Regression with the Least Squares Method. MT4 does not have a linear regression curve.

I've attempted to build the indicator, and have resolved all the errors. Despite the code being error free, it still is not plotting any curve when I attempt to place it on my chart.

Does anyone know why my indicator is not loading onto my chart in MT4? I greatly appreciate any advice you can give me. Please see the indicator attached.

By the way, I think Linear Regression/Least Squares Moving Average is the only Moving Average capable of predicting, producing an output with negative offset.

Many traders speculate with a positive offset, the positive offset is shifting the moving average curve to the right.

The negative offset shifts the curve to the left, which leaves a void in most instances as there is no data... but with Linear Regression, the probability model continues to output.

It seems useful in terms of filtering out bad trades on small timeframes.

https://www.mql5.com/en/code/8016

My advice is to use parabolic regression

Dear Forum,

I'm attempting to utilize linear regression in order to trade. Specifically, I want to be able to use offsets with linear regression, in order to predict with the probability model.

I'm trying to calculate the Linear Regression with the Least Squares Method. MT4 does not have a linear regression curve.

I've attempted to build the indicator, and have resolved all the errors. Despite the code being error free, it still is not plotting any curve when I attempt to place it on my chart.

Does anyone know why my indicator is not loading onto my chart in MT4? I greatly appreciate any advice you can give me. Please see the indicator attached.

By the way, I think Linear Regression/Least Squares Moving Average is the only Moving Average capable of predicting, producing an output with negative offset.

Many traders speculate with a positive offset, the positive offset is shifting the moving average curve to the right.

The negative offset shifts the curve to the left, which leaves a void in most instances as there is no data... but with Linear Regression, the probability model continues to output.

It seems useful in terms of filtering out bad trades on small timeframes.

Files: