Question abut the stochastic

 
Can anybody tell me please how to read the %K, %D and %D slow? Thanks
 

%K is the blue line.


%D is the dotted red line.


There isn't a %D slow, but there is a %K slowing and this makes the blue line smoother but slower to reflect change of direction.


:)

 
zaatar2009 wrote >>
Can anybody tell me please how to read the %K, %D and %D slow? Thanks

Hi Zaatar,

You can't read the inputs to an indicator, you write them when you call an indicator. You can access the Stochastic Main and Signal lines as follows:

int Kperiod = <your %KPeriod>;
int Dperiod = <your %DPeriod>;
int slowing = <your slowing value>;
int method = <your moving average method (0-3)>;
int price_field = <your price_field value (0 or 1)>;
//
double StochasticMain =  iStochastic( Symbol(), NULL, Kperiod, Dperiod, slowing, method, price_field, MODE_MAIN, 0);
double StochasticSignal =  iStochastic( Symbol(), NULL, Kperiod, Dperiod, slowing, method, price_field, MODE_SIGNAL, 0);

This will give you the value for the current (zero) bar. If you want to see values for previous bars then change the final zero in each line to reflect which bar you want to see.

https://docs.mql4.com/indicators/iStochastic

Not sure if this is what you were looking for, but it's probably the closest you'll get.

- Tovan

Reason: