Interested with this Indicator.
Ema has one thing that is not widely known : its period can be fractional (for example period 14.5 is completely normal for ema). But it is not so for lsma. For lsma it has to be integer. Because of that it is not suitable for adapting (the values would not be smooth)
Sorry sir, what is integer sir?. please hope you can tell me about this. i need more learn about forex.
Integer is this : Integer - Wikipedia, the free encyclopedia
I understand. Thank's for your explaint...
what about a prediction of MA? does anyone thought about that?
i.e predicted value of ma will be based on the previos values of ma + last values of price?
There is a version with confidence bands added (the version with the explanation posted here : https://www.mql5.com/en/forum/general )
Since if the shift of confidence bands is set 0 it can be considered as a kind of a forecast (see more information on the nature of confidence bands here : Confidence and prediction bands - Wikipedia, the free encyclopedia ) I guess that would be what could be considered as a "prediction" of some average value
PS: you might have noticed that there is a range of values instead of single value. Since there is no way to uniquely "predict" the future values, that is one of the ways we can estimate/predict future values with a certain degree of certainty that is not a scamm but an attempt to work within known math rules for estimation
What extrapolation method you recommend?
As far as extrapolation is concerned, please read this post first : https://www.mql5.com/en/forum/172923/page13Anyway, one good example was made by qpwr.
Here is the description :
The indicator is based on several methods that can be chosen by the Method input variable:
Method 1: Fourier's extrapolation; the frequencies are calculated using the Quinn-Fernandes Algorithm
Method 2: Autocorrelation Method
Method 3: Weighted Burg Method
Method 4: Burg Method with Helme-Nikias weighting function
Method 5: Itakura-Saito (geometric) method
Method 6: Modified covariance method
Methods 2-6 are the methods of linear prediction. The linear prediction is based on finding the future values as the linear functions of the past values. Assume that we have a number of prices x..x[n-1] where the higher index is compliant with the recent price. The prediction of the future price x[n] is calculated as
x[n] = -Sum(a*x[n-i], i=1..p)
where a - coefficients of the model, p - order of the model. The listed methods 2-6 find the coefficients a by decreasing the mean-root-square error on the training last n-p bars. Of course, we can reach the zero error of prediction if we directly solve the set of equations mentioned above with n=2*p by the Levinson-Durbin method. Such method of prediction is called Prony Method. Its disadvantage is the instability during the prediction of the future values of the series. That's way this method has not been included.
The other input parameters are:
LastBar - the number of the last bar in the past data
PastBars - the number of past bars used for the prediction of the future values
LPOrder - the order of the linear model as a fraction from the number of the past bars (0..1)
FutBars - the number of future bars in the prediction
HarmNo - the maximum number of frequencies for the Method 1 (0 means all frequencies)
FreqTOL - the imprecision of the frequeincies calculation for the Method 1 (if it is >0.001 it can't converge)
BurgWin - the number of the weighting function for the Method 2 (0=Rectangular 1=Hamming 2=Parabolic)
The indicator draws two lines: the blue line shows the prices of the model on the training bars, the red line shows the predicted future prices.
And here is the code : extrapolator.mq4 (PS: there are a couple of compiler warnings, but they are benign)