INVITE-ONLY SCRIPT
Atualizado

Intraday Alpha Pro - ORB + Trend/Momentum

37
Overview
This is a pure intraday trading strategy designed for active traders seeking to capitalize on short-term price movements using two complementary modules: Opening Range Breakout (ORB) and Trend/Momentum. The strategy operates strictly within a user-defined trading session, automatically flattening all positions at session end to avoid overnight carry. It employs a points-based exit system with a trailing stop that activates only after the target is reached, ensuring disciplined risk management. Optional Martingale position sizing is included for users who prefer aggressive scaling after losses.Key Features Pure Intraday, No Carry: Trades are confined to a user-defined session (default: 9:15 AM–3:25 PM, Monday–Sunday). All positions are closed at session end.
Non-Repainting: Entries are evaluated only on confirmed bar closes (barstate.isconfirmed), ensuring no lookahead or repainting.
Dual Signal Modules: Opening Range Breakout (ORB): Captures breakouts above/below the high/low of a user-defined opening range (default: 9:15 AM–9:30 AM).
Trend/Momentum: Combines EMA (9/21) crossovers, RSI filters, volume confirmation, and an optional 200-period MA trend filter for robust trend-following signals.

Points-Based Exits: Uses fixed stop-loss (slPoints, default 16 points) and take-profit (tpPoints, default 32 points) distances. Once the take-profit level is reached, a trailing stop (trailDistPts, default 10 points) activates, ratcheting monotonically to lock in gains.
Martingale Sizing (Optional): Allows position size increases after losses (up to maxQtyInput) with a reset option after wins.
Cooldown Period: Prevents immediate re-entries after exits using a configurable cooldown (cooldownBars).
Flexible Inputs: Toggle long/short entries, enable/disable ORB or Trend/Momentum modules, and customize all parameters (e.g., MA lengths, RSI thresholds, volume multiplier).
Visuals & Alerts: Plots ORB high/low lines and moving averages (9, 21, 200). Includes alerts for long/short entries and end-of-day flattening.

How It Works Session Management: Trades only within the specified tradeSes (default: 9:15 AM–3:25 PM). The ORB module uses a separate orbSes (default: 9:15 AM–9:30 AM) to calculate breakout levels. Positions are closed automatically at session end.
Entry Conditions: ORB: Long when price closes above the ORB high after the ORB session ends; short when price closes below the ORB low.
Trend/Momentum: Long on fast MA (default EMA 9) crossing above slow MA (default EMA 21), with RSI above rsiBuy (default 55), volume exceeding volMult (default 1.5x prior bar), and price above the 200-period MA (if enabled). Shorts use the inverse.

Exit Logic: Stop-loss is set at entry price ± slPoints.
Take-profit is monitored using a running high/low since entry. Once price moves tpPoints in profit, the stop trails at trailDistPts behind the current price, adjusting only in the favorable direction (never loosening).
Exits use strategy.exit with stop only (no limit orders).

Position Sizing: Default size is baseQtyInput (minimum 1 contract). With useMartingale enabled, size increases by martingaleFactor after a loss, capped at maxQtyInput. If resetOnWin is true, size resets to baseQtyInput after a winning trade.
Cooldown: After an exit, no new trades are allowed for cooldownBars to prevent overtrading.
Futures-Safe Volume: Volume filter accommodates markets with missing or zero volume data (e.g., futures), ensuring signals aren’t blocked unnecessarily.

Inputs Trading Session: tradeSes (e.g., "0915-1525:1234567") and orbSes (e.g., "0915-0930:1234567").
Toggles: enableLong, enableShort, useORB, useTrendMom, useTrendFilter (200-MA).
Trend/Momentum: maType (EMA/SMA), fastLen (9), slowLen (21), trendLen (200), rsiLen (14), rsiBuy (55), rsiSell (45), volMult (1.5).
Exits: slPoints (16), tpPoints (32), trailDistPts (10).
Martingale: useMartingale, baseQtyInput, maxQtyInput, martingaleFactor, resetOnWin.
Cooldown: cooldownBars (1).
Legacy (Ignored): tp1RR, tp2RR, tp3RR, tp1Pct, tp2Pct, tp3Pct, stepTrail for backward compatibility.

Usage Notes Best suited for liquid, intraday markets (e.g., futures like ES, NQ, or forex pairs).
Adjust slPoints, tpPoints, and trailDistPts to match instrument volatility.
Use useMartingale cautiously, as it increases risk after losses.
Ensure tradeSes and orbSes align with your market’s trading hours.
Alerts can be set for long/short entries and EOD flattening.
The strategy avoids lookahead and repainting, ensuring reliability in live trading.

Risk Warning
Trading involves significant risk. Backtest thoroughly and use appropriate risk management. The Martingale option can amplify losses if not carefully monitored. Past performance is not indicative of future results.
Notas de Lançamento
use ORB or Use trendMom

Aviso legal

As informações e publicações não devem ser e não constituem conselhos ou recomendações financeiras, de investimento, de negociação ou de qualquer outro tipo, fornecidas ou endossadas pela TradingView. Leia mais em Termos de uso.