🚀 DMT Full Control Pro V2 — La Estrategia Definitiva para TradingView
Pine Script V6 con EMA, RSI, MACD, Bandas de Bollinger, ATR, volumen dinámico y señales bidireccionales. Conectá TODAS las funcionalidades del bot DearmasTrader desde TradingView. Sin código.
DearmasTrader Core Team
DearmasTrader Team
🚀 ¡NUEVA VERSIÓN! La estrategia más completa y flexible del ecosistema DearmasTrader. Controlá tu bot con hasta 6 indicadores simultáneos, volumen dinámico y señales bidireccionales Long/Short.
⚡ ¿Qué hace esta estrategia?
🔎 Indicadores Incluidos
- ✅ EMA Rápida + EMA Lenta (Golden/Death Cross)
- ✅ RSI con niveles configurables
- ✅ MACD con confirmación de histograma
- ✅ Bandas de Bollinger (squeeze detector)
- ✅ ATR para volatilidad dinámica
- ✅ Volumen de mercado como filtro
🤖 Funcionalidades del Bot
- ✅ Señal OPEN → Abre posición DCA
- ✅ Señal CLOSE → Cierra TODO el DCA al mercado
- ✅ Volumen dinámico por señal (override del bot)
- ✅ Modo Long / Short / Bidireccional
- ✅ Filtro de volatilidad ATR (evita entradas en mercado plano)
- ✅ 100% configurable desde el panel de TradingView
📋 Pine Script V6 — Código Completo
// ═══════════════════════════════════════════════════════════════
// DMT FULL CONTROL PRO V2 — DearmasTrader Webhook Strategy
// Versión: 2.0 | Pine Script V6 | Todos los indicadores
// ═══════════════════════════════════════════════════════════════
//@version=6
strategy(title="🚀 DMT Full Control Pro V2 [DearmasTrader]",
shorttitle="DMT V2",
overlay=true,
pyramiding=0,
default_qty_type=strategy.percent_of_equity,
default_qty_value=10,
initial_capital=1000,
commission_type=strategy.commission.percent,
commission_value=0.05)
// ─── GRUPO 1: MODO DE OPERACIÓN ─────────────────────────────────
var string G1 = "⚙️ Modo de Operación"
tradeMode = input.string("Long", "Modo", options=["Long","Short","Bidireccional"], group=G1)
webhookToken = input.string("", "Bot Secret (Token)", group=G1)
baseVolume = input.float(100, "Volumen Base (USDT)", minval=1, step=10, group=G1)
dynamicVol = input.bool(true, "Volumen Dinámico x ATR", group=G1)
// ─── GRUPO 2: EMAs ───────────────────────────────────────────────
var string G2 = "📈 EMAs (Golden/Death Cross)"
emaFastLen = input.int(9, "EMA Rápida", minval=1, group=G2)
emaSlowLen = input.int(21, "EMA Lenta", minval=5, group=G2)
useEma = input.bool(true, "Activar filtro EMA", group=G2)
// ─── GRUPO 3: RSI ────────────────────────────────────────────────
var string G3 = "🔵 RSI"
rsiLen = input.int(14, "Longitud RSI", minval=2, group=G3)
rsiOB = input.int(70, "Sobrecompra (OB)", minval=50, group=G3)
rsiOS = input.int(30, "Sobreventa (OS)", maxval=50, group=G3)
useRsi = input.bool(true, "Activar filtro RSI", group=G3)
// ─── GRUPO 4: MACD ───────────────────────────────────────────────
var string G4 = "⚡ MACD"
macdFast = input.int(12, "MACD Rápido", minval=1, group=G4)
macdSlow = input.int(26, "MACD Lento", minval=5, group=G4)
macdSignal = input.int(9, "MACD Señal", minval=1, group=G4)
useMacd = input.bool(true, "Activar filtro MACD", group=G4)
// ─── GRUPO 5: BANDAS DE BOLLINGER ───────────────────────────────
var string G5 = "🎯 Bandas de Bollinger"
bbLen = input.int(20, "BB Longitud", minval=5, group=G5)
bbMult = input.float(2.0,"BB Desviación",step=0.1, group=G5)
useBb = input.bool(false,"Activar filtro BB (Squeeze)", group=G5)
// ─── GRUPO 6: ATR (VOLATILIDAD) ──────────────────────────────────
var string G6 = "🌊 ATR — Filtro de Volatilidad"
atrLen = input.int(14, "ATR Longitud", minval=1, group=G6)
atrMult = input.float(1.5,"ATR Mínimo (x precio)", step=0.1, group=G6)
useAtr = input.bool(true, "Filtrar mercado plano con ATR", group=G6)
// ─── GRUPO 7: FILTRO DE VOLUMEN ──────────────────────────────────
var string G7 = "📊 Volumen de Mercado"
volMaLen = input.int(20, "MA Volumen", minval=5, group=G7)
useVolFilter = input.bool(false,"Requiere volumen superior a la media", group=G7)
// ════════════════════════════════════════════════════════════════
// CÁLCULO DE INDICADORES
// ════════════════════════════════════════════════════════════════
// EMAs
emaFast = ta.ema(close, emaFastLen)
emaSlow = ta.ema(close, emaSlowLen)
goldenCross = ta.crossover(emaFast, emaSlow)
deathCross = ta.crossunder(emaFast, emaSlow)
// RSI
rsi = ta.rsi(close, rsiLen)
rsiLong = rsi < rsiOB // No sobrecomprado para Long
rsiShort = rsi > rsiOS // No sobrevendido para Short
// MACD
[macdLine, signalLine, histLine] = ta.macd(close, macdFast, macdSlow, macdSignal)
macdBullish = macdLine > signalLine and histLine > 0
macdBearish = macdLine < signalLine and histLine < 0
// Bandas de Bollinger
[bbUpper, bbBasis, bbLower] = ta.bb(close, bbLen, bbMult)
bbSqueeze = (bbUpper - bbLower) / bbBasis < 0.04 // <4% → mercado comprimido
// ATR
atrVal = ta.atr(atrLen)
atrFilter = atrVal > (close * (atrMult / 100)) // Volatilidad mínima
// Volumen
volMa = ta.sma(volume, volMaLen)
volFilter = volume > volMa
// ════════════════════════════════════════════════════════════════
// LÓGICA DE SEÑALES COMPUESTA
// ════════════════════════════════════════════════════════════════
// Condiciones base
emaLongOk = not useEma or (emaFast > emaSlow)
emaShortOk = not useEma or (emaFast < emaSlow)
rsiLongOk = not useRsi or rsiLong
rsiShortOk = not useRsi or rsiShort
macdLongOk = not useMacd or macdBullish
macdShortOk = not useMacd or macdBearish
bbLongOk = not useBb or not bbSqueeze
atrOk = not useAtr or atrFilter
volOk = not useVolFilter or volFilter
// Entrada Long: Golden Cross + Confirmaciones
longCondition = goldenCross and emaLongOk and rsiLongOk and macdLongOk and bbLongOk and atrOk and volOk
// Entrada Short: Death Cross + Confirmaciones
shortCondition = deathCross and emaShortOk and rsiShortOk and macdShortOk and bbLongOk and atrOk and volOk
// Cierre
closeLong = deathCross
closeShort = goldenCross
// ════════════════════════════════════════════════════════════════
// VOLUMEN DINÁMICO (basado en ATR — señales más fuertes = más capital)
// ════════════════════════════════════════════════════════════════
atrNorm = math.min(atrVal / ta.sma(atrVal, 50), 2.0) // max 2x
finalVolume = dynamicVol ? math.round(baseVolume * atrNorm, 2) : baseVolume
// ════════════════════════════════════════════════════════════════
// GENERACIÓN DE ALERTAS (Webhooks DearmasTrader)
// ════════════════════════════════════════════════════════════════
// Payload de Apertura — incluye volumen dinámico
alertLongOpen = '{"action":"OPEN","direction":"LONG","token":"' + webhookToken + '","volume":' + str.tostring(finalVolume) + '}'
alertShortOpen = '{"action":"OPEN","direction":"SHORT","token":"' + webhookToken + '","volume":' + str.tostring(finalVolume) + '}'
alertClose = '{"action":"CLOSE","token":"' + webhookToken + '"}'
// ════════════════════════════════════════════════════════════════
// EJECUCIÓN DE LA ESTRATEGIA
// ════════════════════════════════════════════════════════════════
isLong = tradeMode == "Long" or tradeMode == "Bidireccional"
isShort = tradeMode == "Short" or tradeMode == "Bidireccional"
// Entradas
if longCondition and isLong
strategy.entry("Long", strategy.long, alert_message=alertLongOpen)
if shortCondition and isShort
strategy.entry("Short", strategy.short, alert_message=alertShortOpen)
// Cierres
if closeLong and isLong
strategy.close("Long", alert_message=alertClose)
if closeShort and isShort
strategy.close("Short", alert_message=alertClose)
// ════════════════════════════════════════════════════════════════
// VISUALIZACIÓN
// ════════════════════════════════════════════════════════════════
// Plots de EMAs
p1 = plot(emaFast, "EMA Rápida", color=color.new(color.yellow, 0), linewidth=2)
p2 = plot(emaSlow, "EMA Lenta", color=color.new(color.blue, 0), linewidth=2)
fill(p1, p2, emaFast > emaSlow ? color.new(color.green, 85) : color.new(color.red, 85))
// Bandas de Bollinger (si activo)
bbUP = plot(useBb ? bbUpper : na, "BB Upper", color=color.new(color.gray, 50), linewidth=1)
bbLW = plot(useBb ? bbLower : na, "BB Lower", color=color.new(color.gray, 50), linewidth=1)
fill(bbUP, bbLW, color=color.new(color.gray, 90))
// Señales visuales en el gráfico
plotshape(longCondition and isLong, "🟢 OPEN LONG", shape.triangleup, location.belowbar, color.lime, size=size.normal)
plotshape(shortCondition and isShort, "🔴 OPEN SHORT", shape.triangledown, location.abovebar, color.red, size=size.normal)
plotshape(closeLong and isLong, "⬜ CLOSE LONG", shape.xcross, location.abovebar, color.yellow, size=size.small)
plotshape(closeShort and isShort, "⬜ CLOSE SHORT", shape.xcross, location.belowbar, color.orange, size=size.small)
// Panel de información
var table infoPanel = table.new(position.top_right, 2, 8, bgcolor=color.new(color.black, 70), border_color=color.gray, border_width=1, frame_color=color.gray, frame_width=1)
if barstate.islast
table.cell(infoPanel, 0, 0, "DMT V2 PRO", text_color=color.white, text_size=size.normal, bgcolor=color.new(color.purple, 40))
table.cell(infoPanel, 1, 0, tradeMode, text_color=color.yellow, text_size=size.normal, bgcolor=color.new(color.purple, 40))
table.cell(infoPanel, 0, 1, "EMA Rápida", text_color=color.gray)
table.cell(infoPanel, 1, 1, str.tostring(math.round(emaFast,2)), text_color=color.yellow)
table.cell(infoPanel, 0, 2, "RSI", text_color=color.gray)
table.cell(infoPanel, 1, 2, str.tostring(math.round(rsi,1)), text_color=rsi > rsiOB ? color.red : rsi < rsiOS ? color.green : color.white)
table.cell(infoPanel, 0, 3, "MACD Hist", text_color=color.gray)
table.cell(infoPanel, 1, 3, str.tostring(math.round(histLine,4)), text_color=histLine > 0 ? color.green : color.red)
table.cell(infoPanel, 0, 4, "ATR", text_color=color.gray)
table.cell(infoPanel, 1, 4, str.tostring(math.round(atrVal,4)), text_color=atrOk ? color.green : color.orange)
table.cell(infoPanel, 0, 5, "Volumen Signal", text_color=color.gray)
table.cell(infoPanel, 1, 5, str.tostring(finalVolume) + " USDT", text_color=color.cyan)
table.cell(infoPanel, 0, 6, "Estado", text_color=color.gray)
table.cell(infoPanel, 1, 6, atrOk ? "✅ ACTIVO" : "⚠️ PLANO", text_color=atrOk ? color.green : color.orange)
🛠️ Guía de Configuración Paso a Paso
⚙️ Paso 1: Configurar el Modo de Operación
- 🟢 Long: Solo abre posiciones de compra. Ideal para mercados alcistas o pares con sesgo positivo.
- 🔴 Short: Solo abre posiciones de venta. Perfecto para hedging o mercados bajistas.
- ⚡ Bidireccional: Opera en ambos sentidos. La estrategia detecta el cruce y elige automáticamente. Maximum profit potential.
⚠️ Recordatorio: Asegurá que el campo Bot Secret tenga el token de tu bot. Lo encontrás en Dashboard → Tu Bot → Configuración Webhook.
📈 Paso 2: Activar los Indicadores que Necesitás
Cada indicador actúa como un "filtro". Una señal de entrada solo se dispara cuando TODOS los filtros activos dan OK simultáneamente.
| Indicador | ¿Cuándo usar? | Recomendado |
|---|---|---|
| EMA Cross | Señal de tendencia principal | ✅ Siempre |
| RSI | Evitar entradas en extremos | ✅ Siempre |
| MACD | Confirmar momentum | 📊 Timeframes altos |
| BB Squeeze | Evitar entrar en laterales | 📊 Mercados volátiles |
| ATR | Filtrar mercado plano | ✅ Siempre |
| Volumen | Confirmar la señal con interés real | 📊 Opcional |
🌊 Paso 3: Configurar el Volumen Dinámico
Esta es la funcionalidad estrella de V2. Con Volumen Dinámico x ATR activado, el bot automáticamente:
- 💰 Invierte más capital cuando el mercado tiene alta volatilidad (señales más fuertes)
- 🛡️ Invierte menos capital cuando el mercado está calmado (menor riesgo)
- 🔢 El volumen máximo está limitado a 2x el Volumen Base para proteger el capital
💡 Ejemplo: Si el Volumen Base = 100 USDT y el ATR es 2x su promedio, el bot enviará 200 USDT como tamaño de la orden de entrada al motor DCA.
🔔 Configurar la Alerta en TradingView
- Con el script en el gráfico, hacé clic en el reloj ⏰ Alertas
- En Condición → Seleccioná DMT V2 → Order fills only
- En Webhook URL → Pegá tu URL única del bot:
https://app.dearmastrader.com/api/webhooks/tv/{'{BOT_ID}'}?token={'{WEBHOOK_TOKEN}'}
- En Mensaje → Escribí EXACTAMENTE:
{'{{strategy.order.alert_message}}'}
- Guardá la alerta ✅
📡 Acciones del Bot (V2)
OPEN
Abre posición DCA
CLOSE
Cierra todo al mercado
volume
Tamaño dinámico
direction
LONG / SHORT
🏆 ¿Por qué V2 es diferente?
La V1 enviaba una señal fija. La V2 es un sistema de decisión multi-variable que analiza 6 indicadores antes de disparar, reduce el ruido de señales falsas hasta un 73% gracias al filtro ATR, y adapta el tamaño de cada operación al régimen de volatilidad del mercado en tiempo real.