Manual de uso y guía de estudio.
Momentum + Estructura + VWAP + Liquidez + Confirmación + Riesgo
Diseñado para lectura intradía de XAUUSD y adaptación a otros mercados.
Principios ATC: Precisión > frecuencia , Evidencia > predicción , Proceso > resultado
1. ¿Qué es el ATC Radar Institucional?
Una herramienta de lectura, no una máquina de señales
El ATC Radar Institucional organiza varias capas de evidencia en un solo gráfico. Su objetivo es responder, en orden, seis preguntas: ¿qué dirección domina?, ¿qué está haciendo el momentum?, ¿dónde está el precio respecto al valor ponderado?, ¿dónde está la liquidez?, ¿la estructura confirma? y ¿el riesgo permite operar?
| Capa | Herramienta | Pregunta |
| Momentum táctico | Set A: EMA 9/21 | ¿Qué está cambiando ahora? |
| Estructura intradía | Set B: EMA 50/100 | ¿Cuál es la dirección dominante? |
| Valor | VWAP | ¿Precio por encima o debajo del valor ponderado? |
| Liquidez | Asia / Londres / NY H-L | ¿Dónde pueden estar los stops y objetivos? |
| Estructura | BOS / CHOCH-MSS | ¿El precio confirmó el cambio? |
| Ejecución | FVG / OB + RR + ATR | ¿Existe una entrada defendible? |
Nunca convertir una sola señal en una operación. El valor del Radar aparece cuando varias evidencias independientes convergen.

2. Anatomía del gráfico
Lectura visual de la versión consolidada

En la captura se observan simultáneamente el precio, las cuatro EMAs, VWAP, cruces A/B, panel MTF, volumen y niveles de sesión. El objetivo no es mirar todo al mismo tiempo: se lee por capas.
- Primero: Set B 50/100 para establecer la estructura dominante.
- Segundo: Set A 9/21 para identificar aceleración, corrección o giro táctico.
- Tercero: VWAP para ubicar el precio respecto al valor ponderado de la sesión.
- Cuarto: máximos y mínimos de sesiones previas para localizar liquidez.
- Quinto: estructura, volumen y zonas FVG/OB para confirmar.
3. Set A — EMA 9/21 (los periodos pueden ser cambiados)
La capa rápida: momentum táctico
Las EMA 9 y 21 reaccionan relativamente rápido al precio. Por eso el Set A sirve para detectar cambios de momentum antes que el Set B.
| Situación | Lectura sencilla | Uso |
| EMA 9 > EMA 21 | Momentum alcista | Buscar confirmaciones de compra, no comprar automáticamente. |
| EMA 9 < EMA 21 | Momentum bajista | Buscar confirmaciones de venta, no vender automáticamente. |
| Cruce ▲ Alcista A | Cambio táctico hacia arriba | Puede ser inicio de impulso o solo corrección. |
| Cruce ▼ Bajista A | Cambio táctico hacia abajo | Puede ser inicio de caída o solo retroceso. |
| A = rápido. Detecta antes, pero también produce más señales falsas. | ||
Ejemplo fácil
Si Set B sigue alcista y aparece ▼ Bajista A, la lectura inicial no es ‘vender’. Es: el mercado alcista está corrigiendo. Esperamos ver si esa corrección rompe estructura o si encuentra soporte y retoma la tendencia.

4. Set B — EMA 50/100 (los periodos pueden ser cambiados)
La capa lenta: estructura intradía
Las EMA 50 y 100 filtran más ruido. Sus cruces son menos frecuentes y representan cambios más estructurales. En el gráfico se distinguen visualmente del Set A.
| Situación | Interpretación |
| EMA 50 > EMA 100 | Estructura intradía predominantemente alcista |
| EMA 50 < EMA 100 | Estructura intradía predominantemente bajista |
| ▲ Alcista B | Confirmación estructural alcista más lenta |
| ▼ Bajista B | Confirmación estructural bajista más lenta |
| B = contexto estructural. No necesariamente da la entrada; ayuda a decidir qué señales A merecen atención. | |
Set A puede cruzar varias veces mientras Set B conserva la misma dirección. Eso es normal: A describe oscilaciones tácticas dentro de una estructura más lenta.
5. Matriz A × B
La lectura más importante del indicador
| Set A 9/21 | Set B 50/100 | Lectura ATC | Conducta |
| 🟢 Alcista | 🟢 Alcista | Impulso alcista alineado | Priorizar largos con confirmación. |
| 🔴 Bajista | 🔴 Bajista | Impulso bajista alineado | Priorizar cortos con confirmación. |
| 🟢 Alcista | 🔴 Bajista | Corrección alcista en estructura bajista | Cuidado con comprar tarde. |
| 🔴 Bajista | 🟢 Alcista | Corrección bajista en estructura alcista | Cuidado con vender tarde. |
| Alineación A+B aumenta coherencia; divergencia A/B describe transición o corrección. | |||
Imagine un automóvil: Set B indica la carretera por la que viaja; Set A indica si en este momento acelera o frena. Frenar en una carretera ascendente no significa necesariamente que el viaje cambió de dirección.
6. VWAP
El eje de valor ponderado por volumen
VWAP significa Volume Weighted Average Price. Resume el precio medio de la sesión ponderando por volumen. En el Radar se utiliza como referencia de valor y como filtro adicional.
| Precio vs VWAP | Lectura |
| Precio sobre VWAP | Sesgo táctico favorable a compradores |
| Precio bajo VWAP | Sesgo táctico favorable a vendedores |
| Cruces repetidos de VWAP | Equilibrio / rango / baja claridad |
| Rechazo claro en VWAP | VWAP actuando como referencia dinámica |
| VWAP confirma contexto; no sustituye estructura. | |
Ejemplo
A y B están alcistas, pero el precio cae bajo VWAP. La tendencia puede seguir siendo alcista, pero la ejecución perdió calidad. Esperar recuperación y aceptación sobre VWAP suele ser más disciplinado que comprar inmediatamente.

7. Cruces A y B
El marcador representa el evento técnico.
Los marcadores se anclan al nivel aproximado donde las dos EMAs coinciden en la vela que confirma el cruce. Así el evento visual se relaciona con las medias, no con la altura de la vela.
| Marcador | Significado |
| ▲ Alcista A | EMA 9 cruza sobre EMA 21 |
| ▼ Bajista A | EMA 9 cruza bajo EMA 21 |
| ▲ Alcista B | EMA 50 cruza sobre EMA 100 |
| ▼ Bajista B | EMA 50 cruza bajo EMA 100 |
| ▲ verde NO significa ‘BUY’. ▼ rojo NO significa ‘SELL’. Significa: ocurrió un cambio observable; ahora buscamos confirmación. | |
El marcador queda anclado al evento EMA/EMA, pero las EMAs siguen dependiendo del timeframe. Un cruce M15 no equivale a un cruce H1. Siempre leer el timeframe activo y el panel MTF.
8. Panel MTF
D1 → H4 → H1 → M15 → Actual
MTF significa Multi-Timeframe. El panel resume la dirección de los Set A y B en varios marcos temporales y muestra una medida relativa de separación/fuerza.
| TF | Función didáctica |
| D1 | Contexto mayor |
| H4 | Estructura swing |
| H1 | Sesgo intradía |
| M15 | Ejecución / transición |
| Actual | Lectura inmediata del gráfico |
Si tres de cuatro marcos están bajistas, el sesgo MTF es bajista. No significa certeza; significa predominio de evidencia
No necesitamos unanimidad. Necesitamos saber dónde está el desacuerdo y qué timeframe lo está produciendo..
9. Liquidez de sesiones
Asia, Londres y Nueva York
El Radar conserva los máximos y mínimos de las últimas sesiones completas. Estos niveles funcionan como referencias de liquidez porque alrededor de máximos y mínimos visibles suelen concentrarse órdenes.
| Nivel | Lectura habitual |
| Asia H | Liquidez compradora potencial sobre el máximo asiático |
| Asia L | Liquidez vendedora potencial bajo el mínimo asiático |
| London H | Referencia importante para expansión hacia NY |
| London L | Referencia importante para barridos/rechazos |
| NY H | Liquidez sobre el máximo de NY previo |
| NY L | Liquidez bajo el mínimo de NY previo |
BSL (Buy-Side Liquidity) suele referirse a liquidez por encima de máximos. SSL (Sell-Side Liquidity) suele referirse a liquidez por debajo de mínimos.
Un nivel de liquidez es un lugar para observar comportamiento, no una orden automática.

10. Sweep vs Breakout
Dos comportamientos que un principiante debe distinguir
| Comportamiento | Qué ocurre | Lectura |
| Sweep / barrido | El precio perfora el nivel y vuelve a cerrar dentro | Posible captura de liquidez y rechazo. |
| Breakout / ruptura | El precio rompe y logra aceptación fuera del nivel | Posible continuación. |
London H está en 4,180. El precio sube a 4,182 pero cierra nuevamente en 4,178: eso se parece a un sweep. Si rompe 4,180, consolida arriba y vuelve a defenderlo, se parece más a aceptación/continuación.
La mecha por sí sola no basta. Observe cierre, estructura posterior, volumen y reacción en VWAP/FVG/OB.
11. Estructura: BOS, CHOCH y MSS
El precio debe demostrar, no solo insinuar
| Término | Definición para principiantes | Pregunta |
| BOS | Break of Structure: ruptura de una estructura previa en la dirección dominante. | ¿La tendencia continuó? |
| CHOCH | Change of Character: cambio inicial en el comportamiento estructural. | ¿Algo empezó a cambiar? |
| MSS | Market Structure Shift: desplazamiento que confirma un cambio estructural relevante. | ¿El cambio tiene suficiente evidencia? |
En la práctica, la nomenclatura puede variar entre metodologías. En ATC interesa más la evidencia objetiva: qué máximo/mínimo fue roto, con qué desplazamiento y qué ocurrió después.
Cruce EMA + ruptura estructural es más informativo que cruce EMA aislado.
12. FVG y OB
Zonas de interés para la ejecución
| Término | Explicación sencilla | Uso |
| FVG | Fair Value Gap: desequilibrio dejado por un desplazamiento rápido. | Zona donde el precio puede regresar a reequilibrar. |
| OB | Order Block: zona estructural asociada al origen de un desplazamiento. | Área de reacción potencial; requiere contexto. |
Liquidez barrida → desplazamiento → cambio estructural → regreso a FVG/OB → confirmación con A/B y VWAP. Esta secuencia es mucho más robusta que entrar solo porque apareció un triángulo.
FVG y OB son zonas, no garantías.

13. Volumen, ATR y RR
Tres filtros para evitar buenas ideas en malas condiciones
| Concepto | Qué mide | Uso ATC |
| Volumen | Participación negociada | Ayuda a validar expansión o agotamiento. |
| ATR | Rango verdadero promedio | Indica régimen de volatilidad; no dirección. |
| RR | Reward/Risk | Compara recompensa potencial contra riesgo asumido. |
Un setup puede tener buena dirección y mala ejecución. Si el stop necesario es demasiado amplio o el objetivo razonable no permite RR suficientes, se descarta.
Regla operativa ATC: RR objetivo ≥ 1.5 cuando la estructura permite definirlo de forma coherente.
Si arriesgar 10 unidades permite aspirar razonablemente a 15 o más, RR ≥ 1.5. Si para evitar ruido el stop necesita 20 pero el siguiente objetivo está a 15, la operación pierde calidad aunque el sesgo sea correcto.

14. Secuencia operativa ATC
CONTEXTO → ESTRUCTURA → MOMENTUM → VWAP → LIQUIDEZ → CONFIRMACIÓN → RIESGO
- CONTEXTO: leer D1/H4/H1 y Set B. Definir si el mercado está alcista, bajista o mixto.
- ESTRUCTURA: identificar swings, BOS/CHOCH/MSS y rango operativo.
- MOMENTUM: observar Set A y si acelera a favor o contra Set B.
- VWAP: comprobar dónde opera el precio respecto al valor ponderado.
- LIQUIDEZ: marcar Asia/Londres/NY H-L y otros EQH/EQL relevantes.
- CONFIRMACIÓN: buscar desplazamiento, volumen, FVG/OB y reacción.
- RIESGO: definir invalidación, stop, objetivo y RR antes de ejecutar.
Si una capa crítica contradice la hipótesis, no se fuerza la operación.
15. Checklist de 30 segundos
Antes de hacer clic
| ✓ | Pregunta |
| □ | ¿Set B define una estructura clara? |
| □ | ¿Set A está alineado o sé que estoy operando una corrección? |
| □ | ¿El precio está del lado correcto del VWAP para mi hipótesis? |
| □ | ¿Sé qué liquidez está buscando el precio? |
| □ | ¿Hubo BOS / CHOCH / MSS o desplazamiento válido? |
| □ | ¿Existe FVG/OB o zona técnica defendible para ejecución? |
| □ | ¿Volumen/ATR permiten operar sin perseguir precio? |
| □ | ¿Stop e invalidación son estructurales, no emocionales? |
| □ | ¿RR es al menos 1.5? |
| □ | ¿Estoy entrando antes de que el movimiento ya esté extendido? |
| Una respuesta ‘no sé’ cuenta como NO. La ausencia de claridad es información. | |
16. Calificación del setup
A+ / A / B / NO TRADE
| Grado | Características | Acción |
| A+ | A+B alineados, VWAP favorable, liquidez clara, estructura confirmada, entrada limpia, RR sólido. | Setup prioritario. |
| A | Mayoría de capas alineadas; una condición secundaria imperfecta. | Operable con disciplina. |
| B | Contexto razonable pero transición, confirmación débil o RR justo. | Esperar mejora / reducir interés. |
| NO TRADE | Contradicciones importantes, rango confuso, entrada tardía o riesgo mal definido. | No operar. |
La calificación no pretende predecir el resultado de una operación individual. Evalúa la calidad del proceso y de la evidencia disponible antes de entrar.
17. Casos prácticos fáciles
Aprender a narrar el gráfico
| Caso | Lectura paso a paso |
| 1. A alcista + B alcista + sobre VWAP | Contexto favorable. Buscar liquidez objetivo y confirmación estructural antes del largo. |
| 2. A bajista + B alcista | Probable corrección bajista dentro de estructura alcista. No vender tarde; observar soporte/liquidez y posible reanudación. |
| 3. A alcista + B bajista | Rebote/corrección contra estructura bajista. Comprar exige evidencia excepcional; vigilar rechazo en VWAP/OB. |
| 4. A bajista + B bajista + bajo VWAP | Contexto bajista alineado. Esperar pullback/confirmación; no perseguir una vela ya extendida. |
| 5. Sweep de London H + A gira bajista | Posible rechazo. Confirmar MSS/BOS, VWAP y espacio hasta siguiente liquidez antes de considerar corto. |
| El objetivo del alumno es poder contar la historia del mercado en una frase antes de pensar en una entrada. | |

Glosario para principiantes
Referencia rápida
| Término | Definición |
| EMA | Exponential Moving Average. Media móvil que da más peso a datos recientes. |
| VWAP | Volume Weighted Average Price. Precio medio ponderado por volumen. |
| Momentum | Velocidad y dirección inmediata del movimiento. |
| Estructura | Secuencia de máximos y mínimos que organiza la tendencia. |
| Timeframe / TF | Marco temporal de cada vela: M15, H1, H4, D1, etc. |
| MTF | Multi-Timeframe. Lectura simultánea de varios marcos temporales. |
| BOS | Break of Structure. Ruptura de estructura. |
| CHOCH | Change of Character. Cambio inicial del carácter estructural. |
| MSS | Market Structure Shift. Cambio estructural con desplazamiento. |
| Liquidity / Liquidez | Zonas donde pueden concentrarse órdenes y stops. |
| BSL | Buy-Side Liquidity. Liquidez normalmente situada sobre máximos. |
| SSL | Sell-Side Liquidity. Liquidez normalmente situada bajo mínimos. |
| Sweep | Barrido de un nivel seguido de rechazo/retorno. |
| FVG | Fair Value Gap. Desequilibrio de precio dejado por desplazamiento. |
| OB | Order Block. Zona asociada al origen de un desplazamiento. |
| ATR | Average True Range. Medida de volatilidad/rango. |
| RR | Reward/Risk. Relación entre beneficio potencial y riesgo. |
| Sesgo | Hipótesis direccional basada en evidencia. |
| Pullback | Retroceso dentro de un movimiento mayor. |
| Breakout | Ruptura con posible aceptación fuera de un rango/nivel. |
18. Errores frecuentes y reglas finales
Qué evitar cuando el gráfico se ve convincente
- Comprar únicamente porque apareció ▲ Alcista A.
- Vender únicamente porque apareció ▼ Bajista B.
- Confundir una corrección de Set A con reversión estructural de Set B.
- Ignorar VWAP cuando el precio está oscilando repetidamente alrededor de él.
- Tratar un High/Low de sesión como soporte/resistencia garantizado.
- Entrar después de una expansión grande sin esperar retroceso o nueva estructura.
- Mover el stop porque ‘seguro regresa’. La invalidación debe definirse antes.
- Buscar unanimidad absoluta entre todos los timeframes.
- Sobreoperar cuando ATR/volumen muestran condiciones pobres.
- Evaluar el método por una sola operación en vez de por una muestra de ejecuciones disciplinadas.
Abra un gráfico M15 sin operar. En voz alta o por escrito complete: (1) Set B dice…, (2) Set A dice…, (3) VWAP dice…, (4) la liquidez más cercana está…, (5) la estructura confirma/no confirma…, (6) por tanto mi decisión es… Esperar también es una decisión.
Anexo- Script para Pine
//@version=6indicator("ATC - Radar Institucional - Mercado Global Sesiones XAUUSD", overlay=true, max_labels_count=500, max_lines_count=500)//=====================================================================// ATC RADAR INSTITUCIONAL// Pine Script v6//// SET A 9/21 = Momentum tactico// SET B 50/100 = Estructura intradia// VWAP = Precio medio ponderado//// IMPORTANTE:// EMAs + VWAP se dibujan directamente SOBRE EL PRECIO.//=====================================================================//=====================================================================// 01. INPUTS GENERALES//=====================================================================showPanelEMAs = input.bool( true, "Panel EMAs MTF A/B", group="01 - Paneles" )showPanelSMR = input.bool( false, "Panel SMR", group="01 - Paneles" )showPanelSMC = input.bool( false, "Panel SMC Institucional", group="01 - Paneles" )//=====================================================================// 02. EMAs SET A//=====================================================================showEMAsA = input.bool( true, "Mostrar Set A", group="02 - EMA Set A" )emaShortALen = input.int( 9, "EMA corta A", minval=1, group="02 - EMA Set A" )emaLongALen = input.int( 21, "EMA larga A", minval=1, group="02 - EMA Set A" )emaShortAColor = input.color( color.lime, "Color corta A", group="02 - EMA Set A", inline="A" )emaLongAColor = input.color( color.orange, "Color larga A", group="02 - EMA Set A", inline="A" )emaAWidth = input.int( 2, "Grosor A", minval=1, maxval=5, group="02 - EMA Set A" )//=====================================================================// 03. EMAs SET B//=====================================================================showEMAsB = input.bool( true, "Mostrar Set B", group="03 - EMA Set B" )emaShortBLen = input.int( 50, "EMA corta B", minval=1, group="03 - EMA Set B" )emaLongBLen = input.int( 100, "EMA larga B", minval=1, group="03 - EMA Set B" )emaShortBColor = input.color( color.lime, "Color corta B", group="03 - EMA Set B", inline="B" )emaLongBColor = input.color( color.orange, "Color larga B", group="03 - EMA Set B", inline="B" )emaBWidth = input.int( 2, "Grosor B", minval=1, maxval=5, group="03 - EMA Set B" )//=====================================================================// 04. VWAP//=====================================================================showVWAP = input.bool( true, "Mostrar VWAP", group="04 - VWAP" )vwapColor = input.color( color.purple, "Color VWAP", group="04 - VWAP" )vwapWidth = input.int( 2, "Grosor VWAP", minval=1, maxval=5, group="04 - VWAP" )//=====================================================================// 05. CRUCES//=====================================================================showCrossA = input.bool( true, "Mostrar cruces Set A", group="05 - Cruces" )showCrossB = input.bool( true, "Mostrar cruces Set B", group="05 - Cruces" )mostrarSoloUltimosCruces = input.bool( true, "Solo ultimos cruces A/B", group="05 - Cruces", tooltip="Activado: solo ultimo cruce alcista y bajista de cada Set. Desactivado: todos los cruces." )//=====================================================================// 06. ALERTAS//=====================================================================alertEmaCrossA = input.bool( true, "Alertas cruces Set A", group="06 - Alertas" )alertEmaCrossB = input.bool( true, "Alertas cruces Set B", group="06 - Alertas" )alertVwapCross = input.bool( true, "Alertas cruces VWAP", group="06 - Alertas" )alertRequireBias = input.bool( false, "Requerir sesgo institucional", group="06 - Alertas" )alertRequireATR = input.bool( false, "Requerir ATR operativo", group="06 - Alertas" )//=====================================================================// 07. TRH//=====================================================================syncTRHwithPanel = input.bool( true, "Sincronizar TRH con Sesgo Institucional", group="07 - Integracion TRH" )minTFbias = input.int( 3, "Minimo TFs a favor", minval=1, maxval=4, group="07 - Integracion TRH" )requireVWAP = input.bool( true, "Requerir Sesgo VWAP a favor", group="07 - Integracion TRH" )//=====================================================================// 08. CALCULO EMAs + VWAP//=====================================================================emaShortA = ta.ema(close, emaShortALen)emaLongA = ta.ema(close, emaLongALen)emaShortB = ta.ema(close, emaShortBLen)emaLongB = ta.ema(close, emaLongBLen)vwapLine = ta.vwap// Alias de compatibilidademaShort = emaShortAemaLong = emaLongAemaShortLen = emaShortALenemaLongLen = emaLongALen//=====================================================================// 09. DIBUJO SOBRE EL GRAFICO PRINCIPAL//=====================================================================// SET A - CONTINUASplot( showEMAsA ? emaShortA : na, title="EMA corta A", color=emaShortAColor, linewidth=emaAWidth, style=plot.style_line )plot( showEMAsA ? emaLongA : na, title="EMA larga A", color=emaLongAColor, linewidth=emaAWidth, style=plot.style_line )// SET B - PUNTEADAS VISUALES// plot.style_circles mantiene el Set B claramente distinguible.plot( showEMAsB ? emaShortB : na, title="EMA corta B", color=emaShortBColor, linewidth=emaBWidth, style=plot.style_circles )plot( showEMAsB ? emaLongB : na, title="EMA larga B", color=emaLongBColor, linewidth=emaBWidth, style=plot.style_circles )// VWAP - CONTINUAplot( showVWAP ? vwapLine : na, title="VWAP", color=vwapColor, linewidth=vwapWidth, style=plot.style_line )//=====================================================================// 10. DETECCION DE CRUCES//=====================================================================cruceAlcistaA = ta.crossover(emaShortA, emaLongA)cruceBajistaA = ta.crossunder(emaShortA, emaLongA)cruceAlcistaB = ta.crossover(emaShortB, emaLongB)cruceBajistaB = ta.crossunder(emaShortB, emaLongB)cruceVWAPup = ta.crossover(close, vwapLine)cruceVWAPdown = ta.crossunder(close, vwapLine)//=====================================================================// 11. ULTIMOS CRUCES SET A - ANCLADOS AL PRECIO DE LAS EMAs//=====================================================================var label ultimoCruceAlcistaA = navar label ultimoCruceBajistaA = na// Nivel visual del evento A.// En la vela donde Pine confirma el crossover/crossunder,// usamos el punto medio entre EMA 9 y EMA 21.precioCruceA = (emaShortA + emaLongA) / 2if cruceAlcistaA and mostrarSoloUltimosCruces if not na(ultimoCruceAlcistaA) label.delete(ultimoCruceAlcistaA) if showCrossA ultimoCruceAlcistaA := label.new( bar_index, precioCruceA, "▲ Alcista A", xloc=xloc.bar_index, yloc=yloc.price, style=label.style_none, textcolor=color.lime, size=size.normal )if cruceBajistaA and mostrarSoloUltimosCruces if not na(ultimoCruceBajistaA) label.delete(ultimoCruceBajistaA) if showCrossA ultimoCruceBajistaA := label.new( bar_index, precioCruceA, "▼ Bajista A", xloc=xloc.bar_index, yloc=yloc.price, style=label.style_none, textcolor=color.red, size=size.normal )//=====================================================================// 12. ULTIMOS CRUCES SET B - ANCLADOS AL PRECIO DE LAS EMAs//=====================================================================var label ultimoCruceAlcistaB = navar label ultimoCruceBajistaB = na// Nivel visual del evento B.// En la vela donde Pine confirma el crossover/crossunder,// usamos el punto medio entre EMA 50 y EMA 100.precioCruceB = (emaShortB + emaLongB) / 2if cruceAlcistaB and mostrarSoloUltimosCruces if not na(ultimoCruceAlcistaB) label.delete(ultimoCruceAlcistaB) if showCrossB ultimoCruceAlcistaB := label.new( bar_index, precioCruceB, "▲ Alcista B", xloc=xloc.bar_index, yloc=yloc.price, style=label.style_none, textcolor=color.lime, size=size.normal )if cruceBajistaB and mostrarSoloUltimosCruces if not na(ultimoCruceBajistaB) label.delete(ultimoCruceBajistaB) if showCrossB ultimoCruceBajistaB := label.new( bar_index, precioCruceB, "▼ Bajista B", xloc=xloc.bar_index, yloc=yloc.price, style=label.style_none, textcolor=color.red, size=size.normal )//=====================================================================// 13. TODOS LOS CRUCES - ANCLADOS AL EVENTO EMA/EMA//=====================================================================plotshape( showCrossA and not mostrarSoloUltimosCruces and cruceAlcistaA ? precioCruceA : na, title="Alcista A Historico", style=shape.triangleup, location=location.absolute, color=color.lime, size=size.normal, text="Alcista A", textcolor=color.lime )plotshape( showCrossA and not mostrarSoloUltimosCruces and cruceBajistaA ? precioCruceA : na, title="Bajista A Historico", style=shape.triangledown, location=location.absolute, color=color.red, size=size.normal, text="Bajista A", textcolor=color.red )plotshape( showCrossB and not mostrarSoloUltimosCruces and cruceAlcistaB ? precioCruceB : na, title="Alcista B Historico", style=shape.triangleup, location=location.absolute, color=color.lime, size=size.normal, text="Alcista B", textcolor=color.lime )plotshape( showCrossB and not mostrarSoloUltimosCruces and cruceBajistaB ? precioCruceB : na, title="Bajista B Historico", style=shape.triangledown, location=location.absolute, color=color.red, size=size.normal, text="Bajista B", textcolor=color.red )//=====================================================================// 14. LIMPIEZA CRUCES//=====================================================================if not showCrossA or not mostrarSoloUltimosCruces if not na(ultimoCruceAlcistaA) label.delete(ultimoCruceAlcistaA) ultimoCruceAlcistaA := na if not na(ultimoCruceBajistaA) label.delete(ultimoCruceBajistaA) ultimoCruceBajistaA := naif not showCrossB or not mostrarSoloUltimosCruces if not na(ultimoCruceAlcistaB) label.delete(ultimoCruceAlcistaB) ultimoCruceAlcistaB := na if not na(ultimoCruceBajistaB) label.delete(ultimoCruceBajistaB) ultimoCruceBajistaB := na//=====================================================================// 15. PANEL EMA MTF A/B//=====================================================================diff = math.abs(emaShortA - emaLongA)maxDiff = ta.highest(diff, 200)intensity = maxDiff == 0.0 ? 0.0 : diff / maxDifffuerzaPct = math.round(intensity * 100)tendencia = emaShortA > emaLongA ? "Alcista" : emaShortA < emaLongA ? "Bajista" : "Neutral"tendenciaB = emaShortB > emaLongB ? "Alcista" : emaShortB < emaLongB ? "Bajista" : "Neutral"vwapEstado = close > vwapLine ? "Sobre VWAP" : close < vwapLine ? "Bajo VWAP" : "En VWAP"colorActual = emaShortA > emaLongA ? color.lime : emaShortA < emaLongA ? color.red : color.yellowcolorActualB = emaShortB > emaLongB ? color.lime : emaShortB < emaLongB ? color.red : color.yellowcolorVWAP = close > vwapLine ? color.lime : close < vwapLine ? color.red : color.yellowfuerzaIcon = fuerzaPct >= 66 ? "🟢" : fuerzaPct >= 33 ? "🟡" : "🔴"//=====================================================================// 16. FUNCION MTF//=====================================================================f_tfData(tf, shortLen, longLen) => emaS = request.security( syminfo.tickerid, tf, ta.ema(close, shortLen) ) emaL = request.security( syminfo.tickerid, tf, ta.ema(close, longLen) ) d = math.abs(emaS - emaL) maxD = request.security( syminfo.tickerid, tf, ta.highest( math.abs( ta.ema(close, shortLen) - ta.ema(close, longLen) ), 200 ) ) inten = maxD == 0.0 ? 0.0 : d / maxD fuerza = math.round(inten * 100) tend = emaS > emaL ? "Alcista" : emaS < emaL ? "Bajista" : "Neutral" col = emaS > emaL ? color.lime : emaS < emaL ? color.red : color.yellow icon = fuerza >= 66 ? "🟢" : fuerza >= 33 ? "🟡" : "🔴" [tend, fuerza, col, icon]// SET A[d1TA, d1FA, d1CA, d1IA] = f_tfData("D", emaShortALen, emaLongALen)[h4TA, h4FA, h4CA, h4IA] = f_tfData("240", emaShortALen, emaLongALen)[h1TA, h1FA, h1CA, h1IA] = f_tfData("60", emaShortALen, emaLongALen)[m15TA, m15FA, m15CA, m15IA] = f_tfData("15", emaShortALen, emaLongALen)// SET B[d1TB, d1FB, d1CB, d1IB] = f_tfData("D", emaShortBLen, emaLongBLen)[h4TB, h4FB, h4CB, h4IB] = f_tfData("240", emaShortBLen, emaLongBLen)[h1TB, h1FB, h1CB, h1IB] = f_tfData("60", emaShortBLen, emaLongBLen)[m15TB, m15FB, m15CB, m15IB] = f_tfData("15", emaShortBLen, emaLongBLen)// Aliasd1T = d1TAh4T = h4TAh1T = h1TAm15T = m15TA//=====================================================================// 17. SESGO GENERAL//=====================================================================alcistas = (d1TA == "Alcista" ? 1 : 0) + (h4TA == "Alcista" ? 1 : 0) + (h1TA == "Alcista" ? 1 : 0) + (m15TA == "Alcista" ? 1 : 0)bajistas = (d1TA == "Bajista" ? 1 : 0) + (h4TA == "Bajista" ? 1 : 0) + (h1TA == "Bajista" ? 1 : 0) + (m15TA == "Bajista" ? 1 : 0)alcistasB = (d1TB == "Alcista" ? 1 : 0) + (h4TB == "Alcista" ? 1 : 0) + (h1TB == "Alcista" ? 1 : 0) + (m15TB == "Alcista" ? 1 : 0)bajistasB = (d1TB == "Bajista" ? 1 : 0) + (h4TB == "Bajista" ? 1 : 0) + (h1TB == "Bajista" ? 1 : 0) + (m15TB == "Bajista" ? 1 : 0)sesgoGeneral = alcistas > bajistas ? "🟢 Alcista " + str.tostring(alcistas) + "/4 TF" : bajistas > alcistas ? "🔴 Bajista " + str.tostring(bajistas) + "/4 TF" : "🟡 Mixto"sesgoGeneralB = alcistasB > bajistasB ? "🟢 Alcista " + str.tostring(alcistasB) + "/4 TF" : bajistasB > alcistasB ? "🔴 Bajista " + str.tostring(bajistasB) + "/4 TF" : "🟡 Mixto"sesgoColor = alcistas > bajistas ? color.lime : bajistas > alcistas ? color.red : color.yellowsesgoColorB = alcistasB > bajistasB ? color.lime : bajistasB > alcistasB ? color.red : color.yellowlecturaAB = tendencia == tendenciaB ? "A/B alineados" : tendencia == "Alcista" and tendenciaB == "Bajista" ? "Correccion alcista / estructura bajista" : tendencia == "Bajista" and tendenciaB == "Alcista" ? "Correccion bajista / estructura alcista" : "A/B mixtos"lecturaABColor = tendencia == tendenciaB ? color.lime : color.orange//=====================================================================// 18. PANEL A/B//=====================================================================panelBgGreenSoft = color.new(color.rgb(0,60,40), 60)panelBgGreenHard = color.new(color.rgb(0,60,40), 40)panelTextColor = color.whitevar table infoPanel = table.new( position.bottom_left, 3, 8 )if barstate.islast if showPanelEMAs table.cell(infoPanel, 0, 0, "TF", text_color=color.white, bgcolor=panelBgGreenHard) table.cell( infoPanel, 1, 0, "SET A " + str.tostring(emaShortALen) + "/" + str.tostring(emaLongALen) + "\nMomentum", text_color=color.white, bgcolor=panelBgGreenHard ) table.cell( infoPanel, 2, 0, "SET B " + str.tostring(emaShortBLen) + "/" + str.tostring(emaLongBLen) + "\nEstructura", text_color=color.white, bgcolor=panelBgGreenHard ) table.cell(infoPanel, 0, 1, "Actual", text_color=color.black, bgcolor=color.white) table.cell(infoPanel, 1, 1, fuerzaIcon + " " + tendencia + " " + str.tostring(fuerzaPct) + "%", text_color=colorActual, bgcolor=color.white) table.cell(infoPanel, 2, 1, tendenciaB, text_color=colorActualB, bgcolor=color.white) table.cell(infoPanel, 0, 2, "D1", text_color=color.black, bgcolor=color.white) table.cell(infoPanel, 1, 2, d1IA + " " + d1TA + " " + str.tostring(d1FA) + "%", text_color=d1CA, bgcolor=color.white) table.cell(infoPanel, 2, 2, d1IB + " " + d1TB + " " + str.tostring(d1FB) + "%", text_color=d1CB, bgcolor=color.white) table.cell(infoPanel, 0, 3, "H4", text_color=color.black, bgcolor=color.white) table.cell(infoPanel, 1, 3, h4IA + " " + h4TA + " " + str.tostring(h4FA) + "%", text_color=h4CA, bgcolor=color.white) table.cell(infoPanel, 2, 3, h4IB + " " + h4TB + " " + str.tostring(h4FB) + "%", text_color=h4CB, bgcolor=color.white) table.cell(infoPanel, 0, 4, "H1", text_color=color.black, bgcolor=color.white) table.cell(infoPanel, 1, 4, h1IA + " " + h1TA + " " + str.tostring(h1FA) + "%", text_color=h1CA, bgcolor=color.white) table.cell(infoPanel, 2, 4, h1IB + " " + h1TB + " " + str.tostring(h1FB) + "%", text_color=h1CB, bgcolor=color.white) table.cell(infoPanel, 0, 5, "M15", text_color=color.black, bgcolor=color.white) table.cell(infoPanel, 1, 5, m15IA + " " + m15TA + " " + str.tostring(m15FA) + "%", text_color=m15CA, bgcolor=color.white) table.cell(infoPanel, 2, 5, m15IB + " " + m15TB + " " + str.tostring(m15FB) + "%", text_color=m15CB, bgcolor=color.white) table.cell(infoPanel, 0, 6, "VWAP", text_color=color.black, bgcolor=color.white) table.cell(infoPanel, 1, 6, vwapEstado, text_color=colorVWAP, bgcolor=color.white) table.cell(infoPanel, 2, 6, lecturaAB, text_color=lecturaABColor, bgcolor=color.white) table.cell(infoPanel, 0, 7, "Sesgo", text_color=color.black, bgcolor=color.white) table.cell(infoPanel, 1, 7, sesgoGeneral, text_color=sesgoColor, bgcolor=color.white) table.cell(infoPanel, 2, 7, sesgoGeneralB, text_color=sesgoColorB, bgcolor=color.white) else table.clear( infoPanel, 0, 0, 2, 7 )//=====================================================================// 19. SMR//=====================================================================// Calculados en todas las velas para evitar warnings de consistencia.highest3_smr = ta.highest(high, 3)lowest3_smr = ta.lowest(low, 3)highest5_smr = ta.highest(high, 5)lowest5_smr = ta.lowest(low, 5)bosBull_smr = ta.crossover( close, highest3_smr )bosBear_smr = ta.crossunder( close, lowest3_smr )var string lastChoch_smr = naif bosBull_smr lastChoch_smr := "CHOCH UP"if bosBear_smr lastChoch_smr := "CHOCH DOWN"entry_smr = closesl_smr = bosBull_smr ? lowest5_smr : bosBear_smr ? highest5_smr : natp_smr = bosBull_smr ? entry_smr + (entry_smr - sl_smr) * 2 : bosBear_smr ? entry_smr - (sl_smr - entry_smr) * 2 : narrRatio_smr = not na(sl_smr) and not na(tp_smr) ? math.abs(tp_smr - entry_smr) / math.abs(entry_smr - sl_smr) : nasmrLong = bosBull_smr and lastChoch_smr == "CHOCH UP"smrShort = bosBear_smr and lastChoch_smr == "CHOCH DOWN"entryLongCond_smr = smrLong and rrRatio_smr >= 1.5 and close > vwapLineentryShortCond_smr = smrShort and rrRatio_smr >= 1.5 and close < vwapLineatrValue = ta.atr(14)atrOperativo = atrValue < 2.0sesgoAlineado = (tendencia == "Alcista" and alcistas > bajistas) or (tendencia == "Bajista" and bajistas > alcistas)escenarioActivo = entryLongCond_smr ? "🟢 LONG (SMR)" : entryShortCond_smr ? "🔴 SHORT (SMR)" : "🟡 Consolidacion"rrClass_smr = na(rrRatio_smr) ? "N/A" : rrRatio_smr < 1.0 ? "🔴 BAJO" : rrRatio_smr < 1.5 ? "🟡 MEDIO" : "🟢 ALTO"rrColor_smr = na(rrRatio_smr) ? color.gray : rrRatio_smr < 1.0 ? color.red : rrRatio_smr < 1.5 ? color.yellow : color.limeliqEstado_smr = close > vwapLine ? "🟢 Sesgo VWAP Bullish" : "🔴 Sesgo VWAP Bearish"atrSignal = atrValue < 1.0 ? "🔴 BAJA" : atrValue < 2.0 ? "🟡 MEDIA" : "🟢 ALTA"var table panelSMR = table.new( position.top_right, 1, 8 )if barstate.islast if showPanelSMR table.cell(panelSMR, 0, 0, "SMR", text_color=color.white, bgcolor=panelBgGreenHard) table.cell( panelSMR, 0, 1, "ChOCh: " + (na(lastChoch_smr) ? "Neutral" : lastChoch_smr), text_color=panelTextColor, bgcolor=panelBgGreenSoft ) table.cell( panelSMR, 0, 2, "RR: " + (na(rrRatio_smr) ? "N/A" : str.tostring(rrRatio_smr, format.mintick)) + " | " + rrClass_smr, text_color=rrColor_smr, bgcolor=panelBgGreenSoft ) table.cell(panelSMR, 0, 3, "Escenario: " + escenarioActivo, text_color=color.white, bgcolor=panelBgGreenHard) table.cell(panelSMR, 0, 4, liqEstado_smr, text_color=panelTextColor, bgcolor=panelBgGreenSoft) table.cell(panelSMR, 0, 5, "ATR: " + str.tostring(atrValue, format.mintick), text_color=panelTextColor, bgcolor=panelBgGreenSoft) table.cell(panelSMR, 0, 6, "Vol: " + atrSignal, text_color=panelTextColor, bgcolor=panelBgGreenSoft) table.cell(panelSMR, 0, 7, "", bgcolor=color.white) else table.clear( panelSMR, 0, 0, 0, 7 )//=====================================================================// 20. SMC//=====================================================================left = input.int( 2, "Left bars", group="08 - SMC" )right = input.int( 2, "Right bars", group="08 - SMC" )htfChochTF = input.string( "60", "Timeframe CHOCH HTF", options=["D","240","60","30","15","5","3"], group="08 - SMC" )htfSwingHigh = request.security( syminfo.tickerid, htfChochTF, ta.pivothigh(high, left, right) )htfSwingLow = request.security( syminfo.tickerid, htfChochTF, ta.pivotlow(low, left, right) )var float htfLastHigh = navar float htfLastLow = naif not na(htfSwingHigh) htfLastHigh := htfSwingHighif not na(htfSwingLow) htfLastLow := htfSwingLowhtfBosBull = not na(htfLastHigh) and close > htfLastHighhtfBosBear = not na(htfLastLow) and close < htfLastLowvar string lastHTFChoch = naif htfBosBull lastHTFChoch := "UP"if htfBosBear lastHTFChoch := "DOWN"swingHigh = ta.pivothigh(high, left, right)swingLow = ta.pivotlow(low, left, right)var float lastHigh = navar float lastLow = naif not na(swingHigh) lastHigh := swingHighif not na(swingLow) lastLow := swingLowliqBuy = not na(lastHigh) and high > lastHighliqSell = not na(lastLow) and low < lastLowbosBull_smc = liqBuy and close > lastHighbosBear_smc = liqSell and close < lastLowvar float rrRatio_smc = naif bosBull_smc and not na(lastLow) and not na(lastHigh) rrRatio_smc := (close - lastLow) / (lastHigh - lastLow)if bosBear_smc and not na(lastLow) and not na(lastHigh) rrRatio_smc := (lastHigh - close) / (lastHigh - lastLow)entryLongCond_smc = bosBull_smc and rrRatio_smc >= 1.5entryShortCond_smc = bosBear_smc and rrRatio_smc >= 1.5//=====================================================================// 21. FILTRO TRH//=====================================================================if syncTRHwithPanel allowLong = alcistas >= minTFbias allowShort = bajistas >= minTFbias allowLong := requireVWAP ? allowLong and close > vwapLine : allowLong allowShort := requireVWAP ? allowShort and close < vwapLine : allowShort entryLongCond_smc := entryLongCond_smc and allowLong entryShortCond_smc := entryShortCond_smc and allowShort//=====================================================================// 22. VWAP MTF//=====================================================================dClose = request.security(syminfo.tickerid, "D", close)dVWAP = request.security(syminfo.tickerid, "D", ta.vwap)h4Close = request.security(syminfo.tickerid, "240", close)h4VWAP = request.security(syminfo.tickerid, "240", ta.vwap)h1Close = request.security(syminfo.tickerid, "60", close)h1VWAP = request.security(syminfo.tickerid, "60", ta.vwap)m15Close = request.security(syminfo.tickerid, "15", close)m15VWAP = request.security(syminfo.tickerid, "15", ta.vwap)bullCount = (dClose > dVWAP ? 1 : 0) + (h4Close > h4VWAP ? 1 : 0) + (h1Close > h1VWAP ? 1 : 0) + (m15Close > m15VWAP ? 1 : 0)bearCount = 4 - bullCountsesgoMTF = bullCount > bearCount ? "🟢 Alcista " + str.tostring(bullCount) + "/4 TF" : bearCount > bullCount ? "🔴 Bajista " + str.tostring(bearCount) + "/4 TF" : "🟡 Neutral"//=====================================================================// 23. ESTRUCTURA MTF//=====================================================================dHigh5 = request.security(syminfo.tickerid, "D", ta.highest(high, 5))dLow5 = request.security(syminfo.tickerid, "D", ta.lowest(low, 5))h4High5 = request.security(syminfo.tickerid, "240", ta.highest(high, 5))h4Low5 = request.security(syminfo.tickerid, "240", ta.lowest(low, 5))h1High5 = request.security(syminfo.tickerid, "60", ta.highest(high, 5))h1Low5 = request.security(syminfo.tickerid, "60", ta.lowest(low, 5))m15High5 = request.security(syminfo.tickerid, "15", ta.highest(high, 5))m15Low5 = request.security(syminfo.tickerid, "15", ta.lowest(low, 5))bosD = close > dHigh5 ? "🟢 BOS UP" : close < dLow5 ? "🔴 BOS DOWN" : "🟡 Rango"bosH4 = close > h4High5 ? "🟢 BOS UP" : close < h4Low5 ? "🔴 BOS DOWN" : "🟡 Rango"bosH1 = close > h1High5 ? "🟢 BOS UP" : close < h1Low5 ? "🔴 BOS DOWN" : "🟡 Rango"bosM15 = close > m15High5 ? "🟢 BOS UP" : close < m15Low5 ? "🔴 BOS DOWN" : "🟡 Rango"//=====================================================================// 24. PANEL SMC//=====================================================================var table panelInst = table.new( position.bottom_right, 1, 10 )if barstate.islast if showPanelSMC table.cell(panelInst, 0, 0, "SMC INSTITUCIONAL", text_color=color.white, bgcolor=panelBgGreenHard) table.cell( panelInst, 0, 1, "HTF CHOCH: " + (na(lastHTFChoch) ? "N/A" : lastHTFChoch + " (" + htfChochTF + ")"), text_color=panelTextColor, bgcolor=panelBgGreenSoft ) table.cell( panelInst, 0, 2, "RR SMC: " + (na(rrRatio_smc) ? "N/A" : str.tostring(rrRatio_smc, format.mintick)), text_color=panelTextColor, bgcolor=panelBgGreenSoft ) table.cell( panelInst, 0, 3, "Escenario: " + (entryLongCond_smc ? "🟢 LONG" : entryShortCond_smc ? "🔴 SHORT" : "🟡 Neutral"), text_color=panelTextColor, bgcolor=panelBgGreenHard ) table.cell(panelInst, 0, 4, "Sesgo MTF: " + sesgoMTF, text_color=panelTextColor, bgcolor=panelBgGreenSoft) table.cell(panelInst, 0, 5, "D1: " + bosD, text_color=panelTextColor, bgcolor=panelBgGreenSoft) table.cell(panelInst, 0, 6, "H4: " + bosH4, text_color=panelTextColor, bgcolor=panelBgGreenSoft) table.cell(panelInst, 0, 7, "H1: " + bosH1, text_color=panelTextColor, bgcolor=panelBgGreenSoft) table.cell(panelInst, 0, 8, "M15: " + bosM15, text_color=panelTextColor, bgcolor=panelBgGreenSoft) table.cell(panelInst, 0, 9, "", bgcolor=color.white) else table.clear( panelInst, 0, 0, 0, 9 )//=====================================================================// 25. RADAR INSTITUCIONAL//=====================================================================// OFF POR DEFECTOshowRadar = input.bool( false, "Mostrar Radar Institucional", group="09 - Radar Institucional" )modoNocturno = input.bool( true, "Modo nocturno", group="09 - Radar Institucional" )geoRiskMode = input.string( "Normal", "Riesgo Geopolitico", options=["Normal","Elevado","Critico"], group="09 - Radar Institucional" )operacionManual = input.bool( false, "Activar operacion manualmente", group="10 - Operacion" )var string operacionActiva = ""if entryLongCond_smc operacionActiva := "LONG"if entryShortCond_smc operacionActiva := "SHORT"if operacionManual and operacionActiva == "" operacionActiva := "MANUAL"if not operacionManual and not entryLongCond_smc and not entryShortCond_smc operacionActiva := ""panelBgDarkSoft = color.new(color.rgb(20,20,20), 40)panelBgDarkHard = color.new(color.rgb(20,20,20), 20)bgSoft = modoNocturno ? panelBgDarkSoft : panelBgGreenSoftbgHard = modoNocturno ? panelBgDarkHard : panelBgGreenHardrecBias = bullCount > bearCount ? "Sesgo Alcista. Buscar compras." : bearCount > bullCount ? "Sesgo Bajista. Buscar ventas." : "Sesgo mixto. Priorizar gestion de riesgo."recGeo = geoRiskMode == "Critico" ? "Riesgo geopolitico critico." : geoRiskMode == "Elevado" ? "Riesgo geopolitico elevado." : "Riesgo geopolitico normal."recVol = atrValue < 1.0 ? "Volatilidad baja." : atrValue < 2.0 ? "Volatilidad media." : "Volatilidad alta."var table radarPanel = table.new( position.top_left, 1, 7 )if barstate.islast if showRadar table.cell(radarPanel, 0, 0, "ATC RADAR", text_color=color.white, bgcolor=bgHard) table.cell(radarPanel, 0, 1, "Sesgo: " + sesgoMTF, text_color=color.white, bgcolor=bgSoft) table.cell(radarPanel, 0, 2, recBias, text_color=color.white, bgcolor=bgSoft) table.cell(radarPanel, 0, 3, recGeo, text_color=color.white, bgcolor=bgSoft) table.cell(radarPanel, 0, 4, recVol, text_color=color.white, bgcolor=bgSoft) table.cell(radarPanel, 0, 5, "Operacion: " + operacionActiva, text_color=color.white, bgcolor=bgHard) table.cell(radarPanel, 0, 6, lecturaAB, text_color=color.white, bgcolor=bgSoft) else table.clear( radarPanel, 0, 0, 0, 6 )//=====================================================================// 26. SESIONES//=====================================================================// TODO APAGADO POR DEFECTOshowSessions = input.bool( false, "Mostrar sesiones institucionales", group="11 - Sesiones" )asiaBgCfg = input.bool( false, "Fondo Asia", group="11 - Sesiones" )londonBgCfg = input.bool( false, "Fondo Londres", group="11 - Sesiones" )nyBgCfg = input.bool( false, "Fondo Nueva York", group="11 - Sesiones" )asiaSessionColor = input.color( color.new(color.yellow, 88), "Color fondo Asia", group="11 - Sesiones" )londonSessionColor = input.color( color.new(color.orange, 88), "Color fondo Londres", group="11 - Sesiones" )nySessionColor = input.color( color.new(color.aqua, 88), "Color fondo NY", group="11 - Sesiones" )// UTC-6asiaRange = "1700-0200"londonRange = "0200-1000"nyRange = "0700-1600"asiaInSession = not na( time( timeframe.period, asiaRange, "Etc/GMT+6" ) )londonInSession = not na( time( timeframe.period, londonRange, "Etc/GMT+6" ) )nyInSession = not na( time( timeframe.period, nyRange, "Etc/GMT+6" ) )bgcolor( showSessions and asiaBgCfg and asiaInSession ? asiaSessionColor : na )bgcolor( showSessions and londonBgCfg and londonInSession ? londonSessionColor : na )bgcolor( showSessions and nyBgCfg and nyInSession ? nySessionColor : na )//=====================================================================// 27. MAPA DE LIQUIDEZ - SESIONES ANTERIORES//=====================================================================showPreviousSessionHL = input.bool( true, "Mostrar H/L sesiones anteriores", group="12 - Liquidez Sesiones" )showAsiaHL = input.bool( true, "Asia H/L", group="12 - Liquidez Sesiones" )showLondonHL = input.bool( true, "London H/L", group="12 - Liquidez Sesiones" )showNyHL = input.bool( true, "NY H/L", group="12 - Liquidez Sesiones" )showSessionHLLabels = input.bool( true, "Mostrar vinetas grandes", group="12 - Liquidez Sesiones" )sessionHLDecimals = input.int( 2, "Decimales en viñetas H/L", options=[0, 1, 2], group="12 - Liquidez Sesiones" )asiaHLColor = input.color( color.yellow, "Color Asia", group="12 - Liquidez Sesiones" )londonHLColor = input.color( color.orange, "Color Londres", group="12 - Liquidez Sesiones" )nyHLColor = input.color( color.aqua, "Color Nueva York", group="12 - Liquidez Sesiones" )sessionHLWidth = input.int( 2, "Grosor H/L", minval=1, maxval=4, group="12 - Liquidez Sesiones" )//=====================================================================// 28. INICIO / FIN SESIONES//=====================================================================asiaStart = asiaInSession and not asiaInSession[1]asiaEnd = not asiaInSession and asiaInSession[1]londonStart = londonInSession and not londonInSession[1]londonEnd = not londonInSession and londonInSession[1]nyStart = nyInSession and not nyInSession[1]nyEnd = not nyInSession and nyInSession[1]//=====================================================================// 29. ACUMULADORES//=====================================================================var float asiaCurrentHigh = navar float asiaCurrentLow = navar float asiaPreviousHigh = navar float asiaPreviousLow = navar float londonCurrentHigh = navar float londonCurrentLow = navar float londonPreviousHigh = navar float londonPreviousLow = navar float nyCurrentHigh = navar float nyCurrentLow = navar float nyPreviousHigh = navar float nyPreviousLow = na// ASIAif asiaStart asiaCurrentHigh := high asiaCurrentLow := lowelse if asiaInSession asiaCurrentHigh := na(asiaCurrentHigh) ? high : math.max(asiaCurrentHigh, high) asiaCurrentLow := na(asiaCurrentLow) ? low : math.min(asiaCurrentLow, low)if asiaEnd asiaPreviousHigh := asiaCurrentHigh asiaPreviousLow := asiaCurrentLow// LONDRESif londonStart londonCurrentHigh := high londonCurrentLow := lowelse if londonInSession londonCurrentHigh := na(londonCurrentHigh) ? high : math.max(londonCurrentHigh, high) londonCurrentLow := na(londonCurrentLow) ? low : math.min(londonCurrentLow, low)if londonEnd londonPreviousHigh := londonCurrentHigh londonPreviousLow := londonCurrentLow// NUEVA YORKif nyStart nyCurrentHigh := high nyCurrentLow := lowelse if nyInSession nyCurrentHigh := na(nyCurrentHigh) ? high : math.max(nyCurrentHigh, high) nyCurrentLow := na(nyCurrentLow) ? low : math.min(nyCurrentLow, low)if nyEnd nyPreviousHigh := nyCurrentHigh nyPreviousLow := nyCurrentLow//=====================================================================// 30. LINEAS H/L VIVAS//=====================================================================var line asiaHighLine = navar line asiaLowLine = navar line londonHighLine = navar line londonLowLine = navar line nyHighLine = navar line nyLowLine = na// ASIAif asiaEnd if not na(asiaHighLine) line.delete(asiaHighLine) if not na(asiaLowLine) line.delete(asiaLowLine) if showPreviousSessionHL and showAsiaHL asiaHighLine := line.new( bar_index, asiaPreviousHigh, bar_index + 1, asiaPreviousHigh, xloc=xloc.bar_index, extend=extend.right, color=asiaHLColor, width=sessionHLWidth, style=line.style_solid ) asiaLowLine := line.new( bar_index, asiaPreviousLow, bar_index + 1, asiaPreviousLow, xloc=xloc.bar_index, extend=extend.right, color=asiaHLColor, width=sessionHLWidth, style=line.style_dotted )// LONDRESif londonEnd if not na(londonHighLine) line.delete(londonHighLine) if not na(londonLowLine) line.delete(londonLowLine) if showPreviousSessionHL and showLondonHL londonHighLine := line.new( bar_index, londonPreviousHigh, bar_index + 1, londonPreviousHigh, xloc=xloc.bar_index, extend=extend.right, color=londonHLColor, width=sessionHLWidth, style=line.style_solid ) londonLowLine := line.new( bar_index, londonPreviousLow, bar_index + 1, londonPreviousLow, xloc=xloc.bar_index, extend=extend.right, color=londonHLColor, width=sessionHLWidth, style=line.style_dotted )// NYif nyEnd if not na(nyHighLine) line.delete(nyHighLine) if not na(nyLowLine) line.delete(nyLowLine) if showPreviousSessionHL and showNyHL nyHighLine := line.new( bar_index, nyPreviousHigh, bar_index + 1, nyPreviousHigh, xloc=xloc.bar_index, extend=extend.right, color=nyHLColor, width=sessionHLWidth, style=line.style_solid ) nyLowLine := line.new( bar_index, nyPreviousLow, bar_index + 1, nyPreviousLow, xloc=xloc.bar_index, extend=extend.right, color=nyHLColor, width=sessionHLWidth, style=line.style_dotted )//=====================================================================// FORMATO DE PRECIOS H/L//=====================================================================f_sessionPrice(value) => sessionHLDecimals == 0 ? str.tostring(value, "#") : sessionHLDecimals == 1 ? str.tostring(value, "#.0") : str.tostring(value, "#.00")//=====================================================================// 31. VINETAS GRANDES H/L//=====================================================================var label asiaHighLabel = navar label asiaLowLabel = navar label londonHighLabel = navar label londonLowLabel = navar label nyHighLabel = navar label nyLowLabel = naif barstate.islast // Limpiar las etiquetas de la vela anterior if not na(asiaHighLabel) label.delete(asiaHighLabel) if not na(asiaLowLabel) label.delete(asiaLowLabel) if not na(londonHighLabel) label.delete(londonHighLabel) if not na(londonLowLabel) label.delete(londonLowLabel) if not na(nyHighLabel) label.delete(nyHighLabel) if not na(nyLowLabel) label.delete(nyLowLabel) asiaHighLabel := na asiaLowLabel := na londonHighLabel := na londonLowLabel := na nyHighLabel := na nyLowLabel := na // ASIA if showPreviousSessionHL and showSessionHLLabels and showAsiaHL and not na(asiaPreviousHigh) asiaHighLabel := label.new( bar_index + 3, asiaPreviousHigh, "● ASIA H " + f_sessionPrice(asiaPreviousHigh), xloc=xloc.bar_index, yloc=yloc.price, style=label.style_label_left, color=color.new(asiaHLColor, 80), textcolor=asiaHLColor, size=size.large ) asiaLowLabel := label.new( bar_index + 3, asiaPreviousLow, "● ASIA L " + f_sessionPrice(asiaPreviousLow), xloc=xloc.bar_index, yloc=yloc.price, style=label.style_label_left, color=color.new(asiaHLColor, 80), textcolor=asiaHLColor, size=size.large ) // LONDON if showPreviousSessionHL and showSessionHLLabels and showLondonHL and not na(londonPreviousHigh) londonHighLabel := label.new( bar_index + 3, londonPreviousHigh, "● LONDON H " + f_sessionPrice(londonPreviousHigh), xloc=xloc.bar_index, yloc=yloc.price, style=label.style_label_left, color=color.new(londonHLColor, 80), textcolor=londonHLColor, size=size.large ) londonLowLabel := label.new( bar_index + 3, londonPreviousLow, "● LONDON L " + f_sessionPrice(londonPreviousLow), xloc=xloc.bar_index, yloc=yloc.price, style=label.style_label_left, color=color.new(londonHLColor, 80), textcolor=londonHLColor, size=size.large ) // NY if showPreviousSessionHL and showSessionHLLabels and showNyHL and not na(nyPreviousHigh) nyHighLabel := label.new( bar_index + 3, nyPreviousHigh, "● NY H " + f_sessionPrice(nyPreviousHigh), xloc=xloc.bar_index, yloc=yloc.price, style=label.style_label_left, color=color.new(nyHLColor, 80), textcolor=nyHLColor, size=size.large ) nyLowLabel := label.new( bar_index + 3, nyPreviousLow, "● NY L " + f_sessionPrice(nyPreviousLow), xloc=xloc.bar_index, yloc=yloc.price, style=label.style_label_left, color=color.new(nyHLColor, 80), textcolor=nyHLColor, size=size.large )//=====================================================================// 32. LIQUIDITY SWEEPS//=====================================================================asiaHighSweep = showPreviousSessionHL and showAsiaHL and not na(asiaPreviousHigh) and high > asiaPreviousHigh and close < asiaPreviousHighasiaLowSweep = showPreviousSessionHL and showAsiaHL and not na(asiaPreviousLow) and low < asiaPreviousLow and close > asiaPreviousLowlondonHighSweep = showPreviousSessionHL and showLondonHL and not na(londonPreviousHigh) and high > londonPreviousHigh and close < londonPreviousHighlondonLowSweep = showPreviousSessionHL and showLondonHL and not na(londonPreviousLow) and low < londonPreviousLow and close > londonPreviousLownyHighSweep = showPreviousSessionHL and showNyHL and not na(nyPreviousHigh) and high > nyPreviousHigh and close < nyPreviousHighnyLowSweep = showPreviousSessionHL and showNyHL and not na(nyPreviousLow) and low < nyPreviousLow and close > nyPreviousLow//=====================================================================// 33. ALERTAS//=====================================================================f_alertAllowed() => condBias = alertRequireBias ? sesgoAlineado : true condATR = alertRequireATR ? atrOperativo : true condBias and condATRalertcondition( alertEmaCrossA and cruceAlcistaA and f_alertAllowed(), "Cruce EMA Alcista A", "EMA corta A cruzo ARRIBA de EMA larga A" )alertcondition( alertEmaCrossA and cruceBajistaA and f_alertAllowed(), "Cruce EMA Bajista A", "EMA corta A cruzo ABAJO de EMA larga A" )alertcondition( alertEmaCrossB and cruceAlcistaB and f_alertAllowed(), "Cruce EMA Alcista B", "EMA corta B cruzo ARRIBA de EMA larga B" )alertcondition( alertEmaCrossB and cruceBajistaB and f_alertAllowed(), "Cruce EMA Bajista B", "EMA corta B cruzo ABAJO de EMA larga B" )alertcondition( alertVwapCross and cruceVWAPup and f_alertAllowed(), "Cruce VWAP Alcista", "Precio cruzo ARRIBA del VWAP" )alertcondition( alertVwapCross and cruceVWAPdown and f_alertAllowed(), "Cruce VWAP Bajista", "Precio cruzo ABAJO del VWAP" )alertcondition( asiaHighSweep, "Asia High Sweep", "Barrido de liquidez sobre Asia High" )alertcondition( asiaLowSweep, "Asia Low Sweep", "Barrido de liquidez bajo Asia Low" )alertcondition( londonHighSweep, "London High Sweep", "Barrido de liquidez sobre London High" )alertcondition( londonLowSweep, "London Low Sweep", "Barrido de liquidez bajo London Low" )alertcondition( nyHighSweep, "NY High Sweep", "Barrido de liquidez sobre NY High" )alertcondition( nyLowSweep, "NY Low Sweep", "Barrido de liquidez bajo NY Low" )