
이 전략은 피라미드 방식의 포지션 관리와 결합된 이중 기간 RSI(상대 강도 지수)를 기반으로 하는 추세 추종 거래 시스템입니다. 이 전략은 두 개의 다른 기간(14와 30)의 RSI 지표를 비교하고, 추세가 시작될 때 개입하여 추세가 지속되면 제한 주문을 통해 포지션을 늘려 추세를 최대한 파악합니다. 이 시스템은 포지션 관리 및 동적 청산 조건을 포함한 완벽한 위험 관리 메커니즘을 갖추고 설계되었습니다.
이 전략은 이중 기간 RSI 교차 신호를 거래 트리거 조건으로 사용하고 이를 피라미드 스타일의 포지션 관리와 결합합니다. 구체적으로:
이 전략은 이중 기간 RSI와 피라미드 스타일의 포지션 추가를 결합하여 추세를 잘 파악합니다. 이 전략은 진입, 포지션 증가, 손절매 및 포지션 관리 등의 핵심 요소를 포함한 완전한 거래 시스템을 설계합니다. 매개변수 최적화와 위험 관리 개선을 통해 이 전략은 실제 거래에서 안정적인 성과를 달성할 것으로 기대됩니다. 실제 거래에 매개변수를 사용하기 전에 거래자는 특정 시장 특성에 따라 매개변수를 완전히 테스트하고 조정하는 것이 좋습니다.
/*backtest
start: 2024-12-17 00:00:00
end: 2025-01-16 00:00:00
period: 3h
basePeriod: 3h
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT","balance":49999}]
*/
//@version=5
strategy("RSI Top Strategy", overlay=true, pyramiding=2)
qty1 = input( 1 , "Qty first entry", group="Strategy settings")
qty2 = input( 1 , "Qty second entry", group="Strategy settings")
avg1 = input.float( 1.5 , "% averaging ", group="Strategy settings")
overSold = input( 30 , group="open RSI Settings")
overBought = input( 70 , group="open RSI Settings")
rsi1len = input.int(14, minval=1, title="open RSI Length", group="open RSI Settings")
overSold2 = input( 30 , group="close RSI Settings")
overBought2 = input( 70 , group="close RSI Settings")
rsi2len = input.int(30, minval=1, title="close RSI Length", group="close RSI Settings")
price = close
vrsi = ta.rsi(price, rsi1len)
vrsi2 = ta.rsi(price, rsi2len)
sz=strategy.position_size
co = ta.crossover(vrsi, overSold)
cu = ta.crossunder(vrsi, overBought)
if (not na(vrsi))
if (co) and not (sz>0)
strategy.entry("Long", strategy.long, qty = qty1, comment="Long")
Avgl=close-close*0.01*avg1
strategy.entry("AvgL", strategy.long, qty = qty2, limit=Avgl, comment="AvgL")
if (cu) and not (sz<0)
strategy.entry("Short", strategy.short, qty = qty1, comment="Short")
Avgs=close+close*0.01*avg1
strategy.entry("AvgS", strategy.short, qty = qty2, limit=Avgs, comment="AvgS")
//plot(strategy.equity, title="equity", color=color.red, linewidth=2, style=plot.style_areabr)
if sz[1]<0 and sz<0 and vrsi2<overBought2 and vrsi2[1]>=overBought2
strategy.close_all("x")
if sz[1]>0 and sz>0 and vrsi2>overSold2 and vrsi2[1]<=overSold2
strategy.close_all("x")
plot(vrsi,'open rsi',color=color.green)
plot(vrsi2,'close rsi',color=color.red)
hline(overBought, "RSI Upper Band", color=#787B86)
hline(overSold, "RSI Upper Band", color=#787B86)