BOLLINGER ENVELOPE SQUEEZE

Bollinger Envelopes are a variation on Bollinger Bands that focus on the extremes of price action. While Bollinger Bands are centered on a moving average, usually of closing prices, Bollinger Envelopes are anchored by the extremes: the highs and the lows.

The upper Bollinger Envelope is constructed from a moving average of the highs and the standard deviation of the highs; the lower Bollinger Envelope is constructed from a moving average of the lows and the standard deviation of the lows. The formulas are:

```
UpperBE = Average(high, 20) + 1.5 Ă— StandardDeviation(high, 20)
LowerBE = Average(low, 20) - 1.5 Ă— StandardDeviation(low, 20)
```

Since there is no middle band in the calculation, we must imply one by taking the mean of the upper and lower envelopes.

```
MiddleBE = (UpperBE + LowerBE) Ă· 2
```

Bollinger Envelopes are particularly useful in periods of extreme market action. They are also important in markets where the trading session is not well defined, and are used in the Ice Breaker trading system.

Based on the above inputs I'm trying hard to make amibroker formula from last 10 days. Not getting properly.

```
Lower = Avg(BBandBot(Low, 20, -1.5)) * StDev(Low, 20);
upper = Avg(BBandTop(Low, 20, -1.5)) * StDev(Low, 20);
Plot(Lower, "LBB", styleLine);
Plot(upper, "UBB", styleLine);
```

Program showing error at Avg; if I removed avg formula looks like...

```
Lower = (BBandBot(Low, 20, -1.5)) * StDev(Low, 20)/20;
upper = (BBandTop(Low, 20, -1.5)) * StDev(Low, 20)/20;
Plot(Lower, "LBB", styleLine);
Plot(upper, "UBB", styleLine);
```

Not successful.

I request you to all, anybody correct the code.

Thanks with regards,

*Moderator comment: Your post was INCORRECTLY formatted and I had to fix it. Next time follow the forum rules and format message correctly!*