OPEN-SOURCE SCRIPT
Moving Average Signals : Support Resistance

This indicator plots a Simple Moving Average (default 50-period, adjustable) and highlights potential bounce or rejection signals when price interacts with the SMA.
It is designed to identify moments when price tests the moving average from one side and then continues in the prior direction, signaling a possible continuation trade.
🔴 Red Triangle (Bearish Rejection)
A red triangle is plotted above the bar when:
This suggests the SMA acted as resistance and the downtrend may resume.
🟢 Green Triangle (Bullish Rejection)
A green triangle is plotted below the bar when:
This suggests the SMA acted as support and the uptrend may resume.
⚡ HOW TO USE IN TRADING
Trend Confirmation
Signal Entry
Stop-Loss Placement
Take-Profit Ideas
Filters for Higher Accuracy (optional)
It is designed to identify moments when price tests the moving average from one side and then continues in the prior direction, signaling a possible continuation trade.
🔴 Red Triangle (Bearish Rejection)
A red triangle is plotted above the bar when:
- Price has been trading below the SMA.
- Price tests the SMA from below (the high touches or pierces the SMA but closes back below it).
- Price then continues lower on the next bar.
This suggests the SMA acted as resistance and the downtrend may resume.
🟢 Green Triangle (Bullish Rejection)
A green triangle is plotted below the bar when:
- Price has been trading above the SMA.
- Price tests the SMA from above (the low touches or pierces the SMA but closes back above it).
- Price then continues higher on the next bar.
This suggests the SMA acted as support and the uptrend may resume.
⚡ HOW TO USE IN TRADING
Trend Confirmation
- Use this indicator in trending markets (not choppy ranges).
- A rising SMA suggests bullish trend bias; a falling SMA suggests bearish trend bias.
Signal Entry
- Green Triangle: Consider long entries when the SMA supports price and a bullish continuation is signaled.
- Red Triangle: Consider short entries when the SMA rejects price and a bearish continuation is signaled.
Stop-Loss Placement
- Place stops just beyond the SMA or the rejection candle’s high/low.
- Example: For a red signal, stop above the SMA or rejection candle’s high.
Take-Profit Ideas
- Target prior swing highs/lows or use risk/reward multiples (e.g., 2R, 3R).
- You can also trail stops behind the SMA in a strong trend.
Filters for Higher Accuracy (optional)
- Confirm signals with volume, momentum indicators (e.g., RSI, MACD), or higher-timeframe trend.
- Avoid trading signals against strong higher-timeframe bias.
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.