OPEN-SOURCE SCRIPT
Обновлено Lanovyx

# Lanovyx — Setup Window Confluence System
## The Problem This Solves
Traditional confluence indicators require all conditions to align on the exact same bar: stochastic must be oversold AND price must touch support AND divergence must form — all simultaneously. In real markets, this rarely happens. Price touches VWAP -2σ, but stochastic doesn't reach oversold until 3 bars later. The opportunity is missed.
**Lanovyx solves this with the Setup Window methodology.**
---
## Core Innovation: Setup Windows
Instead of requiring simultaneous conditions, Lanovyx separates trading signals into two phases:
**Phase 1 — Context Event (Setup Activation)**
When a meaningful event occurs, it "opens a window" that stays active for a configurable number of bars:
- Price touches VWAP ±2σ or ±3σ band → window opens
- Price tests Previous Day High/Low → window opens
- Stochastic divergence forms → window opens
- Opening Range breakout occurs → window opens
- Price reaches Support/Resistance level → window opens
Each event adds to a cumulative "setup score" (capped at 8). Higher scores indicate stronger context.
**Phase 2 — Trigger (Signal Generation)**
Within the active window, when stochastic conditions confirm, a signal fires. The trigger doesn't need to occur on the same bar as the context — it just needs to occur while the window is open.
This two-phase approach captures setups that traditional indicators miss entirely.
---
## Why Stochastic + VWAP Confluence Works
**VWAP (Volume-Weighted Average Price)** tells us where institutional money has transacted. The standard deviation bands identify statistical extremes:
- Price at VWAP -2σ is extended to the downside (potential mean reversion long)
- Price at VWAP +2σ is extended to the upside (potential mean reversion short)
**Stochastic Oscillator** measures momentum exhaustion. When price reaches a VWAP extreme AND stochastic shows momentum reversing, we have confluence of:
1. Price extension (VWAP bands)
2. Momentum exhaustion (Stochastic)
3. Context validation (Setup Window score)
The multi-lane stochastic (14/21/55 periods) adds timeframe confluence — when fast, medium, and slow stochastics align, the signal is stronger.
---
## Five Signal Families
Each family targets a specific market condition:
### 1. Trend Entry (T) — Blue Labels
**When:** Stochastic pulls back to 25-55 zone (longs) or 45-75 zone (shorts) during established trend
**Logic:** In trending markets, pullbacks to the "value zone" offer low-risk entries with trend
**Best for:** Trending days with clear directional bias
### 2. Mean Reversion (R) — Green/Red Labels
**When:** Stochastic exits oversold (<20) or overbought (>80) with active setup window
**Logic:** At VWAP extremes with momentum exhaustion, price tends to revert to mean
**Best for:** Range-bound, choppy markets
**Requires:** Active setup window (context event must have occurred)
### 3. Breakout (B) — Orange Labels
**When:** Stochastic lanes compress ("coil") then expand, crossing the 50 midline
**Logic:** Compression precedes expansion; breakout from tight range signals new trend
**Best for:** Transition days, post-squeeze moves
### 4. Momentum (M) — Green/Red Labels
**When:** Stochastic crosses 50 from extreme zone (<25 or >75) within lookback period
**Logic:** Catches V-shaped reversals where regime detection lags the move
**Best for:** Fast reversals, news-driven moves
### 5. Counter-Signal / FADE (C) — Purple Labels
**When:** A signal fires and immediately fails (stochastic reverses sharply against it)
**Logic:** Failed signals often lead to strong moves in the opposite direction (trapped traders)
**Confidence gating:** High-confidence fades generate signals; low-confidence show warnings only
---
## Institutional Key Levels
Lanovyx incorporates levels that institutional traders use:
- **PDH/PDL** (Previous Day High/Low) — Major support/resistance where stops cluster
- **PDC** (Previous Day Close) — Settlement price, gap reference
- **ORB** (Opening Range) — First 15 minutes high/low, breakout trigger
- **IB** (Initial Balance) — First 60 minutes range, institutional benchmark
These levels automatically activate setup windows when price interacts with them, adding to the setup score.
---
## Filtering System
**ADX Filter:** In strong trends (ADX > 25), blocks counter-trend mean reversion signals to avoid fighting momentum.
**HTF Bias Filter:** Optional alignment with higher timeframe (e.g., 1-hour) EMAs. Can block or demote signals that oppose the larger trend.
**Regime Detection:** Classifies market as Uptrend, Downtrend, Sideways, or Squeeze using EMA alignment and market structure (HH/HL/LH/LL patterns).
---
## How to Use
1. **Wait for Setup** — Watch for context events (VWAP band touch, key level test, divergence)
2. **Check the Score** — Higher setup scores indicate stronger context (visible in debug mode)
3. **Wait for Trigger** — Let stochastic confirm within the window
4. **Confirm Regime** — Ensure signal type matches market condition
5. **Manage Risk** — Use the ATR-based stop/target levels shown after signals
**Strong signals (★)** appear when multiple confluence factors align — these are highest probability setups.
---
## Settings Overview
| Setting | Default | Purpose |
|---------|---------|---------|
| Setup Window | 10 bars | How long context events stay active |
| Entry Zone | 25-55 | Stochastic zone for trend pullback entries |
| OS/OB Levels | 20/80 | Stochastic extremes for mean reversion |
| Stop Loss | 1.5 ATR | Risk management distance |
| Target 1 | 2.0 ATR | First profit target (1.33:1 R:R) |
Recommended timeframes: 5-minute and 15-minute charts.
---
## Disclaimer
This indicator is for educational purposes only and does not constitute financial advice. Past performance does not guarantee future results. Always use proper risk management and never risk more than you can afford to lose. No indicator can predict the future — use this as one input in your trading decision process, not as a standalone system.
## The Problem This Solves
Traditional confluence indicators require all conditions to align on the exact same bar: stochastic must be oversold AND price must touch support AND divergence must form — all simultaneously. In real markets, this rarely happens. Price touches VWAP -2σ, but stochastic doesn't reach oversold until 3 bars later. The opportunity is missed.
**Lanovyx solves this with the Setup Window methodology.**
---
## Core Innovation: Setup Windows
Instead of requiring simultaneous conditions, Lanovyx separates trading signals into two phases:
**Phase 1 — Context Event (Setup Activation)**
When a meaningful event occurs, it "opens a window" that stays active for a configurable number of bars:
- Price touches VWAP ±2σ or ±3σ band → window opens
- Price tests Previous Day High/Low → window opens
- Stochastic divergence forms → window opens
- Opening Range breakout occurs → window opens
- Price reaches Support/Resistance level → window opens
Each event adds to a cumulative "setup score" (capped at 8). Higher scores indicate stronger context.
**Phase 2 — Trigger (Signal Generation)**
Within the active window, when stochastic conditions confirm, a signal fires. The trigger doesn't need to occur on the same bar as the context — it just needs to occur while the window is open.
This two-phase approach captures setups that traditional indicators miss entirely.
---
## Why Stochastic + VWAP Confluence Works
**VWAP (Volume-Weighted Average Price)** tells us where institutional money has transacted. The standard deviation bands identify statistical extremes:
- Price at VWAP -2σ is extended to the downside (potential mean reversion long)
- Price at VWAP +2σ is extended to the upside (potential mean reversion short)
**Stochastic Oscillator** measures momentum exhaustion. When price reaches a VWAP extreme AND stochastic shows momentum reversing, we have confluence of:
1. Price extension (VWAP bands)
2. Momentum exhaustion (Stochastic)
3. Context validation (Setup Window score)
The multi-lane stochastic (14/21/55 periods) adds timeframe confluence — when fast, medium, and slow stochastics align, the signal is stronger.
---
## Five Signal Families
Each family targets a specific market condition:
### 1. Trend Entry (T) — Blue Labels
**When:** Stochastic pulls back to 25-55 zone (longs) or 45-75 zone (shorts) during established trend
**Logic:** In trending markets, pullbacks to the "value zone" offer low-risk entries with trend
**Best for:** Trending days with clear directional bias
### 2. Mean Reversion (R) — Green/Red Labels
**When:** Stochastic exits oversold (<20) or overbought (>80) with active setup window
**Logic:** At VWAP extremes with momentum exhaustion, price tends to revert to mean
**Best for:** Range-bound, choppy markets
**Requires:** Active setup window (context event must have occurred)
### 3. Breakout (B) — Orange Labels
**When:** Stochastic lanes compress ("coil") then expand, crossing the 50 midline
**Logic:** Compression precedes expansion; breakout from tight range signals new trend
**Best for:** Transition days, post-squeeze moves
### 4. Momentum (M) — Green/Red Labels
**When:** Stochastic crosses 50 from extreme zone (<25 or >75) within lookback period
**Logic:** Catches V-shaped reversals where regime detection lags the move
**Best for:** Fast reversals, news-driven moves
### 5. Counter-Signal / FADE (C) — Purple Labels
**When:** A signal fires and immediately fails (stochastic reverses sharply against it)
**Logic:** Failed signals often lead to strong moves in the opposite direction (trapped traders)
**Confidence gating:** High-confidence fades generate signals; low-confidence show warnings only
---
## Institutional Key Levels
Lanovyx incorporates levels that institutional traders use:
- **PDH/PDL** (Previous Day High/Low) — Major support/resistance where stops cluster
- **PDC** (Previous Day Close) — Settlement price, gap reference
- **ORB** (Opening Range) — First 15 minutes high/low, breakout trigger
- **IB** (Initial Balance) — First 60 minutes range, institutional benchmark
These levels automatically activate setup windows when price interacts with them, adding to the setup score.
---
## Filtering System
**ADX Filter:** In strong trends (ADX > 25), blocks counter-trend mean reversion signals to avoid fighting momentum.
**HTF Bias Filter:** Optional alignment with higher timeframe (e.g., 1-hour) EMAs. Can block or demote signals that oppose the larger trend.
**Regime Detection:** Classifies market as Uptrend, Downtrend, Sideways, or Squeeze using EMA alignment and market structure (HH/HL/LH/LL patterns).
---
## How to Use
1. **Wait for Setup** — Watch for context events (VWAP band touch, key level test, divergence)
2. **Check the Score** — Higher setup scores indicate stronger context (visible in debug mode)
3. **Wait for Trigger** — Let stochastic confirm within the window
4. **Confirm Regime** — Ensure signal type matches market condition
5. **Manage Risk** — Use the ATR-based stop/target levels shown after signals
**Strong signals (★)** appear when multiple confluence factors align — these are highest probability setups.
---
## Settings Overview
| Setting | Default | Purpose |
|---------|---------|---------|
| Setup Window | 10 bars | How long context events stay active |
| Entry Zone | 25-55 | Stochastic zone for trend pullback entries |
| OS/OB Levels | 20/80 | Stochastic extremes for mean reversion |
| Stop Loss | 1.5 ATR | Risk management distance |
| Target 1 | 2.0 ATR | First profit target (1.33:1 R:R) |
Recommended timeframes: 5-minute and 15-minute charts.
---
## Disclaimer
This indicator is for educational purposes only and does not constitute financial advice. Past performance does not guarantee future results. Always use proper risk management and never risk more than you can afford to lose. No indicator can predict the future — use this as one input in your trading decision process, not as a standalone system.
Информация о релизе
Bug fixesСкрипт с открытым кодом
В истинном духе TradingView, создатель этого скрипта сделал его открытым исходным кодом, чтобы трейдеры могли проверить и убедиться в его функциональности. Браво автору! Вы можете использовать его бесплатно, но помните, что перепубликация кода подчиняется нашим Правилам поведения.
Отказ от ответственности
Информация и публикации не предназначены для предоставления и не являются финансовыми, инвестиционными, торговыми или другими видами советов или рекомендаций, предоставленных или одобренных TradingView. Подробнее читайте в Условиях использования.
Скрипт с открытым кодом
В истинном духе TradingView, создатель этого скрипта сделал его открытым исходным кодом, чтобы трейдеры могли проверить и убедиться в его функциональности. Браво автору! Вы можете использовать его бесплатно, но помните, что перепубликация кода подчиняется нашим Правилам поведения.
Отказ от ответственности
Информация и публикации не предназначены для предоставления и не являются финансовыми, инвестиционными, торговыми или другими видами советов или рекомендаций, предоставленных или одобренных TradingView. Подробнее читайте в Условиях использования.