
이 전략은 ZigZag 지표와 Aroon 지표가 결합된 적응 거래 시스템이다. ZigZag 지표는 시장 소음을 필터링하고 중요한 가격 변동을 식별하는 데 사용되며, Aroon 지표는 트렌드의 강도와 잠재적인 반전을 확인하는 데 사용된다. 이 전략은 두 지표의 조화를 통해 트렌드에 민감성을 유지하면서 시장의 전환점을 적시에 잡을 수 있다.
전략의 핵심 논리는 다음과 같은 핵심 요소에 기초합니다.
이 전략은 ZigZag와 Aroon 지표를 결합하여 비교적 완전한 트렌드 추적 시스템을 구축한다. 전략의 장점은 자율 적응성과 이중 확인 메커니즘에 있다. 그러나 동시에 전략의 성능에 대한 파라미터 선택과 시장 환경의 영향을 고려해야 한다. 지속적인 최적화와 개선으로 전략은 실제 거래에서 안정적인 성능을 기대한다.
/*backtest
start: 2019-12-23 08:00:00
end: 2024-12-10 08:00:00
period: 1d
basePeriod: 1d
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//@version=5
strategy("Zig Zag + Aroon Strategy", overlay=true)
// Zig Zag parameters
zigzagDepth = input(5, title="Zig Zag Depth")
// Aroon parameters
aroonLength = input(14, title="Aroon Length")
// Zig Zag logic
var float lastZigZag = na
var float lastZigZagHigh = na
var float lastZigZagLow = na
var int direction = 0 // 1 for up, -1 for down
// Calculate Zig Zag
if (not na(high) and high >= ta.highest(high, zigzagDepth) and direction != 1)
lastZigZag := high
lastZigZagHigh := high
direction := 1
if (not na(low) and low <= ta.lowest(low, zigzagDepth) and direction != -1)
lastZigZag := low
lastZigZagLow := low
direction := -1
// Aroon calculation
highestHigh = ta.highest(high, aroonLength)
lowestLow = ta.lowest(low, aroonLength)
aroonUp = (aroonLength - (bar_index - ta.highestbars(high, aroonLength))) / aroonLength * 100
aroonDown = (aroonLength - (bar_index - ta.lowestbars(low, aroonLength))) / aroonLength * 100
// Long entry condition
longCondition = (ta.crossover(aroonUp, aroonDown)) and (lastZigZag == lastZigZagHigh)
if (longCondition)
strategy.entry("Long", strategy.long)
// Short entry condition
shortCondition = (ta.crossover(aroonDown, aroonUp)) and (lastZigZag == lastZigZagLow)
if (shortCondition)
strategy.entry("Short", strategy.short)
// Exit conditions
if (ta.crossover(aroonDown, aroonUp) and strategy.position_size > 0)
strategy.close("Long")
if (ta.crossover(aroonUp, aroonDown) and strategy.position_size < 0)
strategy.close("Short")
// Plot Zig Zag
plot(lastZigZag, color=color.blue, title="Zig Zag", linewidth=2, style=plot.style_stepline)
// Plot Aroon
hline(70, "Aroon Up Overbought", color=color.red)
hline(30, "Aroon Down Oversold", color=color.green)
plot(aroonUp, color=color.green, title="Aroon Up")
plot(aroonDown, color=color.red, title="Aroon Down")