OPEN-SOURCE SCRIPT
Mis à jour

Conditional Background & Bar Colors

183
ℹ️ Conditional Background & Bar Colors is a lightweight utility indicator that applies conditional background and candle/bar colors based on user-defined logical rules.

This script is not a trading indicator and does not generate buy or sell signals.
It is designed purely as a visual enhancement layer to help highlight market states or indicator conditions.

🔧 Features

Define multiple independent conditions using:
➤ Comparisons (>, <, =, ≥, ≤)
➤ Cross, crossover, crossunder
➤ Value changes and slope direction
➤ NA / non-NA states

Apply colors to:
➤ Chart background
➤ Candles / bars
➤ Optional “all conditions matched” logic for confluence highlighting
➤ Works with any indicator or price source

Can be applied to:
➤ Main price chart
➤ Indicator panes (e.g. RSI, MACD, custom indicators)

➤ No repainting
➤ No alerts
➤ No strategy or execution logic

🎯 Use Cases

➤ Visual confirmation of indicator alignment
➤ Market regime or bias highlighting
➤ Context awareness for discretionary trading
➤ Conditional coloring inside indicator panes

🎨 Color behavior

➤ Background colors overlap and can be combined using transparency
➤ The “all conditions matched” color overrides individual background colors
➤ Bar colors override each other, where the lowest active condition in the list takes priority

⚠️ Disclaimer

This script provides visual assistance only.
All trading decisions remain the sole responsibility of the user.
Notes de version
ℹ️ Conditional Background & Bar Colors is a lightweight utility indicator that applies conditional background and candle/bar colors based on user-defined logical rules.

This script is not a trading indicator and does not generate buy or sell signals.
It is designed purely as a visual enhancement layer to help highlight market states or indicator conditions.

🔧 Features

Define multiple independent conditions using:
➤ Comparisons (>, <, =, ≥, ≤)
➤ Cross, crossover, crossunder
➤ Value changes and slope direction
➤ NA / non-NA states

Apply colors to:
➤ Chart background
➤ Candles / bars
➤ Optional “all conditions matched” logic for confluence highlighting
➤ Works with any indicator or price source
➤ plot price as bars or line

Can be applied to:
➤ Main price chart
➤ Indicator panes (e.g. RSI, MACD, custom indicators)

➤ No repainting
➤ No alerts
➤ No strategy or execution logic

🎯 Use Cases

➤ Visual confirmation of indicator alignment
➤ Market regime or bias highlighting
➤ Context awareness for discretionary trading
➤ Conditional coloring inside indicator panes

🎨 Color behavior

➤ Background colors overlap and can be combined using transparency
➤ The “all conditions matched” color overrides individual background colors
➤ Bar colors override each other, where the lowest active condition in the list takes priority

⚠️ Disclaimer

This script provides visual assistance only.
All trading decisions remain the sole responsibility of the user.

Clause de non-responsabilité

Les informations et publications ne sont pas destinées à être, et ne constituent pas, des conseils ou recommandations financiers, d'investissement, de trading ou autres fournis ou approuvés par TradingView. Pour en savoir plus, consultez les Conditions d'utilisation.