
이것은 슈퍼 트렌드 지표 (Supertrend) 와 거래량 분석을 결합한 고급 정량화 거래 전략이다. 이 전략은 가격과 슈퍼 트렌드 라인의 교차와 거래량의 비정상적인 성능을 동적으로 모니터링하여 잠재적인 트렌드 전환점을 식별한다. 이 전략은 실제 파도 (ATR) 에 기반한 동적 스톱로스 및 수익 설정을 채택하여 거래의 유연성을 보장하고 위험 관리의 신뢰성을 제공합니다.
전략의 핵심 논리는 다음과 같은 핵심 요소에 기초합니다.
이 전략은 트렌드 이상 지표와 거래량 분석을 결합하여 신뢰성과 적응성을 겸비한 거래 시스템을 구축한다. 전략의 장점은 신호 확인의 다차원성과 위험 관리의 역동성이다. 그러나 여전히 전략의 성능에 대한 시장 환경의 영향을 주의해야 한다. 지속적인 최적화와 개선으로 전략은 다양한 시장 환경에서 안정적인 성능을 유지할 것으로 보인다.
/*backtest
start: 2019-12-23 08:00:00
end: 2024-12-11 08:00:00
period: 1d
basePeriod: 1d
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//@version=5
strategy("Supertrend with Volume Strategy", overlay=true)
// Input parameters for Supertrend
atrLength = input(10, title="ATR Length")
multiplier = input(3.0, title="Multiplier")
// Calculate Supertrend
[supertrend, direction] = ta.supertrend(multiplier, atrLength)
// Plot Supertrend
plot(supertrend, color=direction == 1 ? color.green : color.red, title="Supertrend")
// Volume condition
volumeThreshold = input(1.5, title="Volume Threshold (x Average)")
avgVolume = ta.sma(volume, 20) // 20-period average volume
highVolume = volume > (avgVolume * volumeThreshold)
// Define entry conditions
longCondition = ta.crossover(close, supertrend) and highVolume
shortCondition = ta.crossunder(close, supertrend) and highVolume
// Execute trades
if (longCondition)
strategy.entry("Long", strategy.long)
if (shortCondition)
strategy.entry("Short", strategy.short)
// Optional: Add stop loss and take profit
stopLoss = input(1.5, title="Stop Loss (in ATRs)")
takeProfit = input(3.0, title="Take Profit (in ATRs)")
if (longCondition)
strategy.exit("Take Profit/Stop Loss", from_entry="Long",
limit=close + (takeProfit * ta.atr(atrLength)),
stop=close - (stopLoss * ta.atr(atrLength)))
if (shortCondition)
strategy.exit("Take Profit/Stop Loss", from_entry="Short",
limit=close - (takeProfit * ta.atr(atrLength)),
stop=close + (stopLoss * ta.atr(atrLength)))