Hello Folks,
I have been trying to implement Stochastic and MA crossover system. The MA is merged with Stochastic i.e. MA in ‘Previous Indicator’s Data’.
But I’m not getting any value of both ‘Signal Line’ and ‘MA’ other than ‘0’.
What I’m getting:
Signal Sto’s Value=0.000000000
MA_Signal_Sto’s Value=0.00000
Why? Any suggestion will be highly appreciated.
int start()
{
sLog_Start = "START - start() function----------------------------------";
double Signal_Stochastic[];
sLog_Start = sLog_Start + sNL + " Start - Set and Get MA values";
ArraySetAsSeries(Signal_Stochastic, true);
for( i=0; i<Bars; i++)
Signal_Stochastic[i] = iStochastic(NULL,0,20,10,20,MODE_SMA,0,MODE_SIGNAL,i);
double MA_Signal_Sto = iMAOnArray(Signal_Stochastic, 0,20,0,MODE_SMA,0);
sLog_Start = sLog_Start + sNL + " Signal Sto's Value=" + Signal_Stochastic[0];
sLog_Start = sLog_Start + sNL + " MA_Signal_Sto's Value=" + MA_Signal_Sto;
if (Signal_Stochastic>MA_Signal_Sto)
{
Buy;
}
if (Signal_Stochastic<MA_Signal_Sto)
{
Sell;
}
return (0);
}
<