MQL4 - Stochastic
img#define BARS_TO_ANALYSE 100;
function stocasticSignal(){
string signal;
for(int a=0;a<BARS_TO_ANALYSE;a++)
{
mainLine=iStochastic(0,0,5,3,3,MODE_SMA,0,MODE_MAIN,a);
prevMainLine=iStochastic(0,0,5,3,3,MODE_SMA,0,MODE_MAIN,a+1);
signalLine=iStochastic(0,0,5,3,3,MODE_SMA,0,MODE_SIGNAL,a);
prevSignalLine=iStochastic(0,0,5,3,3,MODE_SMA,0,MODE_SIGNAL,a+1);
if(prevMainLine <prevSignalLine && mainLine> signalLine){
signal = "BUY";
}
if(prevMainLine>prevSignalLine && mainLine < signalLine){
signal = "SELL";
}
} return signal;
}
Langgan:
Catat Ulasan
(
Atom
)
Tiada ulasan :
Catat Ulasan