The Bollinger Bands are already present on every platform, but using the Bandwidth, the bands will be displayed only when the volatility decrease (congestion or range market).

I sometimes use this filter in mean reverting strategies to avoid signals when volatility is low. This simple correction, generally improves breakout strategies.

Firstly, we will use the Bollinger Bandwidth function which measures the BandWidth and thus the volatility.
We begin to draw the Bollinger Bands with simple code, slightly different from what you find on the platform:

Bollinger Bands Code1 TradeStation MultiCharts

Bollinger Bands TradeStation MultiCharts

After that, we have to code the slow and fast Bandwidth and its moving average:

Bollinger Bands Code3 TradeStation MultiCharts

The result will be the distance between the bands. However, we do not just need the distance, so we’ll have to compare a fast Bandwidth with a slower one. In this example, we use a 50-period moving average.

If volatility increase the Bandwidth stay above its moving average.

In addition, we insert the fast Bandwidth above the slow Bandwidth so you can have four types of volatility already usable:

Bollinger Bands Code4 TradeStation MultiCharts

The indicator will draw congestions like this:

Bollinger Bands BandWidth TradeStation MultiCharts

 

HOW TO MAKE THE BOLLINGER BANDS TRANSPARENT

To display the Bollinger Bands BandWidth only during the phases of decreasing volatility, I used the Argb function.

With this function, we can define the colors in Easylanguage for only TradeStation and have much more flexibility than the few preset colors.

The code looks like this:

color_up=Argb(255,255,0,255);

In short, replace the first and the last value with a 0 and the color becomes transparent.

Bollinger Bands Code5 TradeStation MultiCharts

 

Register or Login and Download the indicator for free!!

DOWNLOAD LINK:   SuperTrend Indicator for TradeStation

 

 

Leave a Reply