Stochastic Oszillator - iStochastic in comparison to shown ididator in Metatrader - page 2

 
FlashX:
Where my mouse is doesn't matter. I compared 7:35 on the chart with 7:35 in the EA and it's not the same. Therefore my mouse was right where I wanted it to be.

No,  I don't think you did . . .  you compared a closed candle at 7:35 with bar 0 which opened at 7:35 and was still open . . . the two are not the same.
 
you compared a closed candle at 7:35 with bar 0 which opened at 7:35 and was still open - Where's the difference? It wouldn't make such a huge difference as shown anyways.
 
FlashX:
you compared a closed candle at 7:35 with bar 0 which opened at 7:35 and was still open - Where's the difference? It wouldn't make such a huge difference as shown anyways.
It makes a difference . . .  all the difference ?  or some of the difference ?  I don't know . . .  but it WILL make a difference.  Try comparing like with like and then working out what has caused the difference,  you will be in a much better place to discover the correct answer.
 
RaptorUK:
It makes a difference . . .  all the difference ?  or some of the difference ?  I don't know . . .  but it WILL make a difference.  Try comparing like with like and then working out what has caused the difference,  you will be in a much better place to discover the correct answer.


Could you be more specific about that and how you would attempt to solve the issue?
 
FlashX:


Could you be more specific about that and how you would attempt to solve the issue?
I would start by coding a simple indicator that prints the Stochastic to chart using Comment() for a bar other than bar 0,  for example bar 1,  then add this to a chart as well as the standard Stochastic indicator and comparing values.
 
RaptorUK:
I would start by coding a simple indicator that prints the Stochastic to chart using Comment() for a bar other than bar 0,  for example bar 1,  then add this to a chart as well as the standard Stochastic indicator and comparing values.

I've just done this and I get the same value for bar 1


 

So you are using something comparable to the following (Shift set to one in order to use the latest closed bar in the chart)?

double stochastic = iStochastic(NULL, PERIOD_M5, 5, 3, 3, MODE_SMA, 0, MODE_MAIN, 1);
Comment("Stoch M5 bar 1 - 5, 3, 3, MODE_SMA, Low/High, MODE_MAIN = ", DoubleToStr(stochastic, 4));
 
FlashX:

So you are using something comparable to the following (Shift set to one in order to use the latest closed bar in the chart)?

Almost . .  you posted this 

double stochastic = iStochastic(NULL, PERIOD_M5, 5, 3, 3, MODE_SMA, 1, MODE_MAIN, 0);

which is

Comment("Stoc M5 bar 1 - 5, 3, 3, MODE_SMA, Close/Close, MODE_MAIN = ",  iStochastic(NULL, PERIOD_M5, 5, 3, 3, MODE_SMA, 1, MODE_MAIN, 1) );  

 

price_field  -  Price field parameter. Can be one of this values: 0 - Low/High or 1 - Close/Close.
 

It doesn't really matter as long as you set the same parameters in the standard Stochastic you add to the chart.

 

Reason: