INVITE-ONLY SCRIPT

W Bottom Reversal Strategy

36
W Bottom Reversal Strategy (15m-close entries; intrabar TP; daily MACD exit; JSON alerts v49.3-expire2)

Overview
A precision reversal strategy designed for 15-minute charts on liquid symbols. It detects a capitulation-and-stabilization “W” base using 1-hour (1H) context, confirms momentum improvement, then enters only on bar close to avoid early/“ghost” signals. Exits combine a fast intrabar take-profit (~2.7%) with a daily MACD risk-off exit that closes positions when higher-timeframe momentum turns against the setup.

How it works (high-level, matching code)

1H volatility + oversold gate (arming)

Compute 1H Bollinger-style bands (basis = SMA(close, bbLength=20), stdev multiplier bbMult=2.0).

Arm the setup when a 1H bar closes with price < 1H lower band and 1H RSI( rsiLength=14 ) < rsiThreshold (default 20.0).

1H momentum flip → pending entry

When a new 1H bar closes and 1H MACD line (EMA12−EMA26) crosses above 0 while armed and flat, set an entryPending flag.

This does not enter yet—it prepares a confirmed, bar-close entry on the lower timeframe.

Bar-close execution on the chart timeframe (15m)

On the next 15m bar close (or within N bars, see below) and still flat, fire the entry using a limit order at close × (1 − 0.00001) (≈ 0.001% below close) to reduce slippage and maintain chart/alert alignment.

Anti-late filter (no stale triggers)

If the pending entry doesn’t trigger within N chart bars (input: “Pending entry valid for N chart bars”, default 1, range 1–8), it expires and the arm state resets. This prevents late fills long after the 1H confirmation.

Exit logic

Primary: Standing intrabar take-profit at +2.7% from the average entry price (managed via strategy.exit limit).

Risk-off: On daily bar close, if Daily MACD line (EMA12−EMA26) crosses under 0, close the position (flat on daily momentum flip).

Default Properties (used for this publication)

Timeframe: 15m (with 1H and Daily higher-timeframe confirmations via request.security)

Initial capital: $10,000

Position sizing: Percent of equity = 10% per trade (enters only when flat; no stacking while in a position)

Commission: 0.05% per side

Slippage: Recommend 1 tick in Strategy Properties for realistic fills

Inputs exposed:

BB Length: 20 • BB Multiplier: 2.0

RSI Length: 14 • RSI Threshold: 20.0

MACD: Short 12, Long 26, Signal 9 (signal kept for compatibility; logic uses MACD line vs 0)

Pending entry valid for N chart bars: default 1 (1–8)

Execution behavior (per code):

calc_on_every_tick = false (evaluates on bar close)

process_orders_on_close = true (orders placed at bar close)

Limit entry at close −0.001%

Intrabar TP (2.7%)

Daily risk-off exit on MACD<0 at daily bar close

Alerts (exact behavior in code)

Uses alert() function calls with standardized JSON.

Set your alert to “Only alert() function calls” and “Once per bar close.”

Two events are emitted:

LONG_CONFIRMED on entry fire (15m bar close)

EXIT_CONFIRMED_DAILY_MACD on daily MACD<0 (daily bar close)

JSON fields include: event, version ("v49.3-expire2"), symbol, interval, price, and time.

How to use

Apply on liquid tickers (tight spreads, healthy volume).

Keep defaults initially; run across a broad, liquid watchlist to gather a proper sample.

For automation, route bar-close alerts to your executor; confirm broker lot/route settings and that limit orders at close −0.001% are acceptable.

Expect fewer signals in powerful trends; the daily risk-off helps cut failed bases.

Methodology & expectations (results transparency)

Evaluate on a dataset yielding 100+ trades before drawing conclusions.

Keep commission & slippage enabled (see defaults).

Risk sizing: With 10% of equity per trade and flat-to-flat entries, exposure aligns with typical 5–10% guidance.

No performance guarantees—outcomes depend on symbol selection, volatility regime, news, and execution quality.

Originality & value (vendor justification)

While it uses familiar building blocks (BB/RSI/MACD), the edge comes from the 1H volatility + oversold arming, 1H momentum flip, strict 15m bar-close limit execution, and the N-bar pending expiry that prevents stale triggers—paired with a dual-exit design (intrabar TP + daily risk-off). The focus is on reducing premature fills, keeping alerts 1:1 with chart marks, and capturing the first impulse out of a W-base.

Disclaimers

For educational purposes only; not financial advice. Paper-test first. Verify alerts, fills, and symbol liquidity with your broker before live use.

Changelog: v49.3-expire2 — Bar-close limit entries; anti-late pending window; standardized JSON alerts; intrabar 2.7% TP; daily MACD risk-off exit.

Penafian

Maklumat dan penerbitan adalah tidak dimaksudkan untuk menjadi, dan tidak membentuk, nasihat untuk kewangan, pelaburan, perdagangan dan jenis-jenis lain atau cadangan yang dibekalkan atau disahkan oleh TradingView. Baca dengan lebih lanjut di Terma Penggunaan.