
이 전략은 슈퍼 트렌드 지표 (Supertrend) 를 기반으로 한 고급 거래 시스템으로, 트렌드 변화의 확인과 가격 행동에 대한 분석을 통해 시장의 매매 신호를 식별합니다. 이 전략은 동적인 트렌드 추적 메커니즘을 채택하고, 가격 돌파 검증과 결합하여 시장의 트렌드 전환점을 효과적으로 포착합니다.
전략의 핵심은 다음과 같은 핵심 요소에 기초합니다.
이 전략은 초상향 지표와 가격 행동 분석을 결합하여 비교적 신뢰할 수있는 거래 시스템을 구축합니다. 약간의 잠재적인 위험이 있지만, 제안된 최적화 방향은 전략의 안정성과 수익성을 더욱 향상시킬 수 있습니다. 전략의 성공적인 실행은 거래자가 시장 환경을 깊이 이해하고 실제 상황에 따라 파라미터를 조정하는 데 유연하게 조정해야합니다.
/*backtest
start: 2024-08-01 00:00:00
end: 2025-02-19 08:00:00
period: 1d
basePeriod: 1d
exchanges: [{"eid":"Binance","currency":"DOGE_USDT"}]
*/
//@version=5
strategy("Supertrend Strategy with Money Ocean Trade", overlay=true, default_qty_type=strategy.percent_of_equity, default_qty_value=100)
// Input parameters
supertrendLength = input.int(6, title="Supertrend Length")
supertrendFactor = input.float(0.25, title="Supertrend Factor")
// Supertrend calculation
[supertrend, direction] = ta.supertrend(supertrendFactor, supertrendLength)
// Plot Supertrend line
supertrendColor = direction == 1 ? color.green : color.red
plot(supertrend, title="Supertrend", color=supertrendColor, linewidth=2, style=plot.style_line)
// Variables to track trend change and candle break
var bool trendChanged = false
var float prevSupertrend = na
if (not na(prevSupertrend) and direction != nz(ta.valuewhen(prevSupertrend != supertrend, direction, 1)))
trendChanged := true
else
trendChanged := false
prevSupertrend := supertrend
longEntry = trendChanged and close[1] < supertrend[1] and close > supertrend
shortEntry = trendChanged and close[1] > supertrend[1] and close < supertrend
// Strategy execution
if (longEntry)
strategy.entry("Long", strategy.long)
if (shortEntry)
strategy.entry("Short", strategy.short)
// Plot entry signals on the chart
plotshape(series=longEntry, location=location.belowbar, color=color.green, style=shape.labelup, title="BUY")
plotshape(series=shortEntry, location=location.abovebar, color=color.red, style=shape.labeldown, title="SELL")
// Alerts
alertcondition(longEntry, title="Buy Signal", message="Buy Signal Triggered!")
alertcondition(shortEntry, title="Short Signal", message="Short Signal Triggered!")