
이 전략은 다중 주기 이동 평균, RSI 오버 바이 오버 세 신호와 가격 형태를 식별하는 통합 거래 시스템이다. 이 전략은 주로 빠른 이동 평균과 느린 이동 평균의 교차, RSI 지표의 오버 바이 오버 세 영역 판단, 그리고 부어, 부어 침수 형태를 통해 시장 추세 전환점을 포착하여 거래를 발생시킨다. 이 전략은 백분율 포지션 관리 방식을 채택하고, 매 거래마다 10%의 계좌 자금을 사용한다. 이 방법은 더 나은 위험 통제를 달성하는 데 도움이 된다.
이 전략의 핵심 논리는 다음과 같은 핵심 요소에 기반합니다.
이것은 합리적이고 논리적으로 명확하게 설계된 통합 기술 분석 거래 전략이다. 여러 기술 지표와 가격 형태를 결합함으로써, 전략은 신호 신뢰성을 보장하는 동시에, 또한 더 나은 위험 관리를 실현한다. 일부 고유 한 한계가 있지만, 제안 된 최적화 방향을 통해 전략의 전반적인 성능이 더 향상될 전망이다. 사용자는 실제 응용에서 파라미터 최적화 및 시장 환경에 적응하는 데 주의를 기울여야합니다. 최적의 거래 효과를 달성하기 위해.
/*backtest
start: 2019-12-23 08:00:00
end: 2024-12-04 00:00:00
period: 1d
basePeriod: 1d
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//@version=5
strategy("Comprehensive Trading Strategy", overlay=true, default_qty_type=strategy.percent_of_equity, default_qty_value=10)
// Input parameters for moving averages
fastLength = input.int(9, title="Fast MA Length")
slowLength = input.int(21, title="Slow MA Length")
rsiLength = input.int(14, title="RSI Length")
rsiOverbought = input.int(70, title="RSI Overbought Level")
rsiOversold = input.int(30, title="RSI Oversold Level")
// Calculate moving averages
fastMA = ta.sma(close, fastLength)
slowMA = ta.sma(close, slowLength)
// Calculate RSI
rsi = ta.rsi(close, rsiLength)
// Detect price action patterns (e.g., engulfing patterns)
isBullishEngulfing = close > open and close[1] < open[1] and open < close[1] and close > open[1]
isBearishEngulfing = close < open and close[1] > open[1] and open > close[1] and close < open[1]
// Define conditions for buying and selling
buyCondition = ta.crossover(fastMA, slowMA) and rsi < rsiOversold or isBullishEngulfing
sellCondition = ta.crossunder(fastMA, slowMA) and rsi > rsiOverbought or isBearishEngulfing
// Execute buy and sell orders
if (buyCondition)
strategy.entry("Buy", strategy.long)
if (sellCondition)
strategy.entry("Sell", strategy.short)
// Plotting
plot(fastMA, color=color.blue, linewidth=2, title="Fast MA")
plot(slowMA, color=color.orange, linewidth=2, title="Slow MA")
hline(rsiOverbought, "RSI Overbought", color=color.red)
hline(rsiOversold, "RSI Oversold", color=color.green)
plot(rsi, color=color.purple, linewidth=1, title="RSI")
// Alert conditions
alertcondition(buyCondition, title="Buy Signal", message="Price meets buy criteria")
alertcondition(sellCondition, title="Sell Signal", message="Price meets sell criteria")
// Plot signals on chart
plotshape(series=buyCondition ? low : na, location=location.belowbar, color=color.green, style=shape.triangleup, size=size.small, title="Buy Signal")
plotshape(series=sellCondition ? high : na, location=location.abovebar, color=color.red, style=shape.triangledown, size=size.small, title="Sell Signal")