INVITE-ONLY SCRIPT
Actualizado

New Rate - PREMIUM v2

2 104
New Rate - PREMIUM v2

New Rate - PREMIUM v2 is an intraday Opening Range Breakout (ORB) strategy built around a strict one-trade-per-day execution model.

The strategy defines a price range using the first N candles of a user-defined session, freezes the High/Low at the close of candle N, and places OCO stop orders exactly at those levels. The first breakout fills, the opposite order is canceled, and no further trades are allowed until the next trading day.

This script is published for educational and research purposes, with documented mechanics and backtest settings to support transparency and reproducibility.
imagen
How the strategy works

  1. Session range construction
    The user selects a minutes-based timeframe, a session start time, and the number of candles N. During the session window, the strategy tracks the highest High and lowest Low formed by the first N candles. These candles are visually highlighted on the chart.
  2. Range freeze
    When candle N closes, the range is locked. Horizontal High/Low lines are drawn and extended forward. An optional 50% midpoint can be displayed for reference.
  3. OCO breakout execution
    Immediately after the range is frozen, the strategy places:
    • A buy stop at the frozen High
    • A sell stop at the frozen Low

    Orders are linked using OCO (One-Cancels-Other) logic. When one side fills, the opposite order is automatically canceled.
  4. Exit management
    Two exit frameworks are available:
    • Tick-based exits: stop-loss and take-profit are fixed distances in ticks from entry.
    • Risk/Reward exits: optional stop at the opposite side of the range, with TP calculated as RR × risk.

    Both modes can display SL/TP boxes projected forward for visual review.
  5. Daily execution lock
    After the first filled trade of the day, the strategy blocks any new entries until the next daily reset. This enforces strict discipline and prevents over-trading.
    [/list=1]

    Visual features

    • Configurable High/Low lines and labels (color, style, width, alignment)
    • Optional midpoint (50%) line
    • Session background highlight with adjustable opacity
    • Optional SL/TP boxes with configurable colors, borders, and projection length
    • Weekday filter (trade only selected days)

    imagen
    Settings used for the published backtest (replication)

    The performance screenshots included with this publication were generated using the following configuration:

    Market & chart
    • Symbol: FX:XAUUSD
    • Timeframe: 15 minutes


    Session & range
    • Session start: as configured on chart (exchange time)
    • Range candles (N): 1
    • Auto range end: enabled (TF × N)
    • Line extension: 20 bars


    Exits
    • Exit mode: SL/TP by ticks
    • Stop-loss: 1500 ticks
    • Take-profit: 2000 ticks


    Weekdays
    • Monday to Friday enabled


    Strategy Properties (TradingView settings)
    • Initial capital: 1,000 USD
    • Commission: 0.1 (as set in Strategy Properties)
    • Slippage: 1 tick


    Users should adjust commission, slippage, and position sizing to match their own broker and execution conditions.

    Backtest context and limitations
    • This strategy uses stop orders that may fill intrabar depending on TradingView’s execution model.
    • Results vary by symbol, timeframe, session selection, and trading costs.
    • Past performance does not guarantee future results.
    • This script is not financial advice.


    Originality and usefulness

    While opening-range breakouts are a known concept, this strategy’s implementation focuses on:
    • Exact range-freeze timing: orders are armed precisely at the close of the N-th candle.
    • True OCO + hard daily lock: one-and-done execution enforced at the engine level.
    • Dual exit framework: fixed-tick and RR exits analyzed with the same SL/TP visual logic.
    • Operational safeguards: weekday filters and drawing limits designed for stable long-term backtesting.
Notas de prensa
UPDATE v3 — Major feature update

Ported key features from the MQL5 EA version to TradingView. This update adds trade management, advanced filters, a real-time dashboard, and 11 alert conditions.


  1. STRATEGY
    • - Confirmation Mode: New entry type. Instead of stop orders at the range high/low, waits for a candle to close beyond the range before entering. Reduces false breakouts.
    • - Trade Direction Filter: Choose between Both, Long Only, or Short Only.
    • - ATR-Based SL/TP: Third mode alongside fixed ticks and opposite extreme. SL adapts to current volatility using ATR multiplier. TP is calculated as SL x Risk-Reward ratio.
  2. TRADE MANAGEMENT
    *
    • - Breakeven: Moves SL to entry + lock ticks when price reaches a configurable percentage of the TP distance.
    • - Trailing Stop: Activates at a configurable percentage of TP and trails behind price at a fixed tick distance.
    • - Partial Close: Closes a percentage of the position when price reaches a percentage of TP.
    • - Multi-TP (TP1 + TP2): Define a first target (TP1) for partial close and a second target (TP2) for the remainder. Works alongside Breakeven and Trailing.
  3. FILTERS AND PROTECTION
    *
    • - Range Size Filter: Skips the session if the range is too narrow (whipsaws) or too wide (excessive risk). Configurable min/max in ticks.
    • - Gap Protection: Prevents entry if the current price is too far from the range levels.
    • - Max Daily Loss: Closes all positions and stops trading for the day if daily PnL drops below a configurable percentage.
    • - Kill Zone: Deadline hour for entries. Cancels pending orders if no breakout occurred before the specified time.
    • - Session Close Exit: Closes all positions and pending orders at a fixed time.
    • - Pending Order Expiration: Cancels unfilled stop orders after N bars.
    • - Max Hold Time: Closes position if it has been open longer than a configurable number of hours.
  4. DASHBOARD
    *
    • - Real-time table on the chart showing: current status, daily PnL, entry/SL/TP levels, percentage progress toward TP, active management flags (BE/TS/PC), win rate, and profit factor.
    • - Configurable position (four corners) and text size.
  5. VISUALS
    • - Dynamic Range Box: Box spanning the range candles that changes color based on breakout direction (neutral/bullish/bearish).
    • - Dynamic SL/TP Lines: Lines that extend from entry and update in real time as Breakeven or Trailing modifies the stop level. Independent colors for SL, TP, TP1, and Entry.
    • - Weekend Trading: Saturday and Sunday now available as trading day options for crypto markets.
  6. ALERTS
  7. 11 alert conditions: Range Formed, Long Entry, Short Entry, Breakeven Activated, Trailing Active, Partial Close, TP1 Hit, Time Exit, Session Close, Max Daily Loss, Kill Zone.
  8. UI IMPROVEMENTS
    *
    • - Reduced from 11 input groups to 8.
    • - Shorter labels, more inline grouping, less scrolling.
    • - SL/TP mode consolidated into a single dropdown (Fixed Ticks / Opposite Extreme + RR / Dynamic ATR).
Notas de prensa
UPDATE Version Ultra — Major feature update

Complete rewrite that ports the full parameter set from the MQL5 Expert Advisor version, so configuration sets from the MT5 counterpart can be replicated directly on TradingView by copying the same values.


STRATEGY

- Confirmation Mode: new entry type. Instead of stop orders at the range high/low, waits for a candle to close beyond the range before entering. Reduces false breakouts.
- Trade Direction Filter: Both Sides, Long Only, or Short Only.
- Entry Modes are parameter-compatible with the MT5 EA (ENTRY_BREAKOUT / ENTRY_CONFIRMATION).


SESSION

- Configurable session start hour and minute with optional manual end or automatic end (TF x N candles).
- Session Timezone selector: the session times are interpreted in the chosen timezone instead of the chart timezone. This allows users to align the session with the server timezone of an external backtest (for example GMT+3) so ranges form at the same absolute moments.


ROBUSTNESS AND FILTERS

- Gap Protection: prevents entry if the current price is too far from the range.
- Pending Expiration: cancels unfilled stop orders after N hours (matches MT5 input).
- Trading days selector (Sun through Sat) and One Trade Per Day toggle.


EXIT AND STOP LOSS

- SL at opposite extreme: the stop is placed at the opposite side of the range.
- SL/TP in ticks: fixed tick distances for SL and TP.
- TP by Risk-Reward ratio when using opposite extreme mode.


TRADE MANAGEMENT (percentage of TP)

- Breakeven: when price reaches a configurable percentage of the TP distance, SL moves to entry plus a lock amount.
- Trailing Stop: activates at a configurable percentage of TP and trails behind price at a fixed distance.
- Partial Close: closes a percentage of the position when price reaches a percentage of TP.
- Max Hold Time: closes the position after a configurable number of hours.


RISK SETTINGS

- Dynamic Risk Percent per trade: position size is calculated from equity (or balance) and SL distance so every trade risks the same percentage regardless of SL size. Essential when using SL at opposite extreme, where SL distance varies per range.
- Choice of Equity or Balance as the base for risk calculation.


DASHBOARD

- On-chart panel showing: strategy configuration, active trade info or capital summary, and full statistics block including Net Profit, Win Rate, Profit Factor, Expectancy, Avg Win and Avg Loss, average Risk-Reward, best and worst trade, Max Drawdown, current streak and max streaks, and daily PnL.
- Configurable position on chart.


CHART VISUALS

- Range High and Low lines with configurable color, width, style, and label position.
- Dynamic Range Box that changes color based on price versus range (neutral, bull break, bear break).
- SL and TP zone boxes drawn at the entry bar with configurable projection length.
- Range candle coloring and neutral coloring for non-range candles.
- Optional midline at range 50 percent.


ALERTS

Seven alert conditions are provided: Range Formed, Long Entry, Short Entry, Breakeven Activated, Trailing Active, Partial Close, and Time Exit.


NOTES ON BROKER PARITY

Historical data between TradingView and external platforms can differ by price source. For backtest comparisons, use the Session Timezone input to match the external server timezone, and run the comparison over a period where both data feeds are aligned.

Notas de prensa
NEW RATE — Update v3.3

New features:
- Webhook notifications with formatted messages (range formed, entries, position management, time-based exit)
- Optional risk calculation based on fixed initial capital, in addition to balance and equity modes
- Automatic chart timeframe detection
- Real-time statistics dashboard: win rate, profit factor, expectancy, average R:R, current streak

UX improvements:
- Session end calculated automatically based on TF and number of range candles
- Toggle ON/OFF for pending order expiration
- Stop Loss / Take Profit unified in a single selector (opposite extreme + RR, or fixed ticks)
- Tooltips added across main options
- Multi-timezone support to align session with broker server time

Technical changes:
- Migrated to Pine Script v6
- Automatic fill detection for position management
- Internal tracking of best/worst trade and streaks
- Optimized daily reset
- Dynamic SL/TP visual boxes at entry

Notes:
- For accounts with fixed capital: use "Initial Capital" as risk basis
- Configure Initial Capital in the script's Properties tab
- Default timezone is GMT+3 (configurable based on broker server)

---

ESPAÑOL

NEW RATE — Actualización v3.3

Nuevas funcionalidades:
- Notificaciones via webhook con mensajes formateados (rango formado, entradas, gestion, cierre por tiempo)
- Calculo de riesgo basado en capital inicial fijo (opcional), ademas de balance y equity
- Deteccion automatica del timeframe del grafico
- Dashboard de estadisticas en tiempo real: win rate, profit factor, expectancy, R:R promedio, racha actual

Mejoras de usabilidad:
- Fin de sesion calculado automaticamente segun TF y numero de velas del rango
- Toggle ON/OFF para expiracion de ordenes pendientes
- SL/TP unificado en un solo selector (extremo opuesto + RR, o ticks fijos)
- Tooltips anadidos en todas las opciones principales
- Soporte multi-timezone

Cambios tecnicos:
- Migrado a Pine Script v6
- Deteccion automatica de fills para gestion de posicion
- Tracking interno de mejor/peor trade y rachas
- Reset diario optimizado
- Cajas visuales dinamicas de SL/TP al entry

Notas:
- Para cuentas con capital fijo: usar "Initial Capital" como base de riesgo
- Configurar el Capital Inicial en la pestaña Propiedades
- Timezone por defecto GMT+3 (configurable segun servidor del broker)
Notas de prensa
v3.7 — Mejoras de alertas y estabilidad

- Alertas de Telegram ahora con captura del gráfico (la señal llega con imagen).
- Nueva alerta de cierre: avisa cuando la operación cierra en SL o TP, con el resultado de la operación.
- Corrección importante de margen: las entradas se ejecutan correctamente al usar el riesgo dinámico (Risk%).
- Mejoras de estabilidad en el envío de alertas.
Notas de prensa
v3.8 — Customizable Dashboard

The stats panel can now be adjusted from the inputs, no code editing required. New options in the "Ultra Visuals" group:

- Size: Compact / Normal / Large — scales all panel text. Useful on smaller screens.
- Compact mode: shows only the essentials (title, active trade / return, Win Rate, Profit Factor, daily summary). Roughly halves the number of rows.
- Theme: Blue / Dark / Minimal — to match your chart background.

The existing "Show Dashboard" toggle still hides the panel entirely.

Internal: the panel now redraws with a dynamic row index, so hidden rows no longer leave blank gaps.

--

Exención de responsabilidad

La información y las publicaciones no constituyen, ni deben considerarse como, asesoramiento o recomendaciones financieras, de inversión, de trading u otro tipo, proporcionadas o respaldadas por TradingView. Obtenga más información en Condiciones de uso.