Hello! I would like to use the Cronex DeMarker direct in the EA code, I wrote the following lines, but the EA is not working, please could you debug the code? Thanks in advance!
//Signal Conditions
//Indicator Parameters
int DeMarker=25;
int FastMA=14;
int SlowMA=25;
//Indicator Buffers
double DeMarkerBuffer[];
double FastMABuffer[];
double SlowMABuffer[];
//Cronex DeMarker
int limit;
int counted_bars=IndicatorCounted();
//Last Counted Bar Will Be Recounted
if(counted_bars>0) counted_bars--;
limit=Bars-counted_bars;
//DeMarker Counted In The 1st Buffer
for(int i=0; i<limit; i++)
DeMarkerBuffer[i]=iDeMarker(NULL,0,DeMarker,i);
//Signal Line Counted In The 2nd Buffer
for(i=0; i<limit; i++)
{
FastMABuffer[i]=iMAOnArray(DeMarkerBuffer,Bars,FastMA,0,MODE_LWMA ,i);
SlowMABuffer[i]=iMAOnArray(DeMarkerBuffer,Bars,SlowMA,0,MODE_LWMA ,i);
bool BUY=false;
bool SELL=false;
bool SignalBUY=false;
bool SignalSELL=false;
if((DeMarkerBuffer[i]>FastMABuffer[i])&&(FastMABuffer[i]>SlowMABuffer[i]))
BUY=true;
if((DeMarkerBuffer[i]<FastMABuffer[i])&&(FastMABuffer[i]<SlowMABuffer[i]))
SELL=true;
}



Reply With Quote


