
La estrategia de comercio cuantitativa de seguimiento de tendencias de índices de múltiples volúmenes es una estrategia de comercio cuantitativa de tipo complejo que combina el promedio móvil de índices (EMA), el índice de fuerza relativa (RSI) y el indicador de dispersión de convergencia de medias móviles (MACD). La estrategia, que integra varios indicadores técnicos, está diseñada para mejorar la precisión y la fiabilidad de la señal de comercio, especialmente para el comercio de líneas cortas y medias en mercados altamente volátiles.
El principio central de esta estrategia es la verificación conjunta de múltiples indicadores:
Reglas específicas para la generación de señales de comercio:
La estrategia de comercio cuantitativo, que sigue la tendencia de los indicadores de múltiples dinámicas, construye un sistema de generación de señales de comercio relativamente robusto mediante la integración de tres indicadores técnicos clave: EMA, RSI y MACD. La estrategia mantiene la suficiente flexibilidad y tiene una gran capacidad de control de riesgo para proporcionar a los comerciantes cuantitativos un programa de comercio que vale la pena estudiar en profundidad.
/*backtest
start: 2025-01-01 00:00:00
end: 2025-04-01 00:00:00
period: 1d
basePeriod: 1d
exchanges: [{"eid":"Futures_Binance","currency":"DOGE_USDT"}]
*/
//@version=6
strategy("EMA + RSI + MACD Strategy", overlay=true)
// Input for EMA Lengths
emaFastLength = input(9, title="Fast EMA Length")
emaSlowLength = input(21, title="Slow EMA Length")
// RSI Settings
rsiLength = input(14, title="RSI Length")
rsiOverbought = input(70, title="RSI Overbought Level")
rsiOversold = input(30, title="RSI Oversold Level")
// MACD Settings
[macdLine, signalLine, _] = ta.macd(close, 12, 26, 9)
// Calculate EMAs
emaFast = ta.ema(close, emaFastLength)
emaSlow = ta.ema(close, emaSlowLength)
// Calculate RSI
rsi = ta.rsi(close, rsiLength)
// Plot EMAs
plot(emaFast, title="Fast EMA", color=color.blue, linewidth=1)
plot(emaSlow, title="Slow EMA", color=color.red, linewidth=1)
// Buy and Sell Conditions
bullishCrossover = ta.crossover(emaFast, emaSlow) and rsi > 50 and macdLine > signalLine
bearishCrossover = ta.crossunder(emaFast, emaSlow) and rsi < 50 and macdLine < signalLine
// Plot Buy and Sell Signals
plotshape(series=bullishCrossover, title="BuySignal", location=location.belowbar, color=color.green, style=shape.triangleup, size=size.small, text="BUY")
plotshape(series=bearishCrossover, title="SellSignal", location=location.abovebar, color=color.red, style=shape.triangledown, size=size.small, text="SELL")
// Strategy Execution
if bullishCrossover
strategy.entry("Buy", strategy.long)
if bearishCrossover
strategy.close("Buy")
strategy.entry("Sell", strategy.short)