Estrategia con reglas definidas para la apertura de Nueva York (09:30 - 09:35 EST) en futuros MNQ/NQ que combina dirección en 5m con confirmación de volumen PVSRA en 1m, sin repintar y limitada a un trade diario.

Elimina el overtrading y las falsas entradas en la apertura de Wall Street limitando la operativa a una sola señal diaria confirmada al cierre de la vela de 09:30–09:35 NY, sin repintado y filtrada por presión institucional real.
Evalúa la primera vela de 5 minutos de la sesión regular de Nueva York (09:30 - 09:35 EST) en futuros de Nasdaq (MNQ/NQ) frente a un suavizado direccional adaptativo en 5m (dir_base). Al cierre confirmado de las 09:35, el motor escanea las 5 velas de 1 minuto dentro de esa ventana para verificar si existió una vela envolvente institucional PVSRA (pico de volumen >= 1.4x o volumen ponderado por rango máximo, cuerpo significativo > 0.5 ATR, mechas contenidas <= 40% y cierre dominante en el extremo <= 25%). Solo si la dirección en 5m y el filtro PVSRA de 1m coinciden, traza la caja de apertura, proyecta los niveles High/Low durante 45 minutos y dispara la señal única del día (BUY o SELL).
| Parámetro | Valor Sugerido | Descripción |
|---|---|---|
| Duración niveles (min) | 45 min | Minutos que se proyectan las líneas horizontales de máximo y mínimo tras las 09:35. |
| Máx mecha (% cuerpo) | 0.40 (40%) | Límite máximo permitido de mecha superior e inferior respecto al cuerpo de la vela PVSRA 1m. |
| Cierre dominante (% cuerpo) | 0.25 (25%) | Exige que la vela PVSRA cierre dentro del 25% superior (alcista) o inferior (bajista) de su rango total. |
| Periodo volumen | 10 velas | Ventana de SMA de volumen y máximo volumen ponderado para detectar actividad institucional. |
| Tamaño min. cuerpo (ATR %) | 0.5 ATR(14) | Filtra velas de poco desplazamiento exigiendo cuerpo superior al 50% del ATR de 14 periodos. |
//@version=6
// ─────────────────────────────────────────────────────────────────────────────
// Nasdaq futuros (MNQ / NQ) · Filtro Instituciona (1 Minuto)
// Sin repintar, un trade diario
// Registra tu Journal gratis en jlapro.com
// ─────────────────────────────────────────────────────────────────────────────
indicator('jlapro | NY NASDAQ + Filtro PVSRA (1m)', shorttitle = 'NASDAQ NY OPEN SESSION', overlay = true, max_boxes_count = 500, max_lines_count = 500, max_labels_count = 500)
const string TZ = 'America/New_York'
var string g1 = 'Vela de las 09:30 (NY)'
var string g2 = 'Estilo Apertura'
var string g3 = 'Parámetros Filtro PVSRA (1m)'
// ─── INPUTS APERTURA ───
show_history = input.bool(true, 'Días anteriores', group = g1)
show_levels = input.bool(true, 'Máximo y mínimo de la vela', group = g1)
levels_minutes = input.int(45, 'Duración de los niveles (min)', minval = 0, maxval = 390, group = g1)
col_buy = input.color(#34C759, 'Compra', group = g2)
col_sell = input.color(#FF3B30, 'Venta', group = g2)
col_accent = input.color(#0A84FF, 'Acento', group = g2)
// ─── INPUTS FILTRO PVSRA (SOLO MOTOR) ───
wickLimit = input.float(0.40, 'Máx mecha (% cuerpo)', step = 0.05, group = g3)
closeLimit = input.float(0.25, 'Cierre dominante (% cuerpo)', step = 0.05, group = g3)
volLen = input.int(10, 'Periodo volumen', group = g3)
minBodySize = input.float(0.5, 'Tamaño min. cuerpo (ATR %)', step = 0.1, group = g3)
// ── Tema: se adapta solo al fondo claro u oscuro del gráfico ──
lum(color c) => (0.2126 * color.r(c) + 0.7152 * color.g(c) + 0.0722 * color.b(c)) / 255.0
dark = lum(chart.bg_color) < 0.5
c_card = dark ? #1C1C1E : #FFFFFF
c_sub = dark ? #98989D : #86868B
c_level = dark ? #48484A : #C7C7CC
// ═════════════════════════════════════════════════════════════════════════════
// 1. MOTOR PVSRA EN 1 MINUTO (OCULTO - SOLO FILTRADO)
// ═════════════════════════════════════════════════════════════════════════════
avgVol = ta.sma(volume[1], volLen)
weightedVol = volume * (high - low)
maxWeightedVol = ta.highest(weightedVol[1], volLen)
atr = ta.atr(14)
avgBody = ta.sma(math.abs(close - open), 20)
isPVSRA = volume >= avgVol * 1.4 or weightedVol >= maxWeightedVol or math.abs(close - open) > avgBody * 2
isBull = close > open
bullEngulf = close > open and close > high[1] and close > open[1]
bearEngulf = close < open and close < low[1] and close < open[1]
upperWick = high - math.max(open, close)
lowerWick = math.min(open, close) - low
body = math.abs(close - open)
validWicks = upperWick <= body * wickLimit and lowerWick <= body * wickLimit
significantBody = body > (atr * minBodySize)
candleRange = high - low
closeStrength = candleRange > 0 ? (isBull ? (close >= high - candleRange * closeLimit) : (close <= low + candleRange * closeLimit)) : false
isEngulfing = (bullEngulf or bearEngulf) and validWicks and closeStrength and significantBody
condicionLogica = isPVSRA and isEngulfing
bool pvsraBull1m = condicionLogica and isBull
bool pvsraBear1m = condicionLogica and not isBull
// ═════════════════════════════════════════════════════════════════════════════
// 2. DATOS DE APERTURA NY (VELA 09:30 - 09:35 EN 5M)
// ═════════════════════════════════════════════════════════════════════════════
int tf_sec = timeframe.in_seconds()
bool low_tf = tf_sec <= 300
_k(float x) =>
var float _a = na
_a := na(_a) ? x : _a + (x - _a) * (4.0 / 26.0)
_a
[m5T, m5H, m5L, m5C, m5E] = request.security(syminfo.tickerid, '5', [time, high, low, close, _k(close)], lookahead = barmerge.lookahead_off)
ny0930(int t) => timestamp(TZ, year(t, TZ), month(t, TZ), dayofmonth(t, TZ), 9, 30)
keyOf(int t) => year(t, TZ) * 10000 + month(t, TZ) * 100 + dayofmonth(t, TZ)
int todayKey = keyOf(timenow)
int t0930 = ny0930(time)
int t0935 = t0930 + 5 * 60 * 1000
int dayKey = keyOf(t0930)
in_candle = tf_sec < 86400 and time >= t0930 and time < t0935 and (show_history or dayKey == todayKey)
bgcolor(in_candle ? color.new(col_accent, 92) : na, title = 'Sesión 09:30 - 09:35')
// ═════════════════════════════════════════════════════════════════════════════
// 3. EVALUACIÓN DE LAS 5 VELAS DE 1 MINUTO + SEÑAL FILTRADA
// ═════════════════════════════════════════════════════════════════════════════
bool found = false
float sH = na
float sL = na
float sC = na
float sE = na
if low_tf and barstate.isconfirmed and not na(m5E) and m5T == t0930 and time_close == t0935
found := true
sH := m5H
sL := m5L
sC := m5C
sE := m5E
bool tiene_pvsra_alcista = false
bool tiene_pvsra_bajista = false
if found
int barras_a_revisar = timeframe.period == '1' ? 4 : 0
for i = 0 to barras_a_revisar
if pvsraBull1m[i]
tiene_pvsra_alcista := true
if pvsraBear1m[i]
tiene_pvsra_bajista := true
var int ultimo_dia = 0
bool nueva = found and dayKey != ultimo_dia
int dir_base = sC > sE ? 1 : sC < sE ? -1 : 0
int dir_filtrada = 0
if dir_base == 1 and tiene_pvsra_alcista
dir_filtrada := 1
else if dir_base == -1 and tiene_pvsra_bajista
dir_filtrada := -1
else
dir_filtrada := 0
var int s_dir = 0
if nueva
ultimo_dia := dayKey
s_dir := dir_filtrada
if s_dir != 0 and (show_history or barstate.isrealtime or dayKey == todayKey)
c_dir = s_dir == 1 ? col_buy : col_sell
t_l = t0930
t_r = t0935
t_mid = int(math.avg(t_l, t_r))
t_end = t_r + levels_minutes * 60 * 1000
box.new(t_l, sH, t_r, sL, xloc = xloc.bar_time, border_color = color.new(c_dir, 92), border_width = 14, bgcolor = na)
box.new(t_l, sH, t_r, sL, xloc = xloc.bar_time, border_color = color.new(c_dir, 84), border_width = 8, bgcolor = na)
box.new(t_l, sH, t_r, sL, xloc = xloc.bar_time, border_color = color.new(c_dir, 68), border_width = 4, bgcolor = na)
box.new(t_l, sH, t_r, sL, xloc = xloc.bar_time, border_color = color.new(c_dir, 20), border_width = 1, bgcolor = color.new(c_dir, 86))
if show_levels and levels_minutes > 0
line.new(t_r, sH, t_end, sH, xloc = xloc.bar_time, extend = extend.none, color = c_level, style = line.style_solid, width = 1)
line.new(t_r, sL, t_end, sL, xloc = xloc.bar_time, extend = extend.none, color = c_level, style = line.style_solid, width = 1)
label.new(t_mid, s_dir == -1 ? sL : sH, '09:30', xloc = xloc.bar_time, color = color.new(c_card, 100), style = s_dir == -1 ? label.style_label_up : label.style_label_down, textcolor = c_sub, size = size.small)
txt = s_dir == 1 ? 'BUY' : 'SELL'
label.new(time, s_dir == -1 ? math.max(sH, high) : math.min(sL, low), txt, xloc = xloc.bar_time, color = c_dir, style = s_dir == -1 ? label.style_label_down : label.style_label_up, textcolor = #FFFFFF, size = size.normal)
alert('1ª vela de NY confirmada con PVSRA: ' + (s_dir == 1 ? 'COMPRA' : 'VENTA'), alert.freq_once_per_bar_close)
alertcondition(nueva and dir_filtrada == 1, 'BUY', '1ª vela de NY: COMPRA confirmada por PVSRA en {{exchange}}:{{ticker}}')
alertcondition(nueva and dir_filtrada == -1, 'SELL', '1ª vela de NY: VENTA confirmada por PVSRA en {{exchange}}:{{ticker}}')
//---------------------------------------------------------------------------------------------------------------------}
// Watermark / Branding Badge (Customized to match chart theme)
//---------------------------------------------------------------------------------------------------------------------{
string BRAND_GROUP = '⚡ Branding'
color BRAND_GOLD = #089981 // Cambiado a verde turquesa para hacer match con tus velas de TradingView
color BRAND_DEEP = color.new(#131722, 10) // Fondo oscuro neutro estilo TradingView
showBrand = input.bool(true, "Show Watermark", group = BRAND_GROUP, tooltip = "Display the brand badge on the chart.")
brandPos = input.string("Top Center", "Watermark Position", options = ["Bottom Center", "Top Center"], group = BRAND_GROUP)
var table brandTag = table.new(brandPos == "Top Center" ? position.top_center : position.bottom_center, 1, 1, bgcolor = BRAND_DEEP, border_width = 1, frame_color = color.new(BRAND_GOLD, 50), frame_width = 1, force_overlay = true)
if barstate.islast and showBrand
brandTag.cell(0, 0, " ⚡ JLAPRO · OPEN SESSION STRATEGY ⚡ ", text_color = BRAND_GOLD, text_size = size.normal, text_halign = text.align_center)
//---------------------------------------------------------------------------------------------------------------------}
// Watermark / www.jlapro.com
//---------------------------------------------------------------------------------------------------------------------{
var string inp_wm_text = "www.jlapro.com\n___"
var color inp_wm_color = color.rgb(107, 107, 107, 75) // Gris semitransparente
var string inp_wm_size = size.huge // Tamaño gigante
// Crear tabla de 1x1 centrada en la pantalla
var table tbl_watermark = table.new(position.middle_center, 1, 1, border_width = 0)
// Dibujar el texto solo en el último bar
if barstate.islast
table.cell(tbl_watermark, 0, 0, inp_wm_text, text_color = inp_wm_color, text_size = inp_wm_size)