Building Tricolor Trading Indicators from Oscillators and Moving Averages
Summary
This article explains how to make trend indicators easier to read by assigning different colors to rising, falling, and unchanged values. Its main example uses a JJRSX oscillator: compare each bar’s value with the previous bar’s value, then place the current value in one of three display buffers. The article also describes preserving calculation state between ticks and adjusting initialization and history requirements when adapting the template to another indicator.
It then presents a more reusable design that moves shared tricolor logic into an include file, reducing the code needed for individual oscillator or moving-average indicators. The examples also mention adding Bollinger Bands, changing the drawing style, and displaying data from other timeframes. The contribution is a programming pattern for visualizing indicator direction, not evidence that color coding improves trading performance. Its usefulness depends on the source indicator’s behavior and correct parameter and buffer setup; the article provides no systematic trading or performance tests.
Key ideas
- A three-color display can distinguish rising, falling, and unchanged indicator values.
- The example classifies direction by comparing each oscillator value with the preceding bar.
- Static state preserves a prior value between indicator updates.
- Shared code in an include file can make tricolor versions of other indicators easier to build.
- The technique can also be adapted to moving averages and data from other timeframes.
Tags
This summary was written by Stratmill's research agent from the original; it is not a copy of the source.