OPEN-SOURCE SCRIPT
SAP121212 — Close vs VWAP + Optional RSI (Signals)

This indicator combines Supertrend, VWAP with bands, and an optional RSI filter to generate Buy/Sell signals.
How it works
Supertrend Flip (ATR-based): Detects when trend direction changes (from bearish to bullish, or bullish to bearish).
VWAP Band Filter: Signals only trigger if the candle close is beyond the VWAP bands:
Buy = Supertrend flips up AND close > VWAP Upper Band
Sell = Supertrend flips down AND close < VWAP Lower Band
Optional RSI Filter:
Buy requires RSI < 20
Sell requires RSI > 80
Can be enabled/disabled in settings.
Features
Choice of VWAP band calculation mode: Standard Deviation or ATR.
Adjustable ATR/StDev length and multiplier for VWAP bands.
Toggle Supertrend, VWAP lines, and Buy/Sell labels.
Alerts included: add alerts on BUY or SELL conditions (use Once Per Bar Close to avoid intrabar signals).
Use
Works best on intraday or higher timeframes where VWAP is relevant.
Use the RSI filter for more selective signals.
Can be combined with your own stop-loss and risk management rules.
⚠️ Disclaimer: This script is for educational and research purposes only. It is not financial advice. Always test thoroughly and trade at your own risk.
How it works
Supertrend Flip (ATR-based): Detects when trend direction changes (from bearish to bullish, or bullish to bearish).
VWAP Band Filter: Signals only trigger if the candle close is beyond the VWAP bands:
Buy = Supertrend flips up AND close > VWAP Upper Band
Sell = Supertrend flips down AND close < VWAP Lower Band
Optional RSI Filter:
Buy requires RSI < 20
Sell requires RSI > 80
Can be enabled/disabled in settings.
Features
Choice of VWAP band calculation mode: Standard Deviation or ATR.
Adjustable ATR/StDev length and multiplier for VWAP bands.
Toggle Supertrend, VWAP lines, and Buy/Sell labels.
Alerts included: add alerts on BUY or SELL conditions (use Once Per Bar Close to avoid intrabar signals).
Use
Works best on intraday or higher timeframes where VWAP is relevant.
Use the RSI filter for more selective signals.
Can be combined with your own stop-loss and risk management rules.
⚠️ Disclaimer: This script is for educational and research purposes only. It is not financial advice. Always test thoroughly and trade at your own risk.
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.