
이 전략은 다중 기술 지표의 결합 된 정량 거래 시스템입니다. 이동 평균 ((MA), 상대적으로 강한 지표 ((RSI) 및 이동 평균 동향 분산 ((MACD) 의 세 가지 클래식 기술 지표의 협동 조합을 통해 전체적인 거래 신호 시스템을 구축합니다. 전략은 트렌드 추적과 동력 인식이 결합 된 방식을 채택합니다. 거래 방향을 올바르게 보장하는 동시에 기회의 포착에 중점을 둡니다.
이 전략은 다음의 세 가지 차원에 기반하여 거래 신호를 구성합니다.
구체적으로, 빠른 평균선 ((50일) 상에서 느린 평균선 ((200일) 을 뚫고 금포크가 형성될 때, 동시에 RSI가 초매 수준을 달성하지 못하고 MACD가 금포크를 형성할 때, 시스템은 더 많은 신호를 발생시킨다. 반대로, 사각지대가 발생하고 RSI가 초매 수준을 달성하지 못하고 MACD가 사각지대를 형성할 때, 시스템은 공백 신호를 발생시킨다.
이 전략은 여러 기술 지표의 협동 협동으로 비교적 완전한 거래 시스템을 구축한다. 전략은 추세가 뚜렷한 시장에서 잘 작동하지만 실제 시장 상황에 따라 최적화된 조정이 필요하다. 거래자는 실장에서 사용 할 때 먼저 충분한 피드백 검증을 실시하고 자신의 위험 용량에 따라 매개 변수를 조정하는 것이 좋습니다. 전략의 핵심 장점은 체계화된 신호 생성 메커니즘과 완벽한 위험 제어 시스템으로 이루어져 있으며, 이는 실제 실전 응용 가치에 있습니다.
/*backtest
start: 2024-06-01 00:00:00
end: 2025-02-18 08:00:00
period: 1h
basePeriod: 1h
exchanges: [{"eid":"Binance","currency":"ETH_USDT"}]
*/
// This Pine Script™ code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © EthioTrader
//@version=5
strategy("Optimal Multi-Indicator Strategy", overlay=true, initial_capital=10000, default_qty_type=strategy.percent_of_equity, default_qty_value=10, commission_type=strategy.commission.percent, commission_value=0.1)
// ===== Input Parameters =====
// Moving Averages
fastMA = ta.sma(close, 50)
slowMA = ta.sma(close, 200)
plot(fastMA, "Fast MA", color=color.green)
plot(slowMA, "Slow MA", color=color.red)
// RSI
rsiLength = input(14, "RSI Length")
rsiOverbought = input(70, "RSI Overbought")
rsiOversold = input(30, "RSI Oversold")
rsi = ta.rsi(close, rsiLength)
// MACD
[macdLine, signalLine, _] = ta.macd(close, 12, 26, 9)
// Risk Management
stopLossPerc = input(2.0, "Stop Loss (%)") / 100
takeProfitPerc = input(4.0, "Take Profit (%)") / 100
trailingStopPerc = input(1.0, "Trailing Stop (%)") / 100
// ===== Strategy Logic =====
// Trend Condition: Golden Cross (Fast MA > Slow MA)
bullishTrend = ta.crossover(fastMA, slowMA)
bearishTrend = ta.crossunder(fastMA, slowMA)
// Momentum Condition: RSI and MACD
bullishMomentum = rsi < rsiOverbought and ta.crossover(macdLine, signalLine)
bearishMomentum = rsi > rsiOversold and ta.crossunder(macdLine, signalLine)
// Entry Signals
longCondition = bullishTrend and bullishMomentum
shortCondition = bearishTrend and bearishMomentum
// Exit Signals
trailingStop = strategy.position_avg_price * (1 - trailingStopPerc)
exitLong = ta.crossunder(close, trailingStop) or (close >= strategy.position_avg_price * (1 + takeProfitPerc))
exitShort = ta.crossover(close, trailingStop) or (close <= strategy.position_avg_price * (1 - takeProfitPerc))
// ===== Execute Orders =====
if (longCondition)
strategy.entry("Long", strategy.long)
strategy.exit("Exit Long", "Long", stop=strategy.position_avg_price * (1 - stopLossPerc), limit=strategy.position_avg_price * (1 + takeProfitPerc), trail_price=trailingStop, trail_offset=trailingStopPerc * close)
if (shortCondition)
strategy.entry("Short", strategy.short)
strategy.exit("Exit Short", "Short", stop=strategy.position_avg_price * (1 + stopLossPerc), limit=strategy.position_avg_price * (1 - takeProfitPerc), trail_price=trailingStop, trail_offset=trailingStopPerc * close)
// ===== Plotting =====
plotshape(series=longCondition, title="Buy Signal", location=location.belowbar, color=color.green, style=shape.labelup, text="BUY")
plotshape(series=shortCondition, title="Sell Signal", location=location.abovebar, color=color.red, style=shape.labeldown, text="SELL")