Squeeze function
This is an MQL4 topic. MODE_CLOSE is not supported on iBands, only MODE_MAIN, MODE_UPPER or MODE_LOWER.
And you didn't tell anything about these errors.
This is an MQL4 topic. MODE_CLOSE is not supported on iBands, only MODE_MAIN, MODE_UPPER or MODE_LOWER.
And you didn't tell anything about these errors.
it is an error...
int IsSqueeze(){ double lastvalue=0,sum=0,bbaverage=0; int i,temp; temp=0 for(i=1;i<SqueezeFilterBars;i++) { sum+=iBands(Symbol(),0,BandsPeriod,BandsDeviation,BandsShift,PRICE_CLOSE,MODE_UPPER,i) -iBands(Symbol(),0,BandsPeriod,BandsDeviation,BandsShift,PRICE_CLOSE,MODE_LOWER,i); } bbaverage=sum/SqueezeFilterBars; lastvalue=iBands(Symbol(),0,BandsPeriod,BandsDeviation,BandsShift,PRICE_CLOSE,MODE_UPPER,0) -iBands(Symbol(),0,BandsPeriod,BandsDeviation,BandsShift,PRICE_CLOSE,MODE_LOWER,0); if (lastvalue<bbaverage) temp= 1; if (lastvalue>bbaverage) temp= 0; if (lastvalue==bbaverage) temp= 2; return temp; }
Hi, i want to calculate the average of bb bands difference (Bandhigh-BandLow) for a variable set of bars. If last band difference (0) is < than the average, we have a squeeze.
I have done the following code but I have errors:
Why don't you simply use standard deviation instead (since that is what you are going to get in the end)?
I am a newbee...I will try..thx
Hi, i want to calculate the average of bb bands difference (Bandhigh-BandLow) for a variable set of bars. If last band difference (0) is < than the average, we have a squeeze.
I have done the following code but I have errors: