Your iWPR and print statement is the value of bar zero at the start of the bar.
Your data window, shows us nothing because we can't see what bar you have the mouse over, nor the datetime of the bars. If that isn't the first tick or bar zero, of course they don't match.
Try using WPR(Symbol(), 0, 14, 1) so you always get the current chart's TF and bar 1 so you get a value on a completed bar
friend
Your iWPR and print statement is the value of bar zero at the start of the bar.
R: the code starts running from the bar 15
Your data window, shows us nothing because we can't see what bar you have the mouse over, nor the datetime of the bars. If that isn't the first tick or bar zero, of course they don't match.
R: capture the screen and the mouse pointer disappeared, "windows data" shows bars indicate in chart
Try using WPR(Symbol(), 0, 14, 1) so you always get the current chart's TF and bar 1 so you get a value on a completed bar
R: That did not work.
You can test the mentioned code and williams will not be equal to the graph
problem solved
bad: bar size, evaluating the next
now, evaluating tick by tick
Trader011981,
How did you end up solving this problem? I am coming across a similar issue.
Cheers.

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
to do backtesting, entries are not correct because erroneous signals IWPR delivery.
The same problem with other indicators
The code Expert showing values williams % Range:
int start()
{
if(JumpBars==Bars || Bars<14) return (0);
JumpBars=Bars;
double WilliamsValue=0;
WilliamsValue = iWPR(Symbol(), 15, 14, 0);
Print("williams " + WilliamsValue + ", Time " + TimeYear(TimeCurrent()) + "/" + TimeMonth(TimeCurrent()) + "/" + TimeDay(TimeCurrent()) + " - " + TimeHour(TimeCurrent()) + ":" + TimeMinute(TimeCurrent()));
return(0);
}
to run backtesting shows:
21:20:53 Example GBPUSD,M15: loaded successfully
21:20:53 TestGenerator: current spread 31 used
21:20:53 Example test started
21:20:53 2013.01.01 22:03 Example GBPUSD,M15: Current bar for USDCHF 15MIN.: 0
21:20:53 2013.01.01 22:03 Example GBPUSD,M15: Current bar for USDCHF 15MIN.: 0
21:20:53 2013.01.02 01:15 Example GBPUSD,M15: williams -30.07334963, Time 2013/1/2 - 1:15
21:20:53 2013.01.02 01:30 Example GBPUSD,M15: williams -13.82978723, Time 2013/1/2 - 1:30
21:20:53 2013.01.02 01:45 Example GBPUSD,M15: williams -0.55452865, Time 2013/1/2 - 1:45
21:20:53 2013.01.02 02:00 Example GBPUSD,M15: williams -16.95178849, Time 2013/1/2 - 2:0
21:20:53 2013.01.02 02:15 Example GBPUSD,M15: williams -2.70551509, Time 2013/1/2 - 2:15
21:20:53 2013.01.02 02:30 Example GBPUSD,M15: williams -11.71251109, Time 2013/1/2 - 2:30
.
.
etc..
and when I see the chart with flag% Attachment williams, williams values do not match the backtesting, I realized as I suggested buying strange bars
see you error and help me plis: