MT4 CODE:
#property indicator_separate_window
//+——————————————————————+
//+——————————————————————+
//+——————————————————————+
int LastTradeTime;
void SetLoopCount(int loops)
void SetIndexValue(int shift, double value)
void SetIndexValue2(int shift, double value)
double GetIndexValue(int shift)
double GetIndexValue2(int shift)
//+——————————————————————+
//+——————————————————————+
int init()
SetIndexStyle(1, DRAW_LINE, STYLE_SOLID);
return(0);
SetLoopCount(0);
loopbegin = loopbegin+1;
// Yousky 15/05/2006 – Change to avoid Zero divide exception.
if (tmpDevAA != 0)
MAValue2 = smconst * (AA-prev) + prev;
SetIndexValue2(shift,MAValue2);
loopbegin = loopbegin-1;
}
 
loopbegin2 = loopbegin2+1;
prev1 = GetIndexValue(shift+1);
// Yousky 15/05/2006 – Change to avoid Zero divide exception.
 
MAValue = smconst * (bb-prev1) + prev1;
SetIndexValue(shift,MAValue);
loopbegin2 = loopbegin2-1;
//Print (MAValue); // green
loopbegin3 = loopbegin3+1;
SetIndexValue2(shift,mavalue3);
 
 
}
if(ExtHistoBuffer[0] > ExtHistoBuffer2[0] && ExtHistoBuffer[0]<20.1 && ExtHistoBuffer2[0] < 20.1 && BuyAlert==False)
Alert (“Doda-Stochastic says Buy “,Symbol(),” at “,Close[0]);
if(ExtHistoBuffer2[0] > ExtHistoBuffer[0] && ExtHistoBuffer[0]>80.1 && ExtHistoBuffer2[0] > 80.1 && SellAlert==False)
}
}