OPEN-SOURCE SCRIPT
Price Action Visualizer (EMA/SMA Color Bars)

This custom Pine Script indicator, "EMA(21) vs SMA(30) Color Bars," provides a unique and immediate visual representation of market bias by dynamically painting the candlesticks based on their position relative to two critical moving averages.
💡 What It Does:
The indicator calculates and plots the 21-period Exponential Moving Average (EMA) and the 30-period Simple Moving Average (SMA). It then analyzes the closing price of each candle and colors the entire candlestick (body and border) according to pre-defined trend conditions.
This visualization allows traders to identify strong trend environments versus periods of consolidation or indecision at a glance, removing the need to constantly check the price relationship manually.
🎨 Color Conditions and Meaning:
The indicator uses three distinct color states to signal the market's current momentum:
Color,Condition,Market Interpretation
🟢 GREEN,Closing Price is ABOVE both the 21 EMA AND the 30 SMA.,Strong Bullish Trend: Suggests high momentum and confirmation of an uptrend. Ideal for long bias.
🔴 RED,Closing Price is BELOW both the 21 EMA AND the 30 SMA.,Strong Bearish Trend: Suggests high downward pressure and confirmation of a downtrend. Ideal for short bias.
⚫ GRAY,"Closing Price is in any other state (e.g., between the two MAs, or under one and over the other).","Neutral / Consolidation: Indicates uncertainty, low momentum, or potential trend exhaustion/reversal. Caution is advised."
🔧 Customization Options:The indicator is fully customizable, allowing users to fine-tune the periods to match their preferred trading style (e.g., scalping, swing trading).Dĺžka EMA (Length EMA): Allows you to change the period for the Exponential Moving Average (default is 21).Dĺžka SMA (Length SMA): Allows you to change the period for the Simple Moving Average (default is 30).
💡 What It Does:
The indicator calculates and plots the 21-period Exponential Moving Average (EMA) and the 30-period Simple Moving Average (SMA). It then analyzes the closing price of each candle and colors the entire candlestick (body and border) according to pre-defined trend conditions.
This visualization allows traders to identify strong trend environments versus periods of consolidation or indecision at a glance, removing the need to constantly check the price relationship manually.
🎨 Color Conditions and Meaning:
The indicator uses three distinct color states to signal the market's current momentum:
Color,Condition,Market Interpretation
🟢 GREEN,Closing Price is ABOVE both the 21 EMA AND the 30 SMA.,Strong Bullish Trend: Suggests high momentum and confirmation of an uptrend. Ideal for long bias.
🔴 RED,Closing Price is BELOW both the 21 EMA AND the 30 SMA.,Strong Bearish Trend: Suggests high downward pressure and confirmation of a downtrend. Ideal for short bias.
⚫ GRAY,"Closing Price is in any other state (e.g., between the two MAs, or under one and over the other).","Neutral / Consolidation: Indicates uncertainty, low momentum, or potential trend exhaustion/reversal. Caution is advised."
🔧 Customization Options:The indicator is fully customizable, allowing users to fine-tune the periods to match their preferred trading style (e.g., scalping, swing trading).Dĺžka EMA (Length EMA): Allows you to change the period for the Exponential Moving Average (default is 21).Dĺžka SMA (Length SMA): Allows you to change the period for the Simple Moving Average (default is 30).
オープンソーススクリプト
TradingViewの精神に則り、このスクリプトの作者はコードをオープンソースとして公開してくれました。トレーダーが内容を確認・検証できるようにという配慮です。作者に拍手を送りましょう!無料で利用できますが、コードの再公開はハウスルールに従う必要があります。
免責事項
この情報および投稿は、TradingViewが提供または推奨する金融、投資、トレード、その他のアドバイスや推奨を意図するものではなく、それらを構成するものでもありません。詳細は利用規約をご覧ください。
オープンソーススクリプト
TradingViewの精神に則り、このスクリプトの作者はコードをオープンソースとして公開してくれました。トレーダーが内容を確認・検証できるようにという配慮です。作者に拍手を送りましょう!無料で利用できますが、コードの再公開はハウスルールに従う必要があります。
免責事項
この情報および投稿は、TradingViewが提供または推奨する金融、投資、トレード、その他のアドバイスや推奨を意図するものではなく、それらを構成するものでもありません。詳細は利用規約をご覧ください。