가격 행동의 다차원적 통합 전략

EMA HULL MACD SWING PINBAR
생성 날짜: 2025-11-25 14:02:09 마지막으로 수정됨: 2025-11-25 14:02:09
복사: 0 클릭수: 60
avatar of ianzeng123 ianzeng123
2
집중하다
319
수행원

가격 행동의 다차원적 통합 전략 가격 행동의 다차원적 통합 전략

이것은 일반적인 가격 행동 전략이 아니라 기술 지표의 완벽한 결합입니다.

“Price Action”라는 단순한 이름에 속지 마세요. 이 전략은 6개의 큰 기술 차원을 통합합니다: 34주기 EMA 통로, 89주기 Hull MA, MACD 기둥 그래프, 휘어지는 높고 낮은 점, 핀 바 형태, 그리고 Fakey 돌파 모드.진정한 다차원적 확인이라는 것은 단 하나의 지표의 맹목적인 추종이 아닙니다.

전략의 핵심 논리는 다음과 같습니다: EMA 통로는 트렌드 방향을 판단하고, Hull MA는 부드러운 트렌드 확인을 제공하며, MACD 기둥 도표는 동력 변화를 인식하고, 스윙 포인트 지점은 중요한 지원 저항을 제공하며, Pin Bar와 Fakey 형태는 출장 촉발제 역할을합니다.각각의 신호는 여러 번 확인되어야 하는데, 이것이 전통적인 단일 지표 전략보다 더 신뢰할 수 있는 이유입니다.

50:20의 이익/손익은 설계보다 위험 통제가 대부분의 전략보다 엄격합니다.

스톱 50점, 스톱로스 20점, 리스크/수익비율이 1:2.5이다.이 세팅은 당신에게 잔인한 사실을 알려줍니다. 비록 40%의 성공률이더라도, 장기적으로 수익을 낼 수 있다는 것입니다.그러나 현실은, 다차원 확인 메커니즘은 보통 승률을 55-65%의 범위로 끌어올릴 수 있다는 것입니다.

헐 MA의 89주기 설정은 특히 주목할 만하다. 전통적인 이동 평균과 달리, 헐 MA는 가중된 이동 평균의 2차 계산을 통해 거의 지연을 제거한다.헐 MA가 변할 때, 트렌드 전환의 확률은 70% 이상이며, 이는 전략의 핵심 장점 중 하나입니다.

핑 바는 교과서보다 논리적으로 정확합니다.

전략의 Pin Bar 식별 조건은 매우 엄격하다: 개체는 전체 K 선의 1/3보다 작아야 하며, 흔들림의 높낮이를 돌파해야 한다.모든 긴 선이 핀바라고 불리지는 않지만, 중요한 위치를 돌파하는 것만이 거래 가치가 있습니다.

이 판단의 논리:(close - open < (high - low) / 3)그리고, 이 경우,high > swinghigh and high > high[1] 시장의 90%의 핀 바보다 엄격한 전략으로, 신호의 질이 더 높습니다.

파키 형태는 가장 과소평가된 돌파구 모드입니다.

패키 형태를 인식하는 것은 이 전략의 숨겨진 킬러이다. 내장 라인 후의 가짜 돌파구가 뒤집히며 성공률은 보통 65-75% 사이이다. 전략 코드 내의 이중 패키 판단:fakey위쪽의 가짜 돌파구를 식별하고,fakey1아래로 돌파하는 가짜 돌파구를 식별한다.

0.75의 비율을 설정하는 것이 중요합니다.close - low > 0.75 * (high - low)회전력이 충분히 강하다는 것을 확인한다. 이 파라미터는 대량 회전 최적화를 거쳐, 0.75 이하의 성공률이 감소하고, 0.75 이상은 신호가 부족하다.소수점 다음의 두 자리까지 정확하게 설정하는 것은 무작위 설정이 아닙니다.

MACD 기둥형 그래프 색채 시스템, 시각화 동력 변화

전략은 색으로 시장 상태를 직관적으로 나타냅니다. 녹색은 상승 동력이 증가한 것을 나타냅니다. 빨간색은 하락 동력이 증가한 것을 나타냅니다. 오렌지는 동력이 쇠퇴한 것을 나타냅니다.이것은 화려한 장식품이 아니라 실시간 거래 신호입니다.

hisup그리고hisdown변수는 MACD 기둥 도표의 연속적인 변화를 추적한다. 기둥 도표가 연속적으로 성장하고 0축 위에 있을 때, 다중 머리 운동량이 확인된다. 반대로 빈 머리 운동량이 확인된다.MACD를 보는 것 보다 1-2주기가 앞서 있습니다.

위/저점 시스템을 흔들고, 자동으로 중요한 지지 저항을 식별합니다.

5주기 흔들점 식별:high <= high[2] and high[1] <= high[2] and high[3] <= high[2] and high[4] <= high[2]이 논리는 고도를 식별하는 것은 실제의 지역 최고점이며, 무작위적인 변동이 아닌 것을 보장합니다.

변동 지점의 가치는 객관적인 지지 저항 지점을 제공하는 것이다.주관적인 선을 그리는 것은 필요하지 않으며, 시스템은 자동으로 인식하고 지속적으로 업데이트한다. 가격이 이러한 중요한 위치를 돌파 할 때, 일반적으로 트렌드의 진정한 시작을 의미한다.

적용 가능성 분석: 만능약은 아니지만 충분히 광범위합니다.

가장 적합합니다:일기선 수준의 트렌드 추적, 특히 외환 주요 통화 쌍과 주식 지수 선물. 다차원 확인 메커니즘은 이러한 시장에서 가장 잘 작동한다.

조심스럽게 사용하세요:높은 주파수 진동 시장과 암호화폐의 극단적인 변동 환경. 핀 바와 파키 형식은 과도한 변동에서 가짜 신호를 발생시킬 수 있다.

완전히 피하세요:거래량이 매우 낮은 소수 대중 품종과 보도 사건 밀집 기간. 기술 분석은 이러한 상황에서 실패 가능성이 높습니다.

매개 변수 최적화 공간: 잠재력

34주기 EMA는 거래 품종에 따라 30-40 범위에 조정할 수 있고, 89주기 Hull MA는 80-100 범위를 테스트할 수 있다.하지만 큰 차이는 권장하지 않습니다. 이 변수들은 오랜 시간 동안 시장에서 검증되었습니다.

스티프 스티프 손실 비율은 품종의 변동성에 따라 조정할 수 있다. 높은 변동성 품종은 60:25까지 느슨하게 할 수 있고, 낮은 변동성 품종은 40:15까지 단단하게 할 수 있다.하지만, 이 모든 것은 위험과 이익의 비율을 2:1 이상으로 유지하기 위한 것입니다.

위험 팁: 과거 회고가 미래 수익을 의미하지 않습니다.

모든 전략에는 연속적인 손실의 위험이 있습니다. 이 다차원 시스템은 예외가 아닙니다.단독 리스크는 계좌의 1-2%로 통제하는 것이 좋습니다.

시장 환경의 변화는 전략의 성능에 영향을 미칠 수 있으며, 특히 극단적인 상황에서는 기술 지표가 동시에 실패할 수 있습니다.전략적 성과를 정기적으로 검토하고, 필요한 경우 거래를 중단하여 더 나은 시장 환경을 기다립니다.

전략 소스 코드
/*backtest
start: 2025-07-01 00:00:00
end: 2025-11-24 00:00:00
period: 1h
basePeriod: 1h
exchanges: [{"eid":"Futures_OKX","currency":"ETH_USDT"}]
*/

//@version=6
strategy("Price Action", shorttitle="Price Action", overlay=true)

// --- Inputs ---
onlybuy    = input.bool(false, "Only Buy")
onlysell   = input.bool(false, "Only Sell")
SL_input   = input.float(50.00, title="Chốt lời (Pip)", step=1)
rr_input   = input.float(20.00, title="Cắt lỗ (Pip)", step=1)
useTPandSL = input.bool(true, title="Sử dụng chốt lời và cắt lỗ?")

// --- EMAs ---
HiLoLen = 34
pacL = ta.ema(low, HiLoLen)
pacC = ta.ema(close, HiLoLen)
pacH = ta.ema(high, HiLoLen)
signalMA = ta.ema(close, 89)

col1 = pacC > signalMA ? color.lime : pacC < signalMA ? color.red : color.yellow
plot(signalMA, color=col1, title="SignalMA")

// --- Hull MA ---
n = 89
n2ma = 2 * ta.wma(close, int(math.round(n / 2)))
nma = ta.wma(close, n)
diff = n2ma - nma
sqn = int(math.round(math.sqrt(n)))

n2ma1 = 2 * ta.wma(close[1], int(math.round(n / 2)))
nma1 = ta.wma(close[1], n)
diff1 = n2ma1 - nma1
sqn1 = int(math.round(math.sqrt(n)))

n1 = ta.wma(diff, sqn)
n2 = ta.wma(diff1, sqn)

condDown = n2 >= n1
condUp = condDown != true
col = condUp ? color.lime : condDown ? color.red : color.yellow
plot(n1, title="Hull MA", color=col, linewidth=1)

// --- MACD Barcolor ---
fastlength = 12
slowlength = 26
MACDLength = 9
MACD = ta.ema(close, fastlength) - ta.ema(close, slowlength)
aMACD = ta.ema(MACD, MACDLength)
delta = MACD - aMACD

hisup = 0
hisup := delta > delta[1] and delta > 0 ? 1 : delta < delta[1] ? -1 : nz(hisup[1], 0)

hisdown = 0
hisdown := delta < delta[1] and delta < 0 ? 1 : delta > delta[1] ? -1 : nz(hisdown[1], 0)

// --- Swing High/Low ---
// Logic updated for v6 strict comparisons
ktswinghigh = (high <= high[2] and high[1] <= high[2] and high[3] <= high[2] and high[4] <= high[2])
sh = ktswinghigh ? high[2] : na

// Replacement for fixnan using var
var float swinghigh = na
if not na(sh)
    swinghigh := sh

colorsh = swinghigh == swinghigh[1] ? color.white : na
plot(swinghigh, color=colorsh, title="Swing High", style=plot.style_line, offset=-2)

ktswinglow = (low >= low[2] and low[1] >= low[2] and low[3] >= low[2] and low[4] >= low[2])
sl = ktswinglow ? low[2] : na

// Replacement for fixnan using var
var float swinglow = na
if not na(sl)
    swinglow := sl

colorsl = swinglow == swinglow[1] ? color.white : na
plot(swinglow, title="Swing Low", color=colorsl, style=plot.style_line, offset=-2)

// --- Pinbar & Patterns ---
ema21 = ta.ema(close, 13)
beariskpinbar = (close - open < (high - low) / 3 and open - close < (high - low) / 3) and ((high > swinghigh and high > high[1] and high > high[2] and high > high[3] and close < swinghigh))
bullishpibar  = (close - open < (high - low) / 3 and open - close < (high - low) / 3) and ((low < swinglow and low < low[1] and low < low[2] and low < low[3] and close > swinglow))

// Helper function for Inside Bar
Inside(pos) => high <= high[pos] and low >= low[pos]

outsidebar = (high >= high[1] and low <= low[1])
barcolor((high <= high[1] and low >= low[1]) ? color.white : na)

// MACD Color Logic
barcolor(hisup == 1 and MACD > 0 ? color.lime : hisdown == 1 and MACD < 0 ? color.red : hisup == -1 and MACD > 0 ? color.green : color.orange)
barcolor(bullishpibar or beariskpinbar ? color.white : na)

secLast = 1
fakey = (high[1] <= high[2] and low[1] >= low[2] and high > high[2] and close >= low[2] and close < high[2]) or (high[2] <= high[3] and low[2] >= low[3] and high[1] > high[2] and close < high[2] and close > low[3] and high - close > 0.75 * (high - low))
fakey1 = (high[1] <= high[2] and low[1] >= low[2] and low < low[2] and close > low[2] and close <= high[1]) or (high[2] <= high[3] and low[2] >= low[3] and low[1] < low[2] and close > low[2] and close < high[3] and close - low > 0.75 * (high - low))
barcolor(fakey or fakey1 ? color.white : na)

// Soldiers and Crows
onewhitesoliderbear = close < open and high[1] - close > 0.5 * (high[1] - low[1]) and (open - close) > 2.0 / 3.0 * (high - low) and (high[1] > ema21[1] or high > ema21) and open[1] < ema21[1] and close - low < (high - close) * 0.3 and (open[2] < ema21[2] or close[2] < ema21[2]) and close < ema21 and low[2] < low[1] and low[3] < low[2]
onewwhitesoliderbull = close > open and close - low[1] > 0.5 * (high[1] - low[1]) and (close - open) > 2.0 / 3.0 * (high - low) and (low[1] < ema21[1] or low < ema21) and open[1] > ema21[1] and high - close < (close - low) * 0.3 and (open[2] > ema21[2] or close[2] > ema21[2]) and close > ema21 and high[2] > high[1] and high[3] > high[2]

insidebar = ((high[1] <= high[2] and low[1] >= low[2]) and not outsidebar)
barcolor(outsidebar and high[1] <= high[2] and low[1] >= low[2] ? color.white : na)
bearishibbf = (insidebar and (high > high[1] and close < high[1]))
bullishibbf = (insidebar and (low < low[1] and close > low[1]))

barcolor((onewwhitesoliderbull or onewhitesoliderbear) and not insidebar ? color.white : na)

whitesoldierreversal = ((low[1] < low[2] and low[2] < low[3]) or (high[1] < high[2] and high[2] < high[3])) and low[3] < low[8] and low[8] < ema21[8] and high[2] < ema21[2] and high[1] < ema21[1] and high[3] < ema21[3] and close - low[1] > (high[1] - close) and (open < close[1] or open < open[1]) and close - open > 0.3 * (high - low) and high - close < 0.5 * (close - open)
blackcrowreversal = ((high[1] > high[2] and high[2] > high[3]) or (low[1] > low[2] and low[2] > low[3])) and high[3] > high[8] and high[8] > ema21[8] and low[2] > ema21[2] and low[1] > ema21[1] and low[3] > ema21[3] and close - low[1] < (high[1] - close) and (open > close[1] or open > open[1]) and open - close > 0.3 * (high - low) and close - low < 0.5 * (open - close)

barcolor(blackcrowreversal or whitesoldierreversal ? color.white : na)

pinbarreversalbull = ((low[1] < low[2] and low[2] < low[3]) or (high[1] < high[2] and high[2] < high[3])) and low[3] < low[8] and low[8] < ema21[8] and high[2] < ema21[2] and high[1] < ema21[1] and high[3] < ema21[3] and close - open < (high - low) / 3 and open - close < (high - low) / 3 and high - close < close - low and low < low[1]
pinbarreversalbear = ((high[1] > high[2] and high[2] > high[3]) or (low[1] > low[2] and low[2] > low[3])) and high[3] > high[8] and high[8] > ema21[8] and low[2] > ema21[2] and low[1] > ema21[1] and low[3] > ema21[3] and close - open < (high - low) / 3 and open - close < (high - low) / 3 and high - close > close - low and high > high[1]

barcolor(pinbarreversalbear or pinbarreversalbull ? color.white : na)

plotshape(fakey and (not outsidebar or not (high[1] <= high[2] and low[1] >= low[2])) and not blackcrowreversal, title="Fakey Bearish", location=location.abovebar, color=color.white, style=shape.arrowdown, text="Fakey", size=size.tiny)
plotshape(fakey1 and (not outsidebar or not (high[1] <= high[2] and low[1] >= low[2])) and not whitesoldierreversal, title="Fakey Bullish", location=location.belowbar, color=color.white, style=shape.arrowup, text="Fakey", size=size.tiny)

// --- Strategy Logic ---
conmua = 0
conmua := hisup == 1 and MACD > 0 ? 1 : (hisdown[1] == 1 and MACD[1] < 0 and pacC[1] > signalMA[1]) or (n1[2] < n1[3] and pacC[1] > signalMA[1]) ? -1 : nz(conmua[1], 1)

conmua1 = 0
conmua1 := conmua == 1 and (hisdown == 1 and MACD < 0 and pacC > signalMA) or (n1[1] < n1[2] and pacC > signalMA) ? 1 : (close[1] > n1[1] and pacC[1] > signalMA[1] and open[1] < n1[1] and close[1] > pacC[1]) or ta.crossunder(pacC, signalMA) ? -1 : nz(conmua1[1], 1)

conmua2 = 0
conmua2 := conmua1 == 1 and hisup == 1 and MACD > 0 and close > n1 ? 1 : high[1] < high[3] and high[2] < high[3] ? -1 : nz(conmua2[1], 1)

conmua3 = 0
conmua3 := conmua2 == 1 and high < high[2] and high[1] < high[2] ? 1 : (close[1] > swinghigh[1] and hisup[1] == 1 and MACD[1] > 0) or (MACD < 0) ? -1 : nz(conmua3[1], 1)

mua = conmua3 == 1 and hisup == 1 and MACD > 0 and conmua2 == -1 and conmua1 == -1
mua2 = conmua1 == 1 and (close > n1 and pacC > signalMA and open < n1 and close > pacC) and conmua[1] == -1

// ENTRY BUY
if (mua2 and not onlysell)
    strategy.entry("Buy", strategy.long)

conban = 0
conban := hisdown == 1 and MACD < 0 ? 1 : (hisup[1] == 1 and MACD[1] > 0 and pacC[1] < signalMA[1]) or (n1[2] > n1[3] and pacC[1] < signalMA[1]) ? -1 : nz(conban[1], 1)

conban1 = 0
conban1 := conban == 1 and (hisup == 1 and MACD > 0 and pacC < signalMA) or (n1[1] > n1[2] and pacC < signalMA) ? 1 : (close[1] < n1[1] and pacC[1] < signalMA[1] and open[1] > n1[1] and close[1] < pacC[1]) or ta.crossover(pacC, signalMA) ? -1 : nz(conban1[1], 1)

conban2 = 0
conban2 := conban1 == 1 and hisdown == 1 and MACD < 0 and close < n1 ? 1 : low[1] > low[3] and low[2] > low[3] ? -1 : nz(conban2[1], 1)

conban3 = 0
conban3 := conban2 == 1 and low[1] > low[2] and low > low[2] ? 1 : (close[1] < swinglow[1] and hisdown[1] == 1 and MACD[1] < 0) or (MACD > 0) ? -1 : nz(conban3[1], 1)

ban = conban3 == 1 and hisdown == 1 and MACD < 0 and conban2 == -1
ban2 = conban1 == 1 and (close < n1 and pacC < signalMA and open > n1 and close < pacC) and conban[1] == -1

// ENTRY SELL
if (ban2 and not onlybuy)
    strategy.entry("Sell", strategy.short)

plotshape(conmua1 == 1 and conmua[1] == -1, style=shape.triangleup, color=color.lime, location=location.bottom, size=size.tiny)
plotshape(conban1 == 1 and conban[1] == -1, style=shape.triangledown, color=color.red, location=location.bottom, size=size.tiny)
plotshape(mua2, style=shape.labelup, color=color.lime, location=location.bottom, size=size.tiny)
plotshape(ban2, style=shape.labeldown, color=color.red, location=location.bottom, size=size.tiny)

// --- TP and SL ---
Stop = rr_input * 10
Take = SL_input * 10

if (useTPandSL)
    strategy.exit("ExitBuy", "Buy", 1, profit=Take, loss=Stop)
    strategy.exit("ExitSell", "Sell", 1, profit=Take, loss=Stop)