Indicators: Welch Bollinger Band ® Width

 

Welch Bollinger Band ® Width:

This uses the standard Bollinger Band calculations to further calculate the width of the Upper and Lower Bands, comparing that number to the Max and Min width of the bands for the last N periods. The results are plotted onto a histogram.

Author: maj1es2tic

 

For what it's worth, the best settings that I have found for use on AUDUSD for the 30m chart is: MinRangePercent=25, WidthCalcPeriod=60, (everything else default)

You can also set your colors differently. I thought about it later that swapping the Red/Green colors would be good. That would make the ranging/squeezing period RED, since that is when you DONT want to trade.

 
maj1es2tic:

For what it's worth, the best settings that I have found for use on AUDUSD for the 30m chart is: MinRangePercent=25, WidthCalcPeriod=60, (everything else default)

You can also set your colors differently. I thought about it later that swapping the Red/Green colors would be good. That would make the ranging/squeezing period RED, since that is when you DONT want to trade.


Could you make this into a multi time frame indicator
 
great idea thanks for sharing
 

It's worderful, I appreciate you. :)

 

Hello,

I like this indicator, thanks however I cannot run it over EA. I complied the indicator and put it in the folder "/experts/indicators". The settings are both same in EA and indicator but the function AreWeRanging(1) always returns 1 in EA. I tried to understand if it returns an error but I couldn't manage it by GetLastError() function.

Can someone comment how to make it run on EA or how can I trace that the iCustom() returns the correct values???

Thanks in advance!


int areWeRanging(int period=0) 
{
 int e=0;
 double WelchBBWidth_Green = iCustom(NULL, 0, "WelchBBWidth", 20, 0, 2.0, 20, "x", 100, "x", false, 0, period);
 double WelchBBWidth_Yellow = iCustom(NULL, 0, "WelchBBWidth", 20, 0, 2.0, 20, "x", 100, "x", false, 1, period);
 e=GetLastError();
   if(e!=0) { 
      Alert("iCustom Error ---- > ",ErrorDescription(e),"  Err code=",e);
      return;
           }
 if ( WelchBBWidth_Green > 0 ) 
 {
   return (1);
 } 
 else if ( WelchBBWidth_Yellow > 0) 
 {
   return (-1);
 }
 return (0);
}
 
maj1es2tic:

For what it's worth, the best settings that I have found for use on AUDUSD for the 30m chart is: MinRangePercent=25, WidthCalcPeriod=60, (everything else default)

You can also set your colors differently. I thought about it later that swapping the Red/Green colors would be good. That would make the ranging/squeezing period RED, since that is when you DONT want to trade.

this code is not working for me. how did you manage to put that in your EA? please help me. thanks
 

it's perfert indicated,

but I'have a question to apply to EA

 why the fucntion areWeRanging() always reply (1)?

i miss something ? 

 
good indicator indeed!
 
Did you make an mt5 version? Great indicator
Reason: