
이 전략은 시장 추세, 동력, 변동률의 3차원 분석을 결합한 다중 지표 융합 트렌드 추적 거래 시스템이다. 핵심 논리는 하나의 구름 지표 (이치모쿠 클라우드) 를 통해 시장 추세를 판단하고, MACD 직선 도표 (MACD 직선 도표) 는 동력을 확인하고, 브린 밴드 폭 (Bollinger Band Width) 은 시장 변동 상태를 필터링하며, 주 일선 수준의 트렌드 확인 메커니즘을 도입하고, 마지막으로 ATR 기반의 동적 손실을 통해 위험을 관리한다.
전략은 여러 층의 신호 필터링 메커니즘을 사용합니다. 첫째, 시장의 큰 흐름을 결정하기 위해 구름 지표의 선도 간격 A와 B를 사용하여 가격이 구름 위에 있거나 아래에 있는지 판단합니다. 둘째, MACD 직선 도표를 사용하여 운동량의 강도를 판단합니다. 상반기 직선 도표가 -0.05보다 크고, 상반기 공백은 0보다 작습니다. 세 번째는 더 큰 수준의 추세 방향을 확인하기 위해 주파수 시간 주기 50 주기 평균선을 도입합니다. 넷째, 브린 대역폭 지표 필터링 낮은 변동률 행태를 사용하여 0.02보다 넓은 폭에서만 포지션을 개시합니다.
이 전략은 다차원 지표 융합과 다중 시간 주기 분석을 통해 완전한 트렌드 추적 시스템을 구축하고, 동적 위험 관리 메커니즘을 갖추고 있다. 재측량 성능이 우수하지만, 시장 환경 변화에 따른 위험에 주의를 기울여야 하며, 실물에서 신중하게 검증하고 지속적으로 최적화하는 것이 좋습니다.
/*backtest
start: 2024-11-01 00:00:00
end: 2025-02-19 08:00:00
period: 2d
basePeriod: 2d
exchanges: [{"eid":"Binance","currency":"ETH_USDT"}]
*/
// This Pine Script™ code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © FIWB
//@version=6
strategy("Momentum Edge Strategy - 1D BTC Optimized", overlay=true)
// --- Input Parameters ---
atrLength = input.int(14, title="ATR Length")
atrMultiplier = input.float(1.5, title="ATR Multiplier")
bbWidthThreshold = input.float(0.02, title="Bollinger Band Width Threshold")
// --- Ichimoku Cloud ---
conversionLine = (ta.highest(high, 9) + ta.lowest(low, 9)) / 2
baseLine = (ta.highest(high, 26) + ta.lowest(low, 26)) / 2
leadingSpanA = (conversionLine + baseLine) / 2
leadingSpanB = (ta.highest(high, 52) + ta.lowest(low, 52)) / 2
priceAboveCloud = close > leadingSpanA and close > leadingSpanB
priceBelowCloud = close < leadingSpanA and close < leadingSpanB
// --- MACD Histogram ---
[_, _, macdHistogram] = ta.macd(close, 12, 26, 9)
// --- Multi-Timeframe Trend Confirmation ---
higherTFTrend = request.security(syminfo.tickerid, "W", close > ta.sma(close, 50))
// --- Bollinger Band Width ---
bbBasis = ta.sma(close, 20)
bbUpper = bbBasis + 2 * ta.stdev(close, 20)
bbLower = bbBasis - 2 * ta.stdev(close, 20)
bbWidth = (bbUpper - bbLower) / bbBasis
// --- ATR-based Stop Loss ---
atrValue = ta.atr(atrLength)
highestHigh = ta.highest(high, atrLength)
lowestLow = ta.lowest(low, atrLength)
longStopLoss = bbWidth < bbWidthThreshold ? lowestLow : close - atrValue * atrMultiplier
shortStopLoss= bbWidth < bbWidthThreshold ? highestHigh : close + atrValue * atrMultiplier
// --- Entry Conditions ---
longCondition = priceAboveCloud and macdHistogram > -0.05 and higherTFTrend and bbWidth > bbWidthThreshold
shortCondition = priceBelowCloud and macdHistogram < 0 and not higherTFTrend and bbWidth > bbWidthThreshold
// --- Strategy Execution ---
if longCondition
strategy.entry("Long", strategy.long)
strategy.exit("Exit Long", from_entry="Long", stop=longStopLoss)
if shortCondition
strategy.entry("Short", strategy.short)
strategy.exit("Exit Short", from_entry="Short", stop=shortStopLoss)
// --- Plotting ---
plot(leadingSpanA, color=color.new(color.green, 80), title="Leading Span A")
plot(leadingSpanB, color=color.new(color.red, 80), title="Leading Span B")
plotshape(series=longCondition ? close : na, title="Long Signal", location=location.belowbar, color=color.green)
plotshape(series=shortCondition ? close : na, title="Short Signal", location=location.abovebar, color=color.red)