OPEN-SOURCE SCRIPT
Colored TMA Trend Signals

Colored TMA Trend Signals is a clean trend-following indicator based on a Triangular Moving Average.
The TMA is calculated using double SMA smoothing. This creates a smoother line than a standard moving average and helps reduce short-term price noise.
The line changes color according to its current direction:
• Green — the TMA is rising
• Red — the TMA is falling
• Gray — the TMA is flat
Small triangle markers appear when the direction of the TMA changes:
• A green triangle marks a confirmed bullish direction change
• A red triangle marks a confirmed bearish direction change
The markers are confirmed only after the candle closes. They can be used as a visual indication of a possible trend shift, but they should not be treated as automatic entry signals.
Optional deviation bands are plotted around the TMA. They can help show when price is moving away from its smoothed average and may highlight possible dynamic reaction areas.
Available settings:
• TMA Half Length
• Price Source
• Optional Source Smoothing
• Smoothing Period
• Band Deviation
• Show or Hide Bands
• Show or Hide Trend Signals
• TMA Line Width
The indicator includes alert conditions for confirmed bullish and bearish TMA direction changes.
This script does not use centered calculations or future bars. Historical values remain stable after the candle closes.
Trend-change markers and alert conditions are confirmed only at candle close. The color of the TMA line may still change while the current candle is open because it reflects live price movement.
This indicator is not a standalone trading system. A change in TMA direction does not guarantee an immediate trend reversal. For better results, combine it with market structure, support and resistance, higher-timeframe direction, or your own confirmation method.
The TMA is calculated using double SMA smoothing. This creates a smoother line than a standard moving average and helps reduce short-term price noise.
The line changes color according to its current direction:
• Green — the TMA is rising
• Red — the TMA is falling
• Gray — the TMA is flat
Small triangle markers appear when the direction of the TMA changes:
• A green triangle marks a confirmed bullish direction change
• A red triangle marks a confirmed bearish direction change
The markers are confirmed only after the candle closes. They can be used as a visual indication of a possible trend shift, but they should not be treated as automatic entry signals.
Optional deviation bands are plotted around the TMA. They can help show when price is moving away from its smoothed average and may highlight possible dynamic reaction areas.
Available settings:
• TMA Half Length
• Price Source
• Optional Source Smoothing
• Smoothing Period
• Band Deviation
• Show or Hide Bands
• Show or Hide Trend Signals
• TMA Line Width
The indicator includes alert conditions for confirmed bullish and bearish TMA direction changes.
This script does not use centered calculations or future bars. Historical values remain stable after the candle closes.
Trend-change markers and alert conditions are confirmed only at candle close. The color of the TMA line may still change while the current candle is open because it reflects live price movement.
This indicator is not a standalone trading system. A change in TMA direction does not guarantee an immediate trend reversal. For better results, combine it with market structure, support and resistance, higher-timeframe direction, or your own confirmation method.
Mã nguồn mở
Theo đúng tinh thần TradingView, tác giả của tập lệnh này đã công bố nó dưới dạng mã nguồn mở, để các nhà giao dịch có thể xem xét và xác minh chức năng. Chúc mừng tác giả! Mặc dù bạn có thể sử dụng miễn phí, hãy nhớ rằng việc công bố lại mã phải tuân theo Nội quy.
Thông báo miễn trừ trách nhiệm
Thông tin và các ấn phẩm này không nhằm mục đích, và không cấu thành, lời khuyên hoặc khuyến nghị về tài chính, đầu tư, giao dịch hay các loại khác do TradingView cung cấp hoặc xác nhận. Đọc thêm tại Điều khoản Sử dụng.
Mã nguồn mở
Theo đúng tinh thần TradingView, tác giả của tập lệnh này đã công bố nó dưới dạng mã nguồn mở, để các nhà giao dịch có thể xem xét và xác minh chức năng. Chúc mừng tác giả! Mặc dù bạn có thể sử dụng miễn phí, hãy nhớ rằng việc công bố lại mã phải tuân theo Nội quy.
Thông báo miễn trừ trách nhiệm
Thông tin và các ấn phẩm này không nhằm mục đích, và không cấu thành, lời khuyên hoặc khuyến nghị về tài chính, đầu tư, giao dịch hay các loại khác do TradingView cung cấp hoặc xác nhận. Đọc thêm tại Điều khoản Sử dụng.