OPEN-SOURCE SCRIPT
All-In-One MA Stack Scalper

What is this Indicator?
This tool is an advanced, multi-layered breakout and trend-following indicator designed for lower timeframes. It identifies high-conviction buy and sell signals by combining moving average stacking with a suite of professional-grade filters.
How Does It Work?
A signal is generated only when ALL of the following conditions are met:
Moving Average Stack (5M Chart):
Buy: The close price is above all five moving averages (MAs: 100, 48, 36, 24, 12).
Sell: The close price is below all five MAs.
Volatility Filter (ATR):
Signals only print when the current ATR (14) is at least 80% of its 100-period average, ensuring you only trade in actively moving markets.
Candle Structure Filter:
The current candle must have a real body that is at least 35% of the candle’s total range, filtering out dojis and indecision bars.
Big Candle Filter:
The candle’s total range must be at least 40% of the current ATR, avoiding signals on minor, insignificant moves.
Volume Filter:
The current volume must be at least 80% of its 50-period average, filtering out signals during illiquid or quiet market conditions.
Minimum Distance from All MAs:
Price must be a minimum distance (20% ATR) away from each MA, confirming a clean breakout and avoiding signals in tight MA clusters or ranging markets.
RSI Momentum Filter:
Buy: RSI(14) must be greater than 55.
Sell: RSI(14) must be less than 45.
This ensures trades are only taken in the direction of momentum.
ADX Trend Filter:
ADX(14,14) must be above 20, ensuring signals only print in trending conditions (not in chop/range).
Minimum Bars Between Signals:
Only one signal per direction is allowed every 10 bars to avoid overtrading and signal clustering.
What Does This Achieve?
Reduces noise and false signals common in basic MA cross or stack systems.
Captures only strong, high-momentum, and high-conviction moves.
Helps you avoid chop, range, and news whipsaws by combining multiple market filters.
Perfect for advanced scalpers, intraday trend followers, or as a trade filter for algos/EAs.
How to Use It:
Apply to your 5-minute chart.
Green BUY signals: Only when all bullish conditions align.
Red SELL signals: Only when all bearish conditions align.
Use as a stand-alone system or as a filter for your own entries.
Recommended For:
Scalpers & intraday traders who want only the best opportunities.
EA and bot builders seeking reliable signal logic.
Manual traders seeking confirmation of high-probability breakouts.
Tip:
Adjust any of the filters (e.g., RSI/ADX thresholds, minBars, minDist) to make it more/less selective for your style or market.
This tool is an advanced, multi-layered breakout and trend-following indicator designed for lower timeframes. It identifies high-conviction buy and sell signals by combining moving average stacking with a suite of professional-grade filters.
How Does It Work?
A signal is generated only when ALL of the following conditions are met:
Moving Average Stack (5M Chart):
Buy: The close price is above all five moving averages (MAs: 100, 48, 36, 24, 12).
Sell: The close price is below all five MAs.
Volatility Filter (ATR):
Signals only print when the current ATR (14) is at least 80% of its 100-period average, ensuring you only trade in actively moving markets.
Candle Structure Filter:
The current candle must have a real body that is at least 35% of the candle’s total range, filtering out dojis and indecision bars.
Big Candle Filter:
The candle’s total range must be at least 40% of the current ATR, avoiding signals on minor, insignificant moves.
Volume Filter:
The current volume must be at least 80% of its 50-period average, filtering out signals during illiquid or quiet market conditions.
Minimum Distance from All MAs:
Price must be a minimum distance (20% ATR) away from each MA, confirming a clean breakout and avoiding signals in tight MA clusters or ranging markets.
RSI Momentum Filter:
Buy: RSI(14) must be greater than 55.
Sell: RSI(14) must be less than 45.
This ensures trades are only taken in the direction of momentum.
ADX Trend Filter:
ADX(14,14) must be above 20, ensuring signals only print in trending conditions (not in chop/range).
Minimum Bars Between Signals:
Only one signal per direction is allowed every 10 bars to avoid overtrading and signal clustering.
What Does This Achieve?
Reduces noise and false signals common in basic MA cross or stack systems.
Captures only strong, high-momentum, and high-conviction moves.
Helps you avoid chop, range, and news whipsaws by combining multiple market filters.
Perfect for advanced scalpers, intraday trend followers, or as a trade filter for algos/EAs.
How to Use It:
Apply to your 5-minute chart.
Green BUY signals: Only when all bullish conditions align.
Red SELL signals: Only when all bearish conditions align.
Use as a stand-alone system or as a filter for your own entries.
Recommended For:
Scalpers & intraday traders who want only the best opportunities.
EA and bot builders seeking reliable signal logic.
Manual traders seeking confirmation of high-probability breakouts.
Tip:
Adjust any of the filters (e.g., RSI/ADX thresholds, minBars, minDist) to make it more/less selective for your style or market.
Mã nguồn mở
Theo đúng tinh thần TradingView, người tạo ra tập lệnh này đã biến tập lệnh thành mã nguồn mở để các nhà giao dịch có thể xem xét và xác minh công năng. Xin dành lời khen tặng cho tác giả! Mặc dù bạn có thể sử dụng miễn phí, nhưng lưu ý nếu đăng lại mã, bạn phải tuân theo Quy tắc nội bộ của chúng tôi.
Thông báo miễn trừ trách nhiệm
Thông tin và ấn phẩm không có nghĩa là và không cấu thành, tài chính, đầu tư, kinh doanh, hoặc các loại lời khuyên hoặc khuyến nghị khác được cung cấp hoặc xác nhận bởi TradingView. Đọc thêm trong Điều khoản sử dụng.
Mã nguồn mở
Theo đúng tinh thần TradingView, người tạo ra tập lệnh này đã biến tập lệnh thành mã nguồn mở để các nhà giao dịch có thể xem xét và xác minh công năng. Xin dành lời khen tặng cho tác giả! Mặc dù bạn có thể sử dụng miễn phí, nhưng lưu ý nếu đăng lại mã, bạn phải tuân theo Quy tắc nội bộ của chúng tôi.
Thông báo miễn trừ trách nhiệm
Thông tin và ấn phẩm không có nghĩa là và không cấu thành, tài chính, đầu tư, kinh doanh, hoặc các loại lời khuyên hoặc khuyến nghị khác được cung cấp hoặc xác nhận bởi TradingView. Đọc thêm trong Điều khoản sử dụng.