Auftrag beendet
Ausführungszeit 2 Stunden
Bewertung des Entwicklers
I need help with a small piece of code that calculates the moving average of the Williams Percent Range indicator.
Here is the code:
ArrayResize(WPRArray, WPR_MAPeriod);
for (int j = 0; j < WPR_MAPeriod; j++)
{
WPRArray[j] = iWPR(symbol, WPR_Timeframe, WPR_Period, j);
}
double WPR_Average = iMAOnArray(WPRArray, 0, WPR_MAPeriod, 0, WPR_MAMethod, 0);
WPR = DoubleToString(WPR_Average, 0);
It gives different values on the indicator on the chart and the value in the variable calculated for WPR, e.g.
Here the value on the indicator is -52,4541 where the value in the Variable WPR = -73 (rounded off)

And here is another example:
Value of the indicator = -63.5457 but the variable has the value -41(rounded off)
I have researched the issue and found that there is a 12 hour difference where the value in the variable lags the value of the indicator.
Here is a chart over 20 hours of the values of the indi and the var to illustrate:

Bewerbungen
Frist nicht eingehalten
99
10%
Veröffentlicht: 6 Beispiele
Frist nicht eingehalten
14
10%
Veröffentlicht: 2 Beispiele
Frist nicht eingehalten
4
3%
Frist nicht eingehalten
26
11%
Frist nicht eingehalten
7
12%
Frist nicht eingehalten
1
25%
Frist nicht eingehalten
5
2%
Frist nicht eingehalten
0
Veröffentlicht: 1 Beispiel
Frist nicht eingehalten
6
25%
Frist nicht eingehalten
43
3%
Frist nicht eingehalten
0
Frist nicht eingehalten
7
15%
Frist nicht eingehalten
0