Download MetaTrader 5
To add comments, please log in or register
Publish your article. Millions of traders are looking for good ideas!
MetaQuotes Software Corp.
Moderator
180129
MetaQuotes Software Corp. 2011.08.08 10:44 

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

Tim Welch
5096
Tim Welch 2011.08.08 14:58  

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.

toddanderson
39
toddanderson 2011.08.13 22:04  
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
MQL4 Comments
16319
MQL4 Comments 2011.08.17 04:52  
great idea thanks for sharing
Jae Won Lee
116
Jae Won Lee 2012.08.06 16:12  

It's worderful, I appreciate you. :)

AED AED
242
AED AED 2013.07.11 13:05  

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);
}
Tsering Dawa Lama
260
Tsering Dawa Lama 2013.07.30 12:37  
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
Carlisleliang
5
Carlisleliang 2016.01.21 06:18  

it's perfert indicated,

but I'have a question to apply to EA

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

i miss something ? 

Muhammad Naim
153
Muhammad Naim 2016.07.27 19:15  
good indicator indeed!
/
To add comments, please log in or register