OPEN-SOURCE SCRIPT
Moving Average Candle

Moving Average Candle turns up to three moving averages into full OHLC candles instead of plain lines, so you can read a moving average's shape and momentum the way you'd read a price candle. It's built for anyone who wants to see a moving average's open, high, low and close at a glance — for example to judge a moving average's momentum and turning points the way you would judge price action, or to compare several of these MA candles against each other and against the underlying price on the same chart.
Each of the up to three MA candles can independently be calculated as SMA, EMA, WMA, VWMA, HMA, or RMA — standard formulas from TradingView's own library, with no custom modification.
MA Candle (present three times, MA Candle 1–3, each instance identically structured)
Length: number of bars the average is calculated over.
MA Type: calculation method: SMA, EMA, WMA, VWMA, HMA, or RMA.
Candle Style: Wick or Fill.
Bull / Bear: two colors: one for when the moving average's close is above its previous value, the other for the opposite case.

Each enabled MA candle is built from the moving averages of the bar's open, high, low and close, then colored by whether the moving average's close is rising or falling. The high and low are clamped so they never sit inside the body, which keeps the candle intact even for moving average types like HMA whose weighting can otherwise push a value outside a normal high/low range.
In Wick style, the high and low are drawn as a candle wick, just like a regular price candle. In Fill style, the wick is hidden and the high/low range is shown instead as a shaded band; the candle body stays visible in both styles.


This indicator is intended solely for market analysis and does not constitute investment advice or a guarantee of success. Use it at your own discretion and risk; past results are not indicative of future performance.
Each of the up to three MA candles can independently be calculated as SMA, EMA, WMA, VWMA, HMA, or RMA — standard formulas from TradingView's own library, with no custom modification.
MA Candle (present three times, MA Candle 1–3, each instance identically structured)
Length: number of bars the average is calculated over.
MA Type: calculation method: SMA, EMA, WMA, VWMA, HMA, or RMA.
Candle Style: Wick or Fill.
Bull / Bear: two colors: one for when the moving average's close is above its previous value, the other for the opposite case.
Each enabled MA candle is built from the moving averages of the bar's open, high, low and close, then colored by whether the moving average's close is rising or falling. The high and low are clamped so they never sit inside the body, which keeps the candle intact even for moving average types like HMA whose weighting can otherwise push a value outside a normal high/low range.
In Wick style, the high and low are drawn as a candle wick, just like a regular price candle. In Fill style, the wick is hidden and the high/low range is shown instead as a shaded band; the candle body stays visible in both styles.
This indicator is intended solely for market analysis and does not constitute investment advice or a guarantee of success. Use it at your own discretion and risk; past results are not indicative of future performance.
نص برمجي مفتوح المصدر
بروح TradingView الحقيقية، قام مبتكر هذا النص البرمجي بجعله مفتوح المصدر، بحيث يمكن للمتداولين مراجعة وظائفه والتحقق منها. شكرا للمؤلف! بينما يمكنك استخدامه مجانًا، تذكر أن إعادة نشر الكود يخضع لقواعد الموقع الخاصة بنا.
إخلاء المسؤولية
لا يُقصد بالمعلومات والمنشورات أن تكون، أو تشكل، أي نصيحة مالية أو استثمارية أو تجارية أو أنواع أخرى من النصائح أو التوصيات المقدمة أو المعتمدة من TradingView. اقرأ المزيد في شروط الاستخدام.
نص برمجي مفتوح المصدر
بروح TradingView الحقيقية، قام مبتكر هذا النص البرمجي بجعله مفتوح المصدر، بحيث يمكن للمتداولين مراجعة وظائفه والتحقق منها. شكرا للمؤلف! بينما يمكنك استخدامه مجانًا، تذكر أن إعادة نشر الكود يخضع لقواعد الموقع الخاصة بنا.
إخلاء المسؤولية
لا يُقصد بالمعلومات والمنشورات أن تكون، أو تشكل، أي نصيحة مالية أو استثمارية أو تجارية أو أنواع أخرى من النصائح أو التوصيات المقدمة أو المعتمدة من TradingView. اقرأ المزيد في شروط الاستخدام.