
이 전략은 상대적으로 강한 지표 ((RSI) 를 기반으로 한 자동화 된 거래 시스템으로, 시장의 과매매 조건을 식별하여 잠재적인 반발 기회를 잡습니다. 이 전략은 점진적 인 포지션 구축 방식을 채택하고, RSI 낮은 지점이 교차 할 때 단계적으로 여러 포지션을 구축하고, 수익 목표를 설정하여 위험을 제어합니다. 시스템은 유연한 자금 관리 장치를 설계하여 매 거래 당 계좌 총액의 6.6%를 사용하며, 최대 15 개의 피라미드 포지션을 허용합니다.
전략의 핵심 논리는 다음과 같은 핵심 요소에 기초합니다.
이 전략은 RSI 지표를 통해 과매매 기회를 식별하고, 피라미드형 가축과 고정 비율을 결합하여 수익을 창출하며, 완전한 거래 시스템을 구축한다. 전략의 장점은 체계적인 운영과 위험 분산에 있다. 그러나 시장 추세와 매개 변수 설정이 전략의 성과에 미치는 영향을 주의해야 한다. 동적 매개 변수 조정, 손해 방지 장치 및 시장 필터링과 같은 최적화 조치를 추가함으로써 전략의 안정성과 수익성을 더욱 향상시킬 수 있다.
/*backtest
start: 2024-09-15 00:00:00
end: 2024-12-10 00:00:00
period: 1h
basePeriod: 1h
exchanges: [{"eid":"Binance","currency":"ETH_USDT"}]
*/
//@version=5
strategy("RSI Cross Under Strategy", overlay=true, initial_capital=1500, default_qty_type=strategy.percent_of_equity, default_qty_value=6.6)
// Input parameters
rsiLength = input(14, "RSI Length")
rsiOversold = input(28.5, "RSI Oversold Level")
profitTarget = input(900, "Profit Target (%)")
maxPyramiding = input(15, "Max Pyramiding")
// Calculate RSI
rsi = ta.rsi(close, rsiLength)
// Detect RSI crossunder
rsiCrossunder = ta.crossunder(rsi, rsiOversold)
// Calculate the profit target price
entryPrice = strategy.position_avg_price
targetPrice = entryPrice * (1 + profitTarget / 100)
// Buy condition
if (rsiCrossunder and strategy.position_size <= maxPyramiding * strategy.equity * 0.066)
strategy.entry("Buy", strategy.long)
// Take profit condition
if (strategy.position_size > 0 and high >= targetPrice)
strategy.close("Buy", qty_percent = 50)
// Plot buy signals
plotshape(rsiCrossunder, title="Buy Signal", location=location.belowbar, color=color.green, style=shape.triangleup, size=size.small)
// Plot sell signals (when position is partially closed)
plotshape(strategy.position_size > 0 and high >= targetPrice, title="Sell Signal", location=location.abovebar, color=color.red, style=shape.triangledown, size=size.small)
// Plot RSI
plot(rsi, "RSI", color=color.blue, linewidth=2)
hline(rsiOversold, "RSI Oversold", color=color.red, linestyle=hline.style_dashed)
// Plot entry and target prices
plot(strategy.position_size > 0 ? entryPrice : na, "Entry Price", color=color.green, linewidth=2, style=plot.style_linebr)
plot(strategy.position_size > 0 ? targetPrice : na, "Target Price", color=color.red, linewidth=2, style=plot.style_linebr)
// Display strategy information
var table infoTable = table.new(position.top_right, 3, 6, border_width=1)
table.cell(infoTable, 0, 0, "Strategy Info", bgcolor=color.blue, text_color=color.white)
table.cell(infoTable, 0, 1, "RSI Length: " + str.tostring(rsiLength))
table.cell(infoTable, 0, 2, "RSI Oversold: " + str.tostring(rsiOversold))
table.cell(infoTable, 0, 3, "Profit Target: " + str.tostring(profitTarget) + "%")
table.cell(infoTable, 0, 4, "Order Size: 6.6% of total")
table.cell(infoTable, 0, 5, "Max Pyramiding: " + str.tostring(maxPyramiding) + " times")