
“Price Action”というシンプルな名前に騙されないでください. この戦略は6つの技術的な次元を統合しています: 34サイクルEMA通路,89サイクルHull MA,MACD柱状図,揺動高低点,Pin Bar形状,そしてFakey突破モード.真の多次元認証は,単一の指標の盲目な追従ではなく,
戦略の核心的な論理は,EMA通路がトレンドの方向を判断し,Hull MAがスムーズなトレンド確認を提供し,MACD柱状図が動力の変化を認識し,揺れ点位が重要なサポート抵抗を提供し,Pin BarとFakeyの形状が入場トリガとして使用されます.信号は複数回確認されるので,従来の単一指数戦略よりも信頼性が高い.
ストップは50ポイント,ストップは20ポイント,リスク/利益の比率は1:2.5です.この設定は残酷な事実を示しています. 40%の確率で勝ったとしても,長期的には儲かるということです.しかし,実際には,多次元認証は通常,55~65%の確率で成功率を上げます.
Hull MAの89周期設定は特に注目に値する.従来の移動平均とは異なり,Hull MAは加重移動平均の二次計算により,ほとんど滞留を排除している.Hull 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以上は信号が不足している.小数点の後ろの2桁のパラメータは,任意に設定されません.
戦略は,市場状態を直感的に表示するために色を使用します.緑は上昇の勢いが増えたことを示し,赤は下落の勢いが増えたことを示し,オレンジは動力の衰退を示します.リアルタイムで取引信号を提示するものです.
hisupそしてhisdown変数はMACD柱状図の連続変化を追跡する.柱状図が連続して成長し,ゼロ軸上にあるとき,多頭動量確認;逆に空頭動量確認.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)