Abstract
Bollinger Bands currently use a 20 SMA (simple moving average in a 20 day window) to create a middle band and 2 standard deviations to create upper and lower bands. While Bollinger Bands provide a signal for long and short positions against the upper and lower bands, my hypothesis is that we can continue to use the 20 SMA to create the middle band, but will get a stronger buy/sell signal by using a stock’s ATR for the prior 5-minute candle multiplied by an amplification coefficient to create the upper and lower bands.
Output
The Superposition Bands encompass three bands:
- Middle band → 20 SMA
- Upper band → 20 SMA + 1.5(ATR)
- Lower band → 20 SMA - 1.5(ATR)
Trading Strategy
These bands are best used with the following strategies:
- Touch & Go → When price increases and touches the upper band and then reverses direction, this is a signal to enter a short position. When prices decreases and touches the lower band and then reverses direction, this is a signal to enter a long position.
- Thread the Needle → When price is above the upper band and begins to decrease, crossing the upper band, this is a signal to enter a short position. When price is below the lower band and begins to increase, crossing the lower band, this is a signal to enter a long position.
- Ride the Margins → When price is above the upper band and continues an upward trajectory barely touching the band, if the RSI indicator is within 30-70 and the market is trending higher, this is a signal to enter a long position. When price is below the lower band and continues a downward trajectory barely touching the band, if the RSI indicator is within 30-70 and the market is trending lower, this is a signal to enter a short position.
It should be noted that this strategy works best when:
- You trade with the market trend
- You take into account and fundamental reasons the stock is trending a certain direction (like news)
- You trade within the 30-70 RSI range
- You ignore the first and last 15 minutes of the trading day
Method
We take the following formulas into account when creating each of our bands.
Middle Band Formula
Upper Band Formula
Lower Band Formula
Pinescript Indicator Code
//@version=4
study("Superposition Bands", shorttitle="SupB", overlay=true)
length = input(20, title="SMA Length") // Adjusted input title for clarity
mult = input(1.5, title="Multiplier") // Increased multiplier for extended bands
// Simple Moving Average (SMA) for the middle band
middleBand = sma(close, length)
// Adjusted upper and lower bands using average true range with amplified margins
atrValue = atr(length)
upperBand = middleBand + mult * atrValue
lowerBand = middleBand - mult * atrValue
// Plotting the upper and lower bands
plot(upperBand, color=color.green, title="Upper Band")
plot(lowerBand, color=color.red, title="Lower Band")
// Plotting the middle band
plot(middleBand, color=color.blue, title="Middle Band")
Pinescript Strategy Tester Code
//@version=4
strategy("Superposition Bands Strategy", shorttitle="SupB_Strat", overlay=true)
length = input(20, title="SMA Length") // Adjusted input title for clarity
mult = input(1.5, title="Multiplier") // Increased multiplier for extended bands
profitTargetPercent = input(0.5, title="Profit Target (%)")
stopLossPercent = input(0.25, title="Stop Loss (%)")
// Simple Moving Average (SMA) for the middle band
middleBand = sma(close, length)
// Adjusted upper and lower bands using average true range with amplified margins
atrValue = atr(length)
upperBand = middleBand + mult * atrValue
lowerBand = middleBand - mult * atrValue
// Plotting the upper and lower bands
plot(upperBand, color=color.green, title="Upper Band")
plot(lowerBand, color=color.red, title="Lower Band")
// Plotting the middle band
plot(middleBand, color=color.blue, title="Middle Band")
// Strategy logic
longCondition = crossover(close, lowerBand)
shortCondition = crossunder(close, upperBand)
strategy.entry("Long", strategy.long, when = longCondition)
strategy.entry("Short", strategy.short, when = shortCondition)
// Exit logic
strategy.exit("Take Profit/Stop Loss", from_entry="Long", profit = profitTargetPercent / 100, loss = stopLossPercent / 100)
strategy.exit("Take Profit/Stop Loss", from_entry="Short", profit = profitTargetPercent / 100, loss = stopLossPercent / 100)