OPEN-SOURCE SCRIPT

NY Session Trend Retest Strategy

943
A Session-based trend continuation and breakout system built around the relationship between:

* Higher timeframe trend
* Anchored VWAP
* Premarket structure
* EMA positioning
* Session liquidity behavior

It’s essentially a **hybrid momentum + mean reversion framework** designed for intraday futures trading, especially instruments like:

* NQ / MNQ
* ES / MES
* Gold / MGC

where intraday institutional flow around VWAP and session highs/lows matters heavily.

---

# Core Strategy Concept

The strategy attempts to align trades with:

1. Higher timeframe directional bias
2. Intraday institutional positioning via Anchored VWAP
3. Session expansion away from equilibrium
4. Liquidity reactions at key levels

Instead of blindly buying/selling crossovers, it tries to enter only when price interacts with important session reference points while the broader trend is already established.

---

# Higher Timeframe Trend Filter

The backbone of the system is a higher timeframe EMA trend filter.

```text
Price above HTF EMA = bullish environment
Price below HTF EMA = bearish environment
```

This prevents counter-trend trades during strong directional sessions and keeps the strategy aligned with broader market structure.

The idea is:

* buy pullbacks in bullish regimes
* short rallies in bearish regimes

rather than constantly fading momentum.

---

# Anchored VWAP Logic

The anchored VWAP resets every trading session and acts as the strategy’s institutional equilibrium level.

This is one of the most important parts of the system because it determines:

* directional bias
* entry location
* trade quality
* exit behavior
* market regime conditions

The strategy treats VWAP as:

* support in bullish sessions
* resistance in bearish sessions

and uses it to detect whether the market is:

* trending
* balanced
* compressed
* expanding

---

# Entry Systems

Your strategy has three independent entry models.

---

## 1. VWAP Retest Entries

These are trend continuation entries.

### Long setup:

* price retests VWAP
* closes back above VWAP
* HTF trend is bullish

### Short setup:

* price retests VWAP
* closes back below VWAP
* HTF trend is bearish

This attempts to capture:

> institutional continuation after equilibrium retests

These are generally your highest-quality trend entries.

---

## 2. Premarket Breakout Entries

This is your expansion model.

The strategy tracks:

* premarket high
* premarket low

Then enters when price either:

* closes beyond those levels
OR
* retests them successfully

depending on the selected breakout mode.

This captures:

* opening drive momentum
* liquidity sweeps
* range expansion after overnight consolidation

---

## 3. EMA Retest Entries

These are secondary trend continuation entries using a faster EMA.

They allow entries during:

* shallow pullbacks
* momentum continuation
* trending intraday conditions

without requiring full VWAP interaction.

---

# VWAP Regime Filter

One of the more advanced components is your VWAP regime filter.

This prevents trades during:

* flat VWAP conditions
* compressed price action
* low expansion environments

The filter measures:

1. VWAP slope
2. Compression range

and blocks entries when the market lacks directional intent.

This is important because most intraday losses come from:

* sideways VWAP chop
* low volatility rotations
* fake breakouts during equilibrium

The filter attempts to avoid those environments entirely.

---

# Exit Logic

Your exit system is adaptive rather than fixed.

---

## Standard EMA Exit

Normally trades exit when candle bodies close aggressively across the exit EMA.

This acts as:

* trend failure detection
* momentum loss confirmation

rather than a static take-profit.

---

## VWAP Exit Override

This is one of the more unique parts of the strategy.

If a trade enters:

* below the exit EMA on longs
OR
* above the exit EMA on shorts

the strategy temporarily ignores EMA exits.

Instead, it switches to VWAP-based exits until:

* price recovers back into profit
* reclaims trend structure

This prevents:

* premature exits
* weak-entry shakeouts
* breakout trades getting cut immediately

It is especially useful for:

* PM breakout entries
* volatility expansion trades
* reclaim setups

---

# Partial Profit Taking

The strategy scales out at:

* premarket highs/lows
* intraday highs/lows

This allows:

* partial realization into liquidity
* reduced emotional volatility
* better trade management during expansion

---

# Breakeven Logic

After partial profit is taken:

* stops move to breakeven

This creates:

* asymmetric risk
* free-trade conditions
* better protection during reversals

while still allowing runners to continue.

---

# Trade Cooldown System

After a trade closes, the strategy waits a configurable amount of time before allowing another entry.

This helps avoid:

* revenge trading behavior
* chop reentries
* overtrading during consolidations

especially during:

* midday conditions
* failed breakout clusters
* post-news volatility compression

---

# Session-Based Design

The strategy is heavily session-aware.

It distinguishes between:

* premarket activity
* NY regular trading hours
* session transitions

and resets important calculations daily.

This makes it much more tailored for futures markets than generic indicator systems.

---

# Overall Trading Philosophy

The strategy is fundamentally trying to trade:

> directional expansion away from institutional equilibrium

while avoiding:

* flat VWAP environments
* low volatility compression
* weak counter-trend conditions

It combines:

* trend following
* liquidity trading
* session structure
* VWAP mean reversion concepts
* breakout continuation behavior

into a single adaptive framework.

Declinazione di responsabilità

Le informazioni e le pubblicazioni non sono intese come, e non costituiscono, consulenza o raccomandazioni finanziarie, di investimento, di trading o di altro tipo fornite o approvate da TradingView. Per ulteriori informazioni, consultare i Termini di utilizzo.