Forex Lasers Forum

Forex Lasers Forum (https://www.forexlasers.com/forums/)
-   FX Indicators Download Database (https://www.forexlasers.com/forums/fx-indicators-download-database/)
-   -   Welch Bollinger Band Width indicator for MetaTrader 4 (https://www.forexlasers.com/forums/fx-indicators-download-database/5271-welch-bollinger-band-%AE-width-%96-indicator-metatrader-4-a.html)

Metatrader Indicators 20-03-2018 21:36

Welch Bollinger Band Width indicator for MetaTrader 4
 
2 Attachment(s)
Attachment 3384
<p>This indicator takes the current Width of the Bollinger Bands and compares it to the Maximum and Minimum Width of the Bollinger Bands over N periods (WidthCalcPeriod).</p><p>If the calculated percentage is less than or equal to MinRangePercent, then the histogram shows Green. If the calculated percentage is 2x the MinRangePercent, then the histogram shows Yellow. If neither of those match, the histogram shows Red.</p><p>This works out well to quickly see if the currency pair is ranging, or about to break out of range. If you set ShowWidthLine to true, then it will also show a line with the actual width of the Bollinger Bands in PIPS. This should work for 4 and 5 digit brokers and it works on all currency pairs.</p><p>Using iCustom to pull out values for an Expert Advisor or other Custom Indicators:</p><p>You should be able to pull out any of the values externally using the following code:</p><pre>int period=0; // how far back do you want to look? 0 == current bar. 1 == previous bar, etc.<br> // At any given time, only one of these 3 will have a value greater than 0. That value is 300.<br><br>double WelchBBWidth_Green = iCustom(NULL, 0, "WelchBBWidth", 20, 0, 2.0, 20, "x", 100, "x", false, 0, period);<br>double WelchBBWidth_Yellow = iCustom(NULL, 0, "WelchBBWidth", 20, 0, 2.0, 20, "x", 100, "x", false, 1, period);<br>double WelchBBWidth_Red = iCustom(NULL, 0, "WelchBBWidth", 20, 0, 2.0, 20, "x", 100, "x", false, 2, period);<br><br>// This will give you the actual width in PIPs of the Bollinger Bands<br>double WelchBBWidth = iCustom(NULL, 0, "WelchBBWidth", 20, 0, 2.0, 20, "x", 100, "x", false, 3, period);<br><br>// These will give you the actual Bollinger Band Line values.<br>// These are the values that would be plotted on the MAIN chart, so it's based on price on the chart.<br>double WelchBBWidth_MiddleLine = iCustom(NULL, 0, "WelchBBWidth", 20, 0, 2.0, 20, "x", 100, "x", false, 4, period);<br>double WelchBBWidth_UpperLine = iCustom(NULL, 0, "WelchBBWidth", 20, 0, 2.0, 20, "x", 100, "x", false, 5, period);<br>double WelchBBWidth_LoweLine = iCustom(NULL, 0, "WelchBBWidth", 20, 0, 2.0, 20, "x", 100, "x", false, 6, period);</pre><p>You could put something like this in your Expert Advisor:</p><pre>/*<br>* int areWeRanging(int period=0)<br>*<br>* Returns 1 for GREEN (ranging)<br>* Returns -1 for YELLOW ( start/end of range)<br>* Returns 0 otherwise (no range)<br>*/<br><br>int areWeRanging(int period=0) <br>{<br> double WelchBBWidth_Green = iCustom(NULL, 0, "WelchBBWidth", 20, 0, 2.0, 20, "x", 100, "x", false, 0, period);<br> double WelchBBWidth_Yellow = iCustom(NULL, 0, "WelchBBWidth", 20, 0, 2.0, 20, "x", 100, "x", false, 1, period);<br><br> if ( WelchBBWidth_Green > 0 ) <br> {<br> return (1);<br> } <br> else if ( WelchBBWidth_Yellow > 0) <br> {<br> return (-1);<br> }<br><br> return (0);<br>}<br><br>// Check to see if we are coming out of a range. <br>// This tells us that the LAST candle was still in a range,<br>// but the current candle is now breaking free of the range.<br>if ( areWeRanging(1)==1 && (areWeRanging(0)==-1 || areWeRanging(0)==0) ) <br> {<br> Print("We were ranging, but have now broken out of the range! Make a trade if other indicators confirm the breakout!");<br> }</pre><p>** Use any/all code at your own discretion, and only place real trades when you have confirmation of other indicators. **</p><p>How to install Welch Bollinger Band Width indicator for MetaTrader 4.mq4?</p><ul><br>Download Welch Bollinger Band Width indicator for MetaTrader 4.mq4<br>Copy Welch Bollinger Band Width indicator for MetaTrader 4.mq4 to your Metatrader Directory / experts / indicators /<br>Start or restart your Metatrader 4 Client<br>Select Chart and Timeframe where you want to test your MT4 indicators<br>Search "Custom Indicators" in your Navigator mostly left in your Metatrader 4 Client<br>Right click on Welch Bollinger Band Width indicator for MetaTrader 4.mq4<br>Attach to a chart<br>Modify settings or press ok<br>Indicator Welch Bollinger Band Width indicator for MetaTrader 4.mq4 is available on your Chart<br></ul><p>How to remove Welch Bollinger Band Width indicator for MetaTrader 4.mq4 from your Metatrader Chart?</p><ul><br>Select the Chart where is the Indicator running in your Metatrader 4 Client<br>Right click into the Chart<br>"Indicators list"<br>Select the Indicator and delete<br></ul><p> </p><p>Click here below to download:</p>


All times are GMT. The time now is 01:48.

Powered by vBulletin® Version 3.8.10
Copyright ©2000 - 2021, vBulletin Solutions, Inc.