Job finished
Execution time 2 hours
Feedback from customer
John knows his programming! And he did more than was expected. I can strongly recommend him to anyone who is looking for a programmer.
Feedback from employee
Great customer, prompt communication, clear specs, recommended+
Specification
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:

Responded
1
Rating
Projects
977
46%
Arbitration
32
38%
/
34%
Overdue
96
10%
Working
Published: 6 codes
2
Rating
Projects
136
14%
Arbitration
43
21%
/
28%
Overdue
14
10%
Free
Published: 2 codes
3
Rating
Projects
129
18%
Arbitration
11
27%
/
55%
Overdue
4
3%
Free
4
Rating
Projects
236
32%
Arbitration
30
27%
/
30%
Overdue
26
11%
Free
5
Rating
Projects
58
33%
Arbitration
12
42%
/
42%
Overdue
7
12%
Free
6
Rating
Projects
4
0%
Arbitration
2
0%
/
100%
Overdue
1
25%
Free
7
Rating
Projects
276
55%
Arbitration
0
Overdue
5
2%
Free
8
Rating
Projects
28
32%
Arbitration
1
0%
/
0%
Overdue
0
Free
Published: 1 code
9
Rating
Projects
24
17%
Arbitration
15
20%
/
40%
Overdue
6
25%
Free
10
Rating
Projects
1462
63%
Arbitration
21
57%
/
10%
Overdue
43
3%
Free
11
Rating
Projects
0
0%
Arbitration
0
Overdue
0
Free
12
Rating
Projects
46
28%
Arbitration
9
0%
/
100%
Overdue
7
15%
Free
13
Rating
Projects
4
0%
Arbitration
1
100%
/
0%
Overdue
0
Free
Project information
Budget
30+ USD
Deadline
to 2 day(s)

