PROTECTED SOURCE SCRIPT

CRT Trade Planner - Candle Range Theory [PoPey]

3 796
CRT Trade Planner - Candle Range Theory [PoPey]

Maps the full Candle Range Theory sequence on your chart - HTF range, liquidity sweep, close-back confirmation - and draws the complete trade plan (entry, SL, TP zones) so you only have to make the one decision that should stay human: the lower-timeframe confirmation.

What is CRT
Candle Range Theory treats each higher-timeframe candle as a tradable range, following the accumulation - manipulation - distribution sequence: a reference candle defines the range (its high = buy-side liquidity, its low = sell-side liquidity), price sweeps one extreme to take liquidity, closes back inside the range, and tends to deliver toward the opposite extreme. The broad concept comes from the "Power of 3" school and is widely known; what differs between tools is how strictly the sequence is validated and what happens after detection.

How it's calculated
Pine Script®

Two confirmation schools via input: Intra (any chart-timeframe close back inside confirms) and 3-candle (the next HTF candle must sweep and close back inside - the classic model; outside bars that sweep both sides are discarded as ambiguous).

Why this is different from existing CRT scripts
Most CRT tools stop at detection: they mark the pattern and leave you there. This one is a planner with quality gates:
  • Minimum R:R filter - if the return move already ate the range, there is no trade left; the signal waits for a pullback with real reward instead of printing a 0.2R setup.
  • Entry-coherence gate - the entry must be inside the range and on the correct side of the SL, or nothing fires.
  • Range-size filter - ranges smaller than a configurable multiple of the HTF ATR are skipped, removing consolidation chop where CRT sweeps both sides.
  • Trading window - optionally confirm only during the first X% of the HTF candle (the manipulation phase), only the candle opening at a specific hour (e.g. the 9:00 NY futures open), and with a daily signal cap.
  • Re-arm on deeper sweep - after a stop-hunt of the first entry, a deeper sweep re-arms the signal for the higher-probability second entry.
  • Sequential execution - optional one-trade-at-a-time mode: no new signal while a plan is open, mirroring real prop-firm execution, which makes the statistics honest.
  • Resolved plans - every plan is tracked to its own TP or SL (multiple plans in parallel), marked on the chart, and its boxes truncate where the trade actually ended.


How to read it
  • Gray live box - the current HTF range: dashed line at the high (liquidity above), dashed line at the low (liquidity below), golden dashed 50% (equilibrium).
  • BARRIDO diamond - the exact point where liquidity was taken. A confluence tag (PDH, ASIA) appears when the sweep also took a key level.
  • BUY / SELL label on the candle - confirmed CRT (context, not a recommendation).
  • Beige box - reward zone to the TP (opposite extreme). Gray box - risk zone to the SL. Both start at the next bar's open.
  • TP / SL marks - each plan resolves on-chart; the status panel accumulates how many CRTs reached 50% and the full target.


The human step - by design
The tool deliberately does NOT automate the lower-timeframe confirmation (market structure shift / CHoCH and the refined OB/FVG entry). That step is discretionary in every serious CRT framework, and automating it would just impose one arbitrary definition. The indicator hands you the mechanical part - range, sweep, confirmation, plan, statistics - and the alert tells you to go check your LTF. The decision stays yours.

Non-repainting
HTF data uses confirmed candles only (one-bar offset with lookahead, the documented non-repainting request.security method), so historical and real-time behavior are identical. All signals and plan resolutions evaluate only on confirmed bar closes (barstate.isconfirmed): a printed signal never disappears. By design, HTF context is up to one HTF bar "late" - that is exactly what makes it repaint-free.

Inputs (UI is in Spanish - English translation)
  • Timeframe del rango (HTF) = Range timeframe (default 240 = H4)
  • Modo de confirmacion = Confirmation mode (Intra / 3-candle HTF close)
  • R:R minimo para confirmar = Minimum R:R to confirm
  • Buffer del SL (x ATR14) = SL buffer beyond the sweep wick, in ATRs
  • Tamano minimo del rango (x ATR HTF) = Minimum range size filter
  • Una operacion a la vez = One trade at a time
  • Una sola direccion por rango = One direction per range
  • Re-armar tras barrido mas profundo = Re-arm after a deeper sweep
  • Solo fase de manipulacion / Fraccion operable = Only the first X% of the HTF candle
  • Solo la vela de una hora especifica / Hora de apertura = Only the HTF candle opening at this hour
  • Maximo de senales por dia = Daily signal cap
  • CRTs historicos en pantalla = Historical CRTs kept on chart
  • PDH/PDL, Rango de Asia = Previous day high/low, Asian session range
  • Kill zones (Londres / NY) + Confirmar SOLO dentro de Kill Zone = session windows + only confirm inside them
  • Panel de estado / Estadisticas = Status panel / statistics

Panel fields: Estado = state (Esperando = waiting, Barrio High/Low = swept, CRT confirmado = confirmed); Ahora = what to wait for next.

Limitations - read this
This is a context and trade-planning tool, not a buy/sell recommendation and not a guaranteed signal. The BUY/SELL labels, SL/TP boxes and statistics are educational context: the panel percentages count how often price touched the 50% and the opposite extreme after confirmation under the active filters - they are pattern statistics, not a tradable win rate, and past pattern behavior does not guarantee future results. CRT performs poorly in consolidation even with the size filter, and the tool does not validate higher-timeframe directional bias - that remains your analysis. Not financial advice.

Open-source. Candle Range Theory / Power of 3 is a well-known community concept - nothing here claims to invent it. What is specific to this script is the validation pipeline (coherence, R:R, range-size, trading window, re-arm, sequential mode) and the resolved, repaint-free plan tracking. Feedback welcome.


--- Espanol ---

Dibuja la secuencia completa de Candle Range Theory: rango de la vela HTF cerrada (H4 por defecto), barrido de liquidez de un extremo, confirmacion por cierre de vuelta DENTRO del rango, y el plan completo de la operacion - entrada en la apertura siguiente, SL en la mecha del barrido (con buffer ATR configurable) y TP en el extremo opuesto.

  • Caja gris viva - rango HTF actual, con High (liquidez arriba), Low (liquidez abajo) y 50% dorado (iman).
  • Diamante BARRIDO - donde se tomo la liquidez; marca "PDH" / "ASIA" cuando ademas barrio un nivel clave.
  • BUY / SELL en la vela - CRT confirmado (contexto, no recomendacion).
  • Caja beige - zona de reward al TP; caja gris - zona de riesgo al SL. Cada plan se resuelve solo en el grafico y el panel acumula cuantos llegaron al 50% y al target.


Filtros de calidad: R:R minimo, coherencia de entrada, tamano minimo del rango (anti-consolidacion), ventana operativa (solo fase de manipulacion de la vela, vela de hora especifica, cupo diario), re-armado tras barrido mas profundo y modo "una operacion a la vez" para estadisticas honestas tipo cuenta real.

No repinta: datos HTF solo de velas cerradas y senales solo al cierre confirmado - lo que aparece, queda. El paso humano queda a proposito sin automatizar: el MSS/CHoCH y la entrada fina en tu temporalidad baja son tu decision. Herramienta de contexto y planificacion, no es recomendacion de compra/venta ni senal garantizada; el comportamiento pasado no garantiza resultados futuros. No es asesoramiento financiero.

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.