Hi Coders,
I am struggling with this simple function.. All I want it to do is look back over the past 10 candles and return true if any of the candles where higher than the upper bollinger band.my error '}' Not all control paths return a value. I just can't see where I am going wrong here.
thanks in advance
At first glance it looks like you need another return statement
bool HasBollingerCrossed() { for(int i=Bars-1;i>=1;i=10) { if(High[i] > (iBands(NULL,0,21,2,0,PRICE_CLOSE,MODE_UPPER,i))) return true; } return false; //<< Try this }
Hi Coders,
I am struggling with this simple function.. All I want it to do is look back over the past 10 candles and return true if any of the candles where higher than the upper bollinger band.my error '}' Not all control paths return a value. I just can't see where I am going wrong here.
thanks in advance