Why is my IF statement not working? Help please ....
What exactly is not working in the if statement? As of now both if statements are run, are you looking for if...else if?
I think you have error - devide zero.
Try to change a little:
double band=iBands(NULL,PERIOD_M5,BB_Period,BB_Var,0,PRICE_CLOSE,MODE_LOWER,i+1);
if(band!=0) Ratio=iClose(NULL,PERIOD_M5,i+1)/band;
Dear Roger and jmca,
Thanks for your quick responses...I did add the zero divide check...but here is what was wrong on top of that zero divide...
1. I was not looping to correct bar value
=> Changed limit=Bars-ExtCountedBars-1; to limit=Bars-ExtCountedBars-2;
2. I was using SellSig/BuySig as arrays and then assigning their values to buffer arrays
=> Changed int BuySig[],SellSig[]; to int BuySig,SellSig;
Now, the code works correctly and shows the buffers mapped on the chart...
Thanks once again for your help!
best,
Maratha
Dear All,
I feel a little stupid here, but am stumped as to why my IF statement is not working...any help is appreciated.