Advanced Engine: RVOL and Price ActionThis is an Enhanced version of SuperTrend and Volume Oscillator, utilising the Relative Volume and ZScore to give precise signals. This works well with Indicies and most stocks. Chose Chart TF as 10 mins
1. System Overview
The v6.12 Engine is a dual-timeframe algorithmic system. It utilizes the Chart Timeframe (CTF) to establish macro trend, mean-reversion boundaries, and structural momentum. Simultaneously, it runs a background 1-Minute Timeframe (1m TF) engine to analyze absolute volume expansion and micro-order flow delta.
The system features dynamic toggles allowing it to act as a strict trend-follower, a VWAP mean-reversion scalper, or a high-velocity volume breakout catcher.
2. Core Mathematical Components
A. Chart Timeframe (CTF) Indicators
SuperTrend (Macro Bias): ATR-based trailing envelope. (ATR: 10, Multiplier: 3.0).
Toggle:Ignore SuperTrend forces the internal state to true to allow pure VWAP mean-reversion trades.
VWAP (Intraday Baseline): Session-anchored Volume Weighted Average Price based on Typical Price (hlc3).
Volume Oscillator (Structural Momentum): Measures acceleration of trading volume.
VolOsc = 100 \times \frac{EMA(Volume, 5) - EMA(Volume, 10)}{EMA(Volume, 10)}
Requirement: Must be rising/falling over 2 consecutive bars.
Stochastic RSI (Price Velocity): Averaged %K and %D lines.
Requirement: Must be rising/falling over 2 consecutive bars, unless "Stuck" at extremities (< 1 or > 99).
B.1-Minute (1m TF) Indicators
Calculated independently of the chart timeframe using exact 1-minute tick data.
Relative Volume (RVOL): Compares the current 1m volume against the historical average volume for that exact same minute over the last N days (Default: 10 days).
Trigger (isHighRVOL): RVOL > 1.5.
Smoothed Delta Z-Score: Calculates the difference between buying volume and selling volume within the 1-minute candle, normalizes it into a Z-Score, and applies a 3-period Simple Moving Average.
Trigger (isZBull): Smoothed Z-Score is rising AND 1m Price is Bullish (Close > Open).
Trigger (isZBear): Smoothed Z-Score is rising AND 1m Price is Bearish (Close < Open).
3. Strict Entry Criteria
The engine evaluates signals via logical OR gates between sub-routines. If any of the following sub-routines return true, a trade is executed.
A. Long (BUY) Triggers
All Long entries strictly require the execution candle to be Green (Close > Open). If the 1m Sniper Filter is enabled, all Standard, Stuck, and Override entries must also have a Bullish 1m Z-Score (isZBull).
Standard Buy: SuperTrend Green + Price > VWAP + VolOsc Rising + StochRSI Rising.
Stuck Buy: StochRSI < 1 (bypassing slope) + SuperTrend Green + Price > VWAP + VolOsc Rising.
Oversold Override Buy: StochRSI < 20 + StochRSI Rising + VolOsc Rising + Price > VWAP (Overrides Red SuperTrend).
RVOL Breakout (If Enabled): Price > VWAP + SuperTrend Green + isHighRVOL + isZBull (Bypasses CTF VolOsc and StochRSI).
B. Short (SELL) Triggers
All Short entries strictly require the execution candle to be Red (Close < Open). If the 1m Sniper Filter is enabled, all Standard, Stuck, and Override entries must also have a Bearish 1m Z-Score (isZBear).
Standard Sell: SuperTrend Red + Price < VWAP + VolOsc Falling + StochRSI Falling.
Stuck Sell: StochRSI > 99 (bypassing slope) + SuperTrend Red + Price < VWAP + VolOsc Falling.
Overbought Override Sell: StochRSI > 80 + StochRSI Falling + VolOsc Falling + Price < VWAP (Overrides Green SuperTrend).
RVOL Breakout (If Enabled): Price < VWAP + SuperTrend Red + isHighRVOL + isZBear (Bypasses CTF VolOsc and StochRSI).
4. Strict Exit Criteria
The engine manages risk and flattens positions based on the following autonomous triggers:
Stop-and-Reverse (Standard): If an opposing valid entry signal fires while a position is open, the engine simultaneously calculates realized PnL, flips the state directly to the opposite direction, and updates the entry price.
VWAP Early Exit (If Enabled): Exits a trade prior to a full momentum reversal if the entire body of the candle closes across the VWAP line against the trade direction.
Long Exit: max(open, close) < VWAP
Short Exit: min(open, close) > VWAP
1m Micro-Divergence Exit (If Enabled): Exits a trade immediately if micro-order flow violently shifts against the position, regardless of the chart timeframe structure.
Long Exit: isHighRVOL AND isZBear.
Short Exit: isHighRVOL AND isZBull.
Cutoff Exit (Smart No-Entry): If a standard reversal signal fires after the No Entry Hour (Default: 14:45), the engine uses it to EXIT the current trade but strictly blocks the new entry leg.
EOD Square-Off (If Enabled): Hard flattens any remaining open positions at the exact close of the designated EOD candle (Default: 15:10) to secure intraday margins.
5. System Accounting & Webhook Outputs
Continuous Open PnL: The tradeState (-1, 0, 1) and entryPrice lock on execution. If swing trading (EOD Close disabled), floating PnL carries over across sessions.
Daily Realized PnL: Hard-resets to 0.0 at the first bar of a new calendar day. The previous day's total realized points are stamped to the Pine Logs.
Webhook Payload: The system fires strictly validated JSON strings to the configured endpoint at alert.freq_once_per_bar_close:
{"action": "BUY", "ticker": "...", "price": 0.00, "exchange": "..."}
{"action": "SELL", "ticker": "...", "price": 0.00, "exchange": "..."}
{"action": "EXIT", "ticker": "...", "price": 0.00, "exchange": "..."}
{"action": "SQUARE_OFF", "ticker": "...", "price": 0.00, "exchange": "..."}
Indicateur Pine Script®






















