Hi,
Anyone knows of stochastic based EA here in forex-TSD? I'm learning to develop my own EA so I need the mq4 example of how to reference stochastic indicator in an EA.
Regards,We have thread about this indicator (including many EAs) https://www.mql5.com/en/forum/177239
Thread about Parabolic SAR https://www.mql5.com/en/forum/177358
Thread about RSI https://www.mql5.com/en/forum
Thread about Momentum indicator https://www.mql5.com/en/forum/176430
Thread about Divergence https://www.mql5.com/en/forum/175886
Thank you ND for your swift response...
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);
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);
iStochastic - MQL4 DocumentationThank u just absolutly clear expl. Good man.
Marko
May be i am wrong but it should be 1 instead of 0.
because 0 is open current bar.
For example:
if(iStochastic(NULL,0,5,3,3,MODE_SMA,0,MODE_MAIN,1 )>iStochastic(NULL,0,5,3,3,MODE_SMA,0,MODE_SIGNAL, 1))
If you use current bar information, you use 0. If you use closed bars only, you use 1. That example was taken from the posted link.
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hi,
Anyone knows of stochastic based EA here in forex-TSD? I'm learning to develop my own EA so I need the mq4 example of how to reference stochastic indicator in an EA.
Regards,