This strategy is a quantitative trading system based on multiple technical indicators, combining Exponential Moving Averages (EMA), Relative Volatility Index (RVI), and custom trading signals for decision-making. The system employs dynamic stop-loss and take-profit targets using the ATR indicator for risk management, creating a comprehensive trading strategy framework.
The strategy relies on three core components for trading decisions:
The strategy builds a relatively complete trading system through the comprehensive use of multiple technical indicators and risk management tools. While there are some inherent limitations, the system shows promise for improved performance through the suggested optimizations. The key is continuous monitoring and adjustment in live trading to ensure strategy stability across different market conditions.
/*backtest start: 2024-10-01 00:00:00 end: 2024-10-31 23:59:59 period: 2h basePeriod: 2h exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}] */ //@version=5 strategy("Gold Bot with Viamanchu, EMA20/200, and RVI - 3min", overlay=true) // Parámetros de las EMAs ema20 = ta.ema(close, 20) ema200 = ta.ema(close, 200) // Relative Volatility Index (RVI) rvi_length = input(14, title="RVI Length") rvi = ta.rma(close - close[1], rvi_length) / ta.rma(math.abs(close - close[1]), rvi_length) // Simulación de Viamanchu (aleatoria para demo, se debe reemplazar por señal de Viamanchu real) var int seed = time simulated_vi_manchu_signal = math.random() > 0.5 ? 1 : -1 // 1 para compra, -1 para venta (puedes sustituir por la lógica de Viamanchu) // Gestión de riesgos: Stop Loss y Take Profit usando ATR atr_length = input(14, title="ATR Length") atr = ta.atr(atr_length) atr_multiplier = input.float(1.5, title="ATR Multiplier for Stop Loss/Take Profit") stop_loss_level = strategy.position_avg_price - (atr * atr_multiplier) take_profit_level = strategy.position_avg_price + (atr * atr_multiplier) // Condiciones de entrada longCondition = ta.crossover(ema20, ema200) and rvi > 0 and simulated_vi_manchu_signal == 1 shortCondition = ta.crossunder(ema20, ema200) and rvi < 0 and simulated_vi_manchu_signal == -1 // Ejecutar compra (long) if (longCondition) strategy.entry("Compra", strategy.long, stop=stop_loss_level, limit=take_profit_level) // Ejecutar venta (short) if (shortCondition) strategy.entry("Venta", strategy.short, stop=stop_loss_level, limit=take_profit_level) // Visualización de las condiciones de entrada en el gráfico plotshape(series=longCondition, title="Compra señal", location=location.belowbar, color=color.green, style=shape.labelup, text="BUY") plotshape(series=shortCondition, title="Venta señal", location=location.abovebar, color=color.red, style=shape.labeldown, text="SELL") // Visualización de las EMAs en el gráfico plot(ema20, color=color.blue, title="EMA 20") plot(ema200, color=color.red, title="EMA 200") // Visualización del RVI en el gráfico plot(rvi, color=color.green, title="RVI") hline(0, "Nivel 0", color=color.gray)