1 Attachment(s)
bulls[shift] > 0 bears[shift] > 0
Quote:
Originally Posted by
igorad
Hi free.mail23,
Sorry but I don't understand what is a problem with the DMI mode in this indicator. Please explain in details.
Regards,
Igor
ADXWilder's DMI book alerts nmc.mq4
double DeltaHi = High[i] - High[i+1];
double DeltaLo = Low[i+1] - Low[i];
double plusDM = 0.00;
double minusDM = 0.00;
if ((DeltaHi > DeltaLo) && (DeltaHi > 0)) plusDM = DeltaHi;
if ((DeltaLo > DeltaHi) && (DeltaLo > 0)) minusDM = DeltaLo;
if(MathMode == 2) ,Wilder's DMI Book ,A reverse result was given !
if(MathMode == 2)
{
mLo[0] = allAverages(1,3,PreSmooth,MA_Method,masize,PreSmoo th + Length + 2,shift);
bulls[shift] = MathMax(0,0.5*(MathAbs(mMA[0] - mMA[1]) + (mMA[0] - mMA[1])));
bears[shift] = MathMax(0,0.5*(MathAbs(mLo[1] - mLo[0]) + (mLo[1] - mLo[0])));
if(bulls[shift] > bears[shift]) bears[shift] = EMPTY_VALUE;
else
if(bulls[shift] < bears[shift]) bulls[shift] = EMPTY_VALUE;
else {bulls[shift] = EMPTY_VALUE; bears[shift] = EMPTY_VALUE; }
}