Download MetaTrader 5

Indicators: Welch Bollinger Band ® Width

To add comments, please log in or register
MetaQuotes Software Corp.
Moderator
182646
MetaQuotes Software Corp.  

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
5527
Tim Welch  

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
475
toddanderson  
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  
great idea thanks for sharing
Jae Won Lee
116
Jae Won Lee  

It's worderful, I appreciate you. :)

AED AED
256
AED AED  

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
267
Tsering Dawa Lama  
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  

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
437
Muhammad Naim  
good indicator indeed!
To add comments, please log in or register