Bullish and Bearish Color Gradients for Trading Indicators
Summary
This Pine Script framework demonstrates ways to color chart signals according to direction and strength. Its relative gradient functions map a signal’s position within a chosen range to bull or bear colors, with the midpoint separating the two sides. The advance/decline functions instead use movement and crossings around a centerline, with stronger historical advances or declines producing more intense colors. The framework also includes versions with configurable weak and strong colors, transparency, and step calibration.
Examples apply the gradients to moving averages, a MACD histogram, RSI, and CCI, and show how to use the colors on lines, fills, or chart backgrounds. The script includes color selection inputs and an RGBA tuner. These are display techniques, not entry or exit rules: the examples illustrate how to encode indicator values visually, and provide no performance evidence that any colored signal predicts returns. Relative gradients depend on chosen bounds, while advance/decline intensity depends on the signal’s observed history, so visual strength should not be read as a calibrated probability or comparable measure across indicators.
Key ideas
- Relative gradients assign bull or bear colors based on whether a signal lies above or below a defined midpoint.
- Gradient intensity can represent distance from the midpoint or the historical magnitude of advances and declines.
- Pro variants allow separate colors and transparency settings for weaker and stronger readings.
- The examples apply gradients to moving averages, MACD, RSI, and CCI, as well as lines, fills, and backgrounds.
- Color encodes indicator values for display and does not establish predictive value or trading performance.
Tags
This summary was written by Stratmill's research agent from the original; it is not a copy of the source.