Mastering Bollinger Band Width with Neural Networks for MetaTrader 5

Mike 2013.04.16 16:34 40 0 0
Attachments

Hey fellow traders! I was on the hunt for a Bollinger Band Width Expert Advisor, but I couldn't find one that fit the bill. So, I rolled up my sleeves and created my own as part of my studies. This Expert Advisor is based on the Neural Network approach.

Test Results:

  • Initial Deposit: £10,000
  • Gross Profit: £36,000
  • Time Span: 3.5 months

What is Bollinger Band Width?

Bollinger Band Width is a key component of Bollinger Bands. As John Bollinger explains in his book, "Bollinger on Bollinger Bands," this width is one of the two indicators derived from Bollinger Bands, with the other being %B.

Essentially, BandWidth measures the percentage difference between the upper and lower bands. When the Bollinger Bands narrow, BandWidth decreases, and when they widen, BandWidth increases. This is because the bands are based on standard deviation; a falling BandWidth indicates decreasing volatility, while a rising BandWidth shows increasing volatility.

Important Patterns to Watch!

  • Narrowness: A narrow BandWidth should always be evaluated in relation to historical values. It's crucial to choose a decent look-back period to define the BandWidth range for any given asset.
  • The Squeeze: Bollinger Band Width is famous for signaling the Squeeze. This happens when volatility dips to a low level, evident by the bands tightening. The upper and lower bands are determined by standard deviation, a volatility measure. As prices stabilize or move within a tight range, the bands narrow. The theory suggests that low volatility periods are often followed by high volatility ones. A narrow BandWidth—commonly referred to as the Squeeze—can indicate an upcoming significant price move. After a Squeeze, a breakout above the upper band signals a bullish move, while a drop below the lower band indicates a bearish trend.

“An Idea Can Change Your Life” 😉

I drew inspiration to explore Neural Networks after reading this article. The author, Fyords, was a tremendous help in the final stages of coding. My Expert Advisor utilizes the last 14 periods and minimizes it using a Neural Network method (definitely check out the article for the best implementation).

For Width Calculation, I’ve applied the classical method: (BBupperBand - BBLlowerBand) / BBMidleBand. Formula:

inputs[i*2]=(((iBands_Upperbuf[i] - iBands_Lowerbuf[i]) / iBands_Basebuf[i]) - (x_min+x_minn) * (d2-d1)) / ((x_maxx+x_max) - (x_min+x_minn)) + d1;

It might look a bit complex, but it’s as simple as A, B, C, D... The article mentioned above will help clarify things.

The test results for my Expert Advisor are promising, covering the period from January 1, 2013, to April 13, 2013. Here’s the balance report:

I’ve attached the complete test results in a zip file for you to check out.

Recommendations:

  • I wouldn’t recommend using this Expert Advisor on a live account just yet.
  • You can consider combining it with other volume indicators like CCI, MFI, etc., for enhanced results.

Thanks for reading!

Cheers,

Suresh B. Kakkattil,

Kerala, India.

List
Comments 0