VWAP and RSI strategy v2
Aug 28, 2020

The VWAP and RSI strategy indicator is a trend-following mean-reversion tool designed to identify long entry points by combining volume-weighted average price (VWAP), exponential moving averages (EMA), and the Relative Strength Index (RSI).
Usage
The strategy is primarily used to identify long setups when the broad trend is bullish and the price has experienced a short-term pullback. Users can apply this strategy to index stocks like SPY or QQQ on hourly timeframes for optimal results.
To generate a buy signal, the following conditions must be met:
- Trend Filter: The Short EMA (50) must be above the Long EMA (200).
- Price Confirmation: The current candle must close above the opening price and above the VWAP session value.
- Momentum Dip: The RSI (period 3) must have dipped below the designated buy level within the last 10 candles.
The strategy also includes an optional "Add on RSI Divergence" feature. If enabled, the script will add to an existing position if the price is lower than the initial entry price but the RSI shows a higher value (bullish divergence) while maintaining the VWAP and price action filters.
Exit Rules:
- Take Profit: A sell signal is generated when the RSI crosses down through the 90 level.
- Stop Loss: The strategy includes a fixed percentage stop loss (default 5%) based on the average position price.
Details
This script uses a combination of lagging and leading indicators to filter market noise. The EMAs provide a macro trend direction, ensuring trades are only taken in the direction of the long-term momentum. The VWAP acts as a benchmark for "fair value" within a trading session, requiring the price to be above this level to confirm strength. Finally, a short-period RSI (3) is used to capture extreme short-term oversold conditions that often precede a bounce in a trending market.
Settings
- Long EMA: Sets the period for the long-term trend filter (default 200).
- Short EMA: Sets the period for the short-term trend filter (default 50).
- RSI Period: The lookback period for the RSI calculation (default 3).
- RSI Buy Line: The threshold that the RSI must dip below to qualify for a buy signal (default 15).
- RSI Sell Line: The threshold that the RSI must cross under to trigger a take profit exit (default 90).
- Add on RSI Divergence: Toggles the ability to scale into a position based on bullish RSI divergence.
- Stop Loss %: Defines the fixed percentage distance from the average entry price to trigger a stop loss exit.
FAQ
How do I interpret the background colors on the chart?
The script highlights the background when the "Add on RSI Divergence" condition is met, indicating an additional entry point for an existing long position.
What assets and timeframes work best?
This strategy was originally developed and tested for SPY and QQQ on the 1-hour chart, though it can be adapted for other liquid assets.
How do I access this script?
You can get access on the LuxAlgo Library for charting platforms like TradingView, MetaTrader (MT4/MT5), and NinjaTrader for free.
Free indicator
Get free access to this indicator on the platforms below.
Unlock the entire LuxAlgo Library
Every indicator, every strategy, full charts, and complete access to Quant — our AI agent.