my code giving error during EA run, " array out of control and critical error in EA in journal "
Inserted Code
int shift = 0;
double res = 0;
double sup = 0;
for(shift=Bars-1;shift>=0 ;shift--){
if( Close[shift+2]>= iMA(NULL, 0, 10, 0, MODE_SMA, PRICE_CLOSE, shift+2)&&
Close[shift+1]< iMA(NULL, 0, 10, 0, MODE_SMA, PRICE_CLOSE, shift+1))
res=High[Highest(NULL, 0, MODE_HIGH,shift+20,20)];
if( Close[shift+2]<= iMA(NULL, 0, 10, 0, MODE_SMA, PRICE_CLOSE, shift+2)&&
Close[shift+1]> iMA(NULL, 0, 10, 0, MODE_SMA, PRICE_CLOSE, shift+1))
sup=Low[Lowest(NULL, 0, MODE_LOW,shift+20,20)];
}