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