
이 전략은 지수 이동 평균 (EMA) 과 그래프 형태를 결합한 동적 트렌드 추적 시스템이다. 특정 그래프 형태를 식별함으로써 시장의 흐름을 확인하고, 빠른 및 느린 EMA 지표와 결합하여 시장의 변동성을 측정하기 위해 ATR 지표를 사용합니다. 전략의 핵심 아이디어는 시장의 추세가 확인되는 경우, 그래프 형태를 통해 정확한 진입 시기를 식별하는 것입니다.
이 전략은 세 가지 핵심 요소로 구성되어 있습니다.
진입 조건은 엄격하게 트렌드와 형태를 함께 확인하는 것을 요구합니다: 다중 입장은 시장이 상승 추세에있는 동시에 다중 차트 형태를 볼 필요가 있습니다. 공허 입장은 시장이 하락 추세에있는 동시에 공허 차트 형태를 볼 필요가 있습니다.
이것은 잘 구성된 트렌드 추적 전략으로, 여러 가지 기술적 분석 도구를 결합하여 비교적 신뢰할 수있는 거래 시스템을 제공합니다. 현재의 버전에는 개선해야 할 부분이 있지만, 핵심 논리는 합리적입니다. 권장된 최적화 조치를 실행하면이 전략은 더 나은 거래 시스템으로 발전할 가능성이 있습니다. 특히 트렌딩 시장에서 전략은 더 잘 작동 할 수 있습니다.
/*backtest
start: 2024-02-21 00:00:00
end: 2025-02-19 00:00:00
period: 1h
basePeriod: 1h
exchanges: [{"eid":"Binance","currency":"ETH_USDT"}]
*/
//@version=6
strategy("Candlestick Bible: Dynamic Price Follower (Corrected)", overlay=true, pyramiding=0, initial_capital=10000, default_qty_type=strategy.percent_of_equity, default_qty_value=100)
//=======================
// 1. PATTERN DETECTION
//=======================
// Pin Bar Detection
bodySize = math.abs(close - open)
upperShadow = high - math.max(close, open)
lowerShadow = math.min(close, open) - low
isBullishPin = (lowerShadow >= 2 * bodySize) and (upperShadow <= bodySize / 2)
isBearishPin = (upperShadow >= 2 * bodySize) and (lowerShadow <= bodySize / 2)
// Engulfing Pattern
isBullishEngulf = (close[1] < open[1]) and (close > open) and (close > open[1]) and (open < close[1])
isBearishEngulf = (close[1] > open[1]) and (close < open) and (close < open[1]) and (open > close[1])
//=======================
// 2. DYNAMIC TREND SYSTEM
//=======================
emaFast = ta.ema(close, 8)
emaSlow = ta.ema(close, 21)
marketTrend = emaFast > emaSlow ? "bullish" : "bearish"
//=======================
// 3. PRICE MOVEMENT SYSTEM
//=======================
atr = ta.atr(14)
//=======================
// 4. STRATEGY RULES
//=======================
longCondition = (isBullishPin or isBullishEngulf) and marketTrend == "bullish" and close > emaSlow
shortCondition = (isBearishPin or isBearishEngulf) and marketTrend == "bearish" and close < emaSlow
//=======================
// 5. STRATEGY ENTRIES
//=======================
if longCondition
strategy.entry("Long", strategy.long)
if shortCondition
strategy.entry("Short", strategy.short)
//=======================
// 6. VISUAL FEEDBACK
//=======================
plot(emaFast, "Fast EMA", color=color.blue)
plot(emaSlow, "Slow EMA", color=color.red)
plotshape(longCondition, "Long Signal", shape.triangleup, location.belowbar, color=color.green, size=size.small)
plotshape(shortCondition, "Short Signal", shape.triangledown, location.abovebar, color=color.red, size=size.small)