using stochastic indicator in my script

 

Hello,

I checked the numbers i got from the stochastic indicator in my script

and found that they are differnet from the numbers on the chart.

eg. blue is 50, red is 30 in my script

while on the chart blue is 25.5, red is 62.7 .

What is the reason for that difference?

Thanks,

Udi

 

Udi

Is the call to the indicator the same as the settings on the chart, for the periods and the MODEs?

  if(iStochastic(NULL,0,5,3,3,MODE_SMA,0,MODE_MAIN,0)>iStochastic(NULL,0,5,3,3,MODE_SMA,0,MODE_SIGNAL,0))
    return(0);

Just post the code you are using

-BB-

 

95 out of 100 times its because you stick in different parameters.


3 out of 100 its because the numbers you got from a script/EA is a point in time. What you see in the chart is after the point in time, and things have moved.


The remaining 2, beats me.

 
BarrowBoy:

Udi

Is the call to the indicator the same as the settings on the chart, for the periods and the MODEs?

Just post the code you are using

-BB-

Dear, -BB-

Here's the code:

double blue = iStochastic(NULL,0,5,3,3,MODE_SMA,0,MODE_MAIN,0);

double red = iStochastic(NULL,0,5,3,3,MODE_SMA,0,MODE_SIGNAL,0);


I used the same values on the chart.

Maybe the time code is different. 21:00 is displayed on 23:00 ?

Udi

Reason: