
이 전략은 가격 형태와 기술 지표의 결합에 기반한 정량 거래 시스템이다. 그것은 주로 삼각형 형태의 돌파구를 식별하고 RSI 지표의 동력 확인과 결합하여 거래를 수행한다. 전략은 선형 회귀 방법을 사용하여 상하 트렌드 라인을 구성하고 가격 돌파구와 RSI 위치를 통해 거래 신호를 결정하며, 형태 분석과 동력 분석의 유기적 결합을 실현한다.
전략의 핵심 논리는 두 가지 주요 부분으로 구성됩니다. 삼각형 모양 인식 및 RSI 동력 확인. 첫째, 선형 회귀 방법을 사용하여 최근 N 주기의 고점과 낮은 점을 계산하여 상향 트렌드 라인을 구성하여 삼각형 모양을 만듭니다. 가격이 상향 트렌드 라인을 깨고 RSI가 50보다 크면 다중 신호를 유발하고, 가격이 하향 트렌드 라인을 깨고 RSI가 50보다 작으면 공백 신호를 유발합니다.
삼각형 돌파구 결합 RSI 동력 전략은 구조가 완전하고, 논리가 명확한 정량 거래 시스템이다. 형태와 동력의 이중 확인 메커니즘을 통해 거래 신호의 신뢰성을 효과적으로 향상시킨다. 비록 일정한 위험이 존재하지만, 합리적인 매개 변수 최적화 및 위험 제어 조치를 통해 이 전략은 좋은 실용적 가치를 가지고 있다. 실내에서 사용 할 때 거래자는 특정 시장 특성에 따라 충분한 매개 변수 최적화 및 재검증을 수행하는 것이 좋습니다.
/*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("Triangle Breakout with RSI", overlay=true)
// Input parameters
len = input.int(15, title="Triangle Length")
rsiPeriod = input.int(14, title="RSI Period")
rsiThresholdBuy = input.int(50, title="RSI Threshold for Buy")
rsiThresholdSell = input.int(50, title="RSI Threshold for Sell")
// Calculate the RSI
rsi = ta.rsi(close, rsiPeriod)
// Calculate highest high and lowest low for triangle pattern
highLevel = ta.highest(high, len)
lowLevel = ta.lowest(low, len)
// Create trendlines for the triangle
upperTrend = ta.linreg(high, len, 0)
lowerTrend = ta.linreg(low, len, 0)
// Plot the trendlines on the chart
plot(upperTrend, color=color.green, linewidth=2, title="Upper Trendline")
plot(lowerTrend, color=color.red, linewidth=2, title="Lower Trendline")
// Detect breakout conditions
breakoutUp = close > upperTrend
breakoutDown = close < lowerTrend
// Confirm breakout with RSI
buyCondition = breakoutUp and rsi > rsiThresholdBuy
sellCondition = breakoutDown and rsi < rsiThresholdSell
// Plot breakout signals with confirmation from RSI
plotshape(series=buyCondition, title="Buy Signal", location=location.belowbar, color=color.green, style=shape.labelup, size=size.small)
plotshape(series=sellCondition, title="Sell Signal", location=location.abovebar, color=color.red, style=shape.labeldown, size=size.small)
// Strategy: Buy when triangle breaks upwards and RSI is above 50; Sell when triangle breaks downwards and RSI is below 50
if (buyCondition)
strategy.entry("Buy", strategy.long)
if (sellCondition)
strategy.entry("Sell", strategy.short)
// Plot RSI on the bottom pane
hline(50, "RSI 50 Level", color=color.gray, linestyle=hline.style_dotted)
plot(rsi, color=color.blue, linewidth=2, title="RSI")