OPEN-SOURCE SCRIPT
Sequentially Filtered Moving Average MTF 3.2

This is a adaptation of Alex Grovers original work in pine 4.
Sequentially Filtered Moving Average MTF 3.2 is a Pine Script overlay indicator that plots three “sequentially filtered” moving averages. Each SFMA is an SMA that only updates when the underlying SMA has moved consistently in the same direction for its full lookback period; otherwise it holds its previous value (creating flat segments during chop).
The three filters can run on independent timeframes, are stepped/extended onto the current chart, and are colored bullish/bearish/neutral according to their direction (with optional “persistent neutral” coloring).
Optional fills between the lines and outer distance lines (scaled from the gap between the first two filters) provide visual context.
Typical use cases
Trend-following / trend-strength filter: the flats help ignore noise and highlight only sustained sequential moves.
Multi-timeframe confluence: align shorter- and longer-term filtered MAs for entry/exit bias or regime detection.
Visual trend channels or distance-based levels via the fills and outer lines.
Sequentially Filtered Moving Average MTF 3.2 is a Pine Script overlay indicator that plots three “sequentially filtered” moving averages. Each SFMA is an SMA that only updates when the underlying SMA has moved consistently in the same direction for its full lookback period; otherwise it holds its previous value (creating flat segments during chop).
The three filters can run on independent timeframes, are stepped/extended onto the current chart, and are colored bullish/bearish/neutral according to their direction (with optional “persistent neutral” coloring).
Optional fills between the lines and outer distance lines (scaled from the gap between the first two filters) provide visual context.
Typical use cases
Trend-following / trend-strength filter: the flats help ignore noise and highlight only sustained sequential moves.
Multi-timeframe confluence: align shorter- and longer-term filtered MAs for entry/exit bias or regime detection.
Visual trend channels or distance-based levels via the fills and outer lines.
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.