📚 Ejemplos de Estrategias
Estrategias de trading de muestra Pine Script V5 con integración webhook
¿Cómo Funciona?
Elegir Estrategia
Selecciona uno de los ejemplos a continuación o escribe tu propia estrategia
Añadir a TradingView
Copia el código Pine Script y añádelo como un nuevo indicador/estrategia en TradingView
Crear Alerta
Obtén tu URL webhook desde la página Creador de Alarmas y crea una alerta en TradingView
Trading Automatizado
Las órdenes se envían automáticamente a Binance cuando la estrategia genera señales
Parámetros JSON del Webhook
Formato JSON para la función alert() en tus estrategias:
| Parámetro | Descripción | Valor de Ejemplo |
|---|---|---|
borsa |
Hedef borsa YENİ | "Binance" / "MEXC" |
piyasa |
Mercado a operar | "FUTURES" / "SPOT" |
sembol |
Par de trading (variable TradingView) | "{{ticker}}" |
yon |
Dirección de la operación | "BUY" / "SELL" |
tip |
Tipo de orden | "MARKET", "LIMIT", "STOP" |
tutar |
Cantidad de la operación (USDT) | 10 |
fiyat |
Precio límite/stop (0 para MARKET) | 0 |
Ejemplos de Estrategias Pine Script V5
Descripción de la Estrategia
Esta estrategia usa dos medias móviles (EMA). Cuando la EMA rápida (9 períodos) cruza por encima de la EMA lenta (21 períodos), genera una señal de COMPRA, y cuando cruza por debajo, una señal de VENTA.
Cuándo usarla: En mercados con tendencia fuerte; puede dar falsas señales en mercados laterales.
//@version=5
strategy("AlgoCripto - EMA Crossover", overlay=true)
// Parametreler
fastLength = input.int(9, "Fast EMA Length")
slowLength = input.int(21, "Slow EMA Length")
// EMA Hesaplama
fastEMA = ta.ema(close, fastLength)
slowEMA = ta.ema(close, slowLength)
// Al/Sat Sinyalleri
longCondition = ta.crossover(fastEMA, slowEMA)
shortCondition = ta.crossunder(fastEMA, slowEMA)
// Görseller
plot(fastEMA, color=color.blue, title="Fast EMA")
plot(slowEMA, color=color.red, title="Slow EMA")
// Strateji Emirleri
if longCondition
strategy.entry("Long", strategy.long)
alert('{"borsa": "Binance", "piyasa": "FUTURES", "sembol": "{{ticker}}", "yon": "BUY", "tip": "MARKET", "tutar": 10, "fiyat": 0}', alert.freq_once_per_bar)
if shortCondition
strategy.entry("Short", strategy.short)
alert('{"borsa": "Binance", "piyasa": "FUTURES", "sembol": "{{ticker}}", "yon": "SELL", "tip": "MARKET", "tutar": 10, "fiyat": 0}', alert.freq_once_per_bar)
Configuración de Alertas TradingView
Al crear una alerta, selecciona "Solo llamadas a función de alerta" y obtén tu URL webhook desde Creador de Alarmas página.
Descripción de la Estrategia
El RSI es un indicador de momento. Cuando cae por debajo de 30, indica sobrevendido (señal de COMPRA); cuando sube por encima de 70, indica sobrecomprado (señal de VENTA).
Cuándo usarla: Funciona bien en mercados laterales. Puede dar falsas señales en tendencias fuertes.
//@version=5
strategy("AlgoCripto - RSI Strategy", overlay=false)
// Parametreler
rsiLength = input.int(14, "RSI Length")
oversoldLevel = input.int(30, "Oversold Level")
overboughtLevel = input.int(70, "Overbought Level")
// RSI Hesaplama
rsi = ta.rsi(close, rsiLength)
// Al/Sat Sinyalleri
longCondition = ta.crossover(rsi, oversoldLevel)
shortCondition = ta.crossunder(rsi, overboughtLevel)
// Görseller
hline(oversoldLevel, "Oversold", color=color.green)
hline(overboughtLevel, "Overbought", color=color.red)
hline(50, "Middle", color=color.gray)
plot(rsi, color=color.blue, title="RSI")
// Strateji Emirleri
if longCondition
strategy.entry("Long", strategy.long)
alert('{"borsa": "Binance", "piyasa": "FUTURES", "sembol": "{{ticker}}", "yon": "BUY", "tip": "MARKET", "tutar": 10, "fiyat": 0}', alert.freq_once_per_bar)
if shortCondition
strategy.entry("Short", strategy.short)
alert('{"borsa": "Binance", "piyasa": "FUTURES", "sembol": "{{ticker}}", "yon": "SELL", "tip": "MARKET", "tutar": 10, "fiyat": 0}', alert.freq_once_per_bar)
İpucu
RSI değerlerini (30/70) piyasa koşullarına göre ayarlayabilirsiniz. Daha az sinyal için 20/80, daha çok sinyal için 35/65 değerlerini deneyebilirsiniz.
Descripción de la Estrategia
Esta estrategia usa puntos pivote para identificar niveles de soporte y resistencia. Cuando el precio rompe la resistencia, genera señal de COMPRA; cuando rompe el soporte, señal de VENTA.
Cuándo usarla: Se usa cuando se espera una ruptura tras una consolidación o en mercados en rango.
//@version=5
strategy("AlgoCripto - Support/Resistance Breakout", overlay=true)
// Parametreler
pivotLength = input.int(10, "Pivot Length")
breakoutConfirmation = input.int(2, "Breakout Confirmation Bars")
// Pivot Noktalarını Bul
pivotHigh = ta.pivothigh(high, pivotLength, pivotLength)
pivotLow = ta.pivotlow(low, pivotLength, pivotLength)
// Direnç ve Destek Seviyeleri
var float resistance = na
var float support = na
if not na(pivotHigh)
resistance := pivotHigh
if not na(pivotLow)
support := pivotLow
// Kırılma Sinyalleri
longCondition = close > resistance and close[breakoutConfirmation] <= resistance
shortCondition = close < support and close[breakoutConfirmation] >= support
// Görseller
plot(resistance, color=color.red, style=plot.style_line, linewidth=2, title="Resistance")
plot(support, color=color.green, style=plot.style_line, linewidth=2, title="Support")
// Strateji Emirleri
if longCondition
strategy.entry("Long", strategy.long)
alert('{"borsa": "Binance", "piyasa": "FUTURES", "sembol": "{{ticker}}", "yon": "BUY", "tip": "MARKET", "tutar": 10, "fiyat": 0}', alert.freq_once_per_bar)
if shortCondition
strategy.entry("Short", strategy.short)
alert('{"borsa": "Binance", "piyasa": "FUTURES", "sembol": "{{ticker}}", "yon": "SELL", "tip": "MARKET", "tutar": 10, "fiyat": 0}', alert.freq_once_per_bar)
Dikkat
Kırılma stratejileri yanlış kırılma (false breakout) riski taşır. Stop-loss kullanımı önerilir.
¿Listo para Empezar?
¡Copia las estrategias y empieza a usarlas en TradingView ahora mismo!
Ir al Creador de Alarmas Configuración API