Having trouble combining conditions
Try breaking the logic into parts and then recombine them later:
bool mandatory = false, optional = false; //must satisfy ALL of these conditions mandatory = c1>0 && c2>0 && c3>0 && Close[i]>High[i+1] && iSAR(NULL,0,0.01,0.2,i)<Low[i] && c4>BB_min_Width && c5<c6 && c5>c7 && Close[i]<c7; //must satisfy ONE OR MORE of these conditions optional = Close[i+1]<(iMA(Symbol(),0,20,0,MODE_SMA,PRICE_CLOSE,i+1)-2*iStdDev(NULL,0,20,0,MODE_SMA,PRICE_CLOSE,i+1)) || Close[i+2]<(iMA(Symbol(),0,20,0,MODE_SMA,PRICE_CLOSE,i+2)-2*iStdDev(NULL,0,20,0,MODE_SMA,PRICE_CLOSE,i+2)) || Close[i+3]<(iMA(Symbol(),0,20,0,MODE_SMA,PRICE_CLOSE,i+3)-2*iStdDev(NULL,0,20,0,MODE_SMA,PRICE_CLOSE,i+3)) || Close[i+4]<(iMA(Symbol(),0,20,0,MODE_SMA,PRICE_CLOSE,i+4)-2*iStdDev(NULL,0,20,0,MODE_SMA,PRICE_CLOSE,i+4)) || Close[i+5]<(iMA(Symbol(),0,20,0,MODE_SMA,PRICE_CLOSE,i+5)-2*iStdDev(NULL,0,20,0,MODE_SMA,PRICE_CLOSE,i+5)); if(mandatory && optional) ExtMapBuffer1[i]=Low[i]-(PipBuffer)*Point;
Untested code crudely thrown together in notepad... but you should get the idea?
Try breaking the logic into parts and then recombine them later:
Untested code crudely thrown together in notepad... but you should get the idea?
Without rigorously checking your ( ) braces . . . it looks OK to me.
thanks Raptor, you were right.
I am not sure how you experts do it, but by cutting and pasting the code into Microsoft word and using the find function, I eventually found and evened up the missing brackets
now I can start working on getting the working code a lot less sloppy
thanks
dave