Prediction algorithm:
The indicator integrates two methods of predicting:
Method 1:
1. Specify the length equal to 3 SMA SMA and shifts in the past at 1 bar. With such a long, shifted SMA does not exist only for the last bar (Bar = 0), because he must value the next future price Close [-1].
2. We expect the frequency bandwidth SMA. We equate this frequency to the frequency of the filter Hodrick-Prescott. We find lambda.
3. We expect the value Hodrick-Prescott filter on the last bar of HP [0] and assume that the SMA [0] with an unknown Close [-1] yields the same value.
4. Find Close [-1] = 3 * HP [0] - Close [0] - Close [1]
5. Increases the length of SMA to 5. Repeat all the calculations and find Close [-2] = 5 * HP [0] - Close [-1] - Close [0] - Close [1] - Close [two]. And so on until the calculated specified number of future prices FutBars.
Method 2:
1. SMA specify the length equal to 2 * FutBars +1 and shifts the SMA in the past to FutBars
2. We expect the frequency bandwidth SMA. We equate this frequency to the frequency of the filter Hodrick-Prescott. We find lambda.
3. We expect the values of Hodrick-Prescott filter on the last FutBars bars and assume that the SMA will behave the same way when new prices.
4. Find Close [-1] = (2 * FutBars +1) * HP [FutBars-1] - Sum (Close [i], i = 0 .. 2 * FutBars-1), Close [-2] = (2 * FutBars +1) * HP [FutBars-2] - Sum (Close [i], i =- 1 .. 2 * FutBars-2), etc.
In Forex - display the following input data:
Method - method of prediction
LastBar - number of the last bar to verify the predictions suschestvuyaschih prices (LastBar> = 0)
PastBars - the number of previous bars for which would be calculated by Hodrick-Prescott filter (the more the better, or at least, PastBars> 2 * FutBars)
FutBars - the number of predicted future values
LED red constructs predicted values.
The second method has a tendency to more accurately predict, but often has large emissions of the first predicted prices. The method can improve the prediction by finding the FIR filter with frequency response is closer to that Hodrick-Prescott filter. For example, instead of the SMA, you can try Hanning, Blackman, Kaiser and other filters with constant delay.
The indicator integrates two methods of predicting:
Method 1:
1. Specify the length equal to 3 SMA SMA and shifts in the past at 1 bar. With such a long, shifted SMA does not exist only for the last bar (Bar = 0), because he must value the next future price Close [-1].
2. We expect the frequency bandwidth SMA. We equate this frequency to the frequency of the filter Hodrick-Prescott. We find lambda.
3. We expect the value Hodrick-Prescott filter on the last bar of HP [0] and assume that the SMA [0] with an unknown Close [-1] yields the same value.
4. Find Close [-1] = 3 * HP [0] - Close [0] - Close [1]
5. Increases the length of SMA to 5. Repeat all the calculations and find Close [-2] = 5 * HP [0] - Close [-1] - Close [0] - Close [1] - Close [two]. And so on until the calculated specified number of future prices FutBars.
Method 2:
1. SMA specify the length equal to 2 * FutBars +1 and shifts the SMA in the past to FutBars
2. We expect the frequency bandwidth SMA. We equate this frequency to the frequency of the filter Hodrick-Prescott. We find lambda.
3. We expect the values of Hodrick-Prescott filter on the last FutBars bars and assume that the SMA will behave the same way when new prices.
4. Find Close [-1] = (2 * FutBars +1) * HP [FutBars-1] - Sum (Close [i], i = 0 .. 2 * FutBars-1), Close [-2] = (2 * FutBars +1) * HP [FutBars-2] - Sum (Close [i], i =- 1 .. 2 * FutBars-2), etc.
In Forex - display the following input data:
Method - method of prediction
LastBar - number of the last bar to verify the predictions suschestvuyaschih prices (LastBar> = 0)
PastBars - the number of previous bars for which would be calculated by Hodrick-Prescott filter (the more the better, or at least, PastBars> 2 * FutBars)
FutBars - the number of predicted future values
LED red constructs predicted values.
The second method has a tendency to more accurately predict, but often has large emissions of the first predicted prices. The method can improve the prediction by finding the FIR filter with frequency response is closer to that Hodrick-Prescott filter. For example, instead of the SMA, you can try Hanning, Blackman, Kaiser and other filters with constant delay.
Download
HP Extrapolator.mq4
I can set up my new idea from this post. It gives in depth information. Thanks for this valuable information for all,.. top forex signals
ReplyDelete