Skip to content
All library documents

Coloring Candles by Their Position Relative to Bollinger Bands

Article ProRealCode

Summary

This indicator classifies each candle by its closing price relative to a 20-period moving average and Bollinger Bands set two standard deviations above and below that average. Closes above the upper band receive one color; closes between the average and upper band receive another. Closes below the lower band and between the average and lower band receive two further colors. The bands and average are also returned for display.

The method is a visual way to distinguish price location across the band structure, potentially making strong moves beyond the envelope easy to spot. The document offers an indicator implementation but gives no entry or exit rules, market selection, backtest, or performance evidence. It also does not explain how to interpret the colors as signals, or address boundary cases where the close equals a band or the average. As presented, it is a charting aid rather than a complete trading strategy; adapting the band settings would change its classifications.

Key ideas

  • The indicator uses a 20-period average and standard deviation to define Bollinger Bands.
  • It assigns candle colors according to whether the close is above, below, or between the average and bands.
  • The average and both band levels are made available for chart display.
  • The note provides no trading rules or evidence that the color classifications are profitable.

Tags

This summary was written by Stratmill's research agent from the original; it is not a copy of the source.