MQL4 - automated forex trading   /  

Documentation

ODL Securities

MQL4 Reference  Technical indicators  iStochastic

 
double iStochastic( string symbol, int timeframe, int %Kperiod, int %Dperiod, int slowing, int method, int price_field, int mode, int shift)
Calculates the Stochastic oscillator and returns its value.
Parameters:
symbol   -   Symbol the data of which should be used to calculate indicator. NULL means the current symbol.
timeframe   -   Timeframe. It can be any of Timeframe enumeration values. 0 means the current chart timeframe.
%Kperiod   -   %K line period.
%Dperiod   -   %D line period.
slowing   -   Slowing value.
method   -   MA method. It can be any ofMoving Average method enumeration value.
price_field   -   Price field parameter. Can be one of this values: 0 - Low/High or 1 - Close/Close.
mode   -   Indicator line index. It can be any of the Indicators line identifiers enumeration value.
shift   -   Index of the value taken from the indicator buffer (shift relative to the current bar the given amount of periods ago).
Sample:
  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);