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).
Açık kaynak kodlu komut dosyası
Gerçek TradingView ruhuyla, bu komut dosyasının mimarı, yatırımcıların işlevselliğini inceleyip doğrulayabilmesi için onu açık kaynaklı hale getirdi. Yazarı tebrik ederiz! Ücretsiz olarak kullanabilseniz de, kodu yeniden yayınlamanın Topluluk Kurallarımıza tabi olduğunu unutmayın.
Feragatname
Bilgiler ve yayınlar, TradingView tarafından sağlanan veya onaylanan finansal, yatırım, alım satım veya diğer türden tavsiye veya öneriler anlamına gelmez ve teşkil etmez. Kullanım Koşulları bölümünde daha fazlasını okuyun.
Açık kaynak kodlu komut dosyası
Gerçek TradingView ruhuyla, bu komut dosyasının mimarı, yatırımcıların işlevselliğini inceleyip doğrulayabilmesi için onu açık kaynaklı hale getirdi. Yazarı tebrik ederiz! Ücretsiz olarak kullanabilseniz de, kodu yeniden yayınlamanın Topluluk Kurallarımıza tabi olduğunu unutmayın.
Feragatname
Bilgiler ve yayınlar, TradingView tarafından sağlanan veya onaylanan finansal, yatırım, alım satım veya diğer türden tavsiye veya öneriler anlamına gelmez ve teşkil etmez. Kullanım Koşulları bölümünde daha fazlasını okuyun.