Strategi ini adalah sistem perdagangan yang komprehensif yang menggabungkan beberapa crossover EMA (Exponential Moving Averages), Average True Range (ATR), dan level support/resistance Pivot Points.
Strategi ini didasarkan pada tiga dimensi analisis teknis:
Aturan perdagangan didefinisikan dengan jelas:
Strategi ini membangun sistem perdagangan yang komprehensif melalui sinergi dari beberapa indikator teknis. Kekuatannya utama terletak pada mekanisme konfirmasi sinyal multi-dimensi dan kerangka pengendalian risiko yang kuat, meskipun pedagang perlu mengoptimalkan parameter dan meningkatkan sistem berdasarkan kondisi pasar tertentu. Melalui arah optimasi yang disarankan, stabilitas dan keandalan strategi dapat ditingkatkan lebih lanjut.
/*backtest start: 2019-12-23 08:00:00 end: 2024-12-25 08:00:00 period: 1d basePeriod: 1d exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}] */ //@version=5 strategy("EMA Crossover + ATR + PPSignal", overlay=true) //-------------------------------------------------------------------- // 1. Cálculo de EMAs y ATR //-------------------------------------------------------------------- ema4 = ta.ema(close, 4) ema9 = ta.ema(close, 9) ema18 = ta.ema(close, 18) atrLength = 14 atr = ta.atr(atrLength) //-------------------------------------------------------------------- // 2. Cálculo de Pivot Points diarios (PPSignal) // Tomamos datos del día anterior (timeframe D) para calcularlos //-------------------------------------------------------------------- dayHigh = request.security(syminfo.tickerid, "D", high[1]) dayLow = request.security(syminfo.tickerid, "D", low[1]) dayClose = request.security(syminfo.tickerid, "D", close[1]) // Fórmula Pivot Points estándar pp = (dayHigh + dayLow + dayClose) / 3.0 r1 = 2.0 * pp - dayLow s1 = 2.0 * pp - dayHigh r2 = pp + (r1 - s1) s2 = pp - (r1 - s1) r3 = dayHigh + 2.0 * (pp - dayLow) s3 = dayLow - 2.0 * (dayHigh - pp) //-------------------------------------------------------------------- // 3. Definir colores para las EMAs //-------------------------------------------------------------------- col4 = color.green // EMA 4 col9 = color.yellow // EMA 9 col18 = color.red // EMA 18 //-------------------------------------------------------------------- // 4. Dibujar indicadores en el gráfico //-------------------------------------------------------------------- // EMAs plot(ema4, title="EMA 4", color=col4, linewidth=2) plot(ema9, title="EMA 9", color=col9, linewidth=2) plot(ema18, title="EMA 18", color=col18, linewidth=2) // ATR plot(atr, title="ATR", color=color.blue, linewidth=2) // Pivot Points (PPSignal) plot(pp, title="Pivot (PP)", color=color.new(color.white, 0), style=plot.style_line, linewidth=1) plot(r1, title="R1", color=color.new(color.red, 0), style=plot.style_line, linewidth=1) plot(r2, title="R2", color=color.new(color.red, 0), style=plot.style_line, linewidth=1) plot(r3, title="R3", color=color.new(color.red, 0), style=plot.style_line, linewidth=1) plot(s1, title="S1", color=color.new(color.green, 0), style=plot.style_line, linewidth=1) plot(s2, title="S2", color=color.new(color.green, 0), style=plot.style_line, linewidth=1) plot(s3, title="S3", color=color.new(color.green, 0), style=plot.style_line, linewidth=1) //-------------------------------------------------------------------- // 5. Condiciones de cruce (EMA4 vs EMA9 y EMA18) y estrategia //-------------------------------------------------------------------- crossedAbove = ta.crossover(ema4, ema9) and ta.crossover(ema4, ema18) crossedBelow = ta.crossunder(ema4, ema9) and ta.crossunder(ema4, ema18) // Señales de Buy y Sell basadas en cruces + condición con ATR if crossedAbove and close > ema9 + atr strategy.entry("Buy", strategy.long) strategy.exit("Sell", "Buy", stop=ema4) if crossedBelow and close < ema9 - atr strategy.entry("Sell", strategy.short) strategy.exit("Cover", "Sell", stop=ema4)