π 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.