
이 전략은 G채널, RSI 및 MACD 지표가 결합된 고급 트렌드 추적 거래 시스템입니다. 동적으로 지원 및 저항 영역을 계산하여 동력 지표와 결합하여 높은 확률의 거래 기회를 식별합니다. 전략의 핵심은 사용자 정의 된 G채널 지표를 사용하여 시장 추세를 확인하고 RSI와 MACD를 사용하여 동력 변화를 확인하여 더 정확한 거래 신호를 생성하는 것입니다.
전략은 트레이딩 신호의 신뢰성을 보장하기 위해 3가지의 필터링 메커니즘을 사용한다. 첫째, G 채널은 지정된 주기 내의 최고 및 최저 가격을 계산하여 지지부진과 저항 영역을 동적으로 구성한다. 두 번째, RSI 지표는 시장이 과매 또는 과매매 상태인지 확인하는 데 사용되며, 더 가치있는 거래 기회를 필라하는 데 도움이 된다. 마지막으로, MACD 지표는 기둥 그래프의 긍정적 인 마이너스를 통해 동력의 방향과 강도를 확인한다.
이 전략은 여러 가지 기술 지표를 통합하여 전체적인 거래 시스템을 구축합니다. 핵심 장점은 다차원 신호 확인 장치와 완벽한 위험 관리 시스템입니다. 지속적인 최적화 및 개선으로 전략은 다양한 시장 환경에서 안정적인 성능을 유지할 수 있습니다. 거래자는 실제 거래 전에 다양한 파라미터 조합을 충분히 테스트하고 특정 시장 특성에 따라 적절하게 조정하는 것이 좋습니다.
/*backtest
start: 2024-11-19 00:00:00
end: 2024-12-18 08:00:00
period: 1h
basePeriod: 1h
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//@version=6
strategy("VinSpace Optimized Strategy", shorttitle="VinSpace Magic", overlay=true, default_qty_type=strategy.percent_of_equity, default_qty_value=10)
// Input Parameters
length = input.int(100, title="Length")
src = input(close, title="Source")
stop_loss_pct = input.float(1, title="Stop Loss (%)") / 100
take_profit_pct = input.float(3, title="Take Profit (%)") / 100
rsi_length = input.int(14, title="RSI Length")
rsi_overbought = input.int(70, title="RSI Overbought")
rsi_oversold = input.int(30, title="RSI Oversold")
macd_short = input.int(12, title="MACD Short Length")
macd_long = input.int(26, title="MACD Long Length")
macd_signal = input.int(9, title="MACD Signal Length")
// ---- G-Channel Calculations ----
var float a = na
var float b = na
a := math.max(src, na(a[1]) ? src : a[1]) - (na(a[1]) ? 0 : (a[1] - b[1]) / length)
b := math.min(src, na(b[1]) ? src : b[1]) + (na(a[1]) ? 0 : (a[1] - b[1]) / length)
avg = (a + b) / 2
// ---- RSI Calculation ----
rsi = ta.rsi(src, rsi_length)
// ---- MACD Calculation ----
[macdLine, signalLine, _] = ta.macd(src, macd_short, macd_long, macd_signal)
macd_hist = macdLine - signalLine
// ---- Trend Detection Logic ----
crossup = b[1] < close[1] and b > close
crossdn = a[1] < close[1] and a > close
bullish = ta.barssince(crossdn) <= ta.barssince(crossup)
c = bullish ? color.new(color.green, 0) : color.new(color.red, 0)
// Plotting the Average
p1 = plot(avg, "Average", color=c, linewidth=2)
p2 = plot(close, "Close price", color=c, linewidth=1)
// Adjusted fill with transparency
fill(p1, p2, color=color.new(c, 90))
// ---- Buy and Sell Signals ----
showcross = input(true, title="Show Buy/Sell Labels")
plotshape(showcross and bullish and not bullish[1], location=location.belowbar, style=shape.labelup, color=color.green, size=size.small, text="Buy", textcolor=color.white, offset=-1)
plotshape(showcross and not bullish and bullish[1], location=location.abovebar, style=shape.labeldown, color=color.red, size=size.small, text="Sell", textcolor=color.white, offset=-1)
// ---- Entry and Exit Conditions ----
enterLong = bullish and rsi < rsi_oversold and macd_hist > 0
enterShort = not bullish and rsi > rsi_overbought and macd_hist < 0
// Exit Conditions
exitLong = ta.crossunder(close, avg) or rsi > rsi_overbought
exitShort = ta.crossover(close, avg) or rsi < rsi_oversold
// Position Size (example: 10% of equity)
posSize = 1
// Submit Entry Orders
if enterLong
strategy.entry("EL", strategy.long, qty=posSize)
if enterShort
strategy.entry("ES", strategy.short, qty=posSize)
// Submit Exit Orders
if exitLong
strategy.close("EL")
if exitShort
strategy.close("ES")
// Set Stop Loss and Take Profit for the trades
strategy.exit("Take Profit/Stop Loss Long", from_entry="EL", loss=stop_loss_pct * close, profit=take_profit_pct * close)
strategy.exit("Take Profit/Stop Loss Short", from_entry="ES", loss=stop_loss_pct * close, profit=take_profit_pct * close)