
この戦略は,市場動向,動力,波動率の3次元分析を組み合わせた多指標融合のトレンド追跡取引システムである. 核心ロジックは,市場動向を判断するインジケーターの雲 (イチモクククラウド),MACD直線図の動態を確認する,ブルリン帯域幅 (ボリンジャー帯域幅) フィルター市場の波動状態を判断し,周線レベルのトレンド確認メカニズムを導入し,最終的に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)