
ڈاؤسٹری رجحانات کی انکولی رفتار کی حکمت عملی ایک اعلی درجے کی تجارتی حکمت عملی ہے جو کلاسیکی ڈاؤسٹری اصولوں پر مبنی ہے جو مارکیٹ کے رجحانات میں اہم موڑ کی نشاندہی کرکے تجارتی فیصلوں کی رہنمائی کرتی ہے۔ اس حکمت عملی میں قیمتوں کے رجحانات کی بنیادی حرکیات کا پتہ لگانے اور اس کی تصدیق کرنے پر توجہ دی جاتی ہے ، جس میں اعلی اونچائیوں (Higher Highs) اور اعلی کم (Higher Lows) کا استعمال کرتے ہوئے اوپر کی طرف رجحان کی وضاحت کی جاتی ہے ، اور کم اونچائیوں (Lower Highs) اور کم کم (Lower Lows) کا استعمال کرتے ہوئے نیچے کی طرف رجحان کی وضاحت کی جاتی ہے۔ اس طریقہ کار کا مقصد مارکیٹ کے رجحانات کو پکڑنے اور رجحانات میں تبدیلی پر بروقت رد عمل کا ایک منظم طریقہ فراہم کرنا ہے۔
اس حکمت عملی کا بنیادی اصول کلاسیکی رجحانات کی شناخت کے طریقہ کار پر مبنی ہے جو ڈاؤ تھیوری پر مبنی ہے۔ اس حکمت عملی میں ta.pivothigh () اور ta.pivotlow () افعال کا استعمال کرتے ہوئے اہم موڑ کا پتہ لگانے کے لئے استعمال کیا جاتا ہے۔ اس کے عملی نفاذ میں درج ذیل اہم اقدامات شامل ہیں:
ڈاؤ تھیوری ٹرینڈ ڈائنامک اسٹریٹجی ایک طاقتور ٹرینڈ ٹریکنگ طریقہ ہے جو تاجروں کو ایک جدید ٹرنپوائنٹ تجزیہ ٹکنالوجی کے ذریعہ ایک منظم رجحان کی شناخت کا آلہ فراہم کرتا ہے۔ اگرچہ اس میں کچھ موروثی خطرات موجود ہیں ، لیکن اس کی لچک اور حرکیات نے اسے جدید مقداری تجارتی حکمت عملی میں ایک قیمتی طریقہ کار بنا دیا ہے۔ اس حکمت عملی کو کامیابی سے لاگو کرنے کے لئے اس کے کام کرنے کے اصول کو گہرائی سے سمجھنے کی ضرورت ہے اور مخصوص مارکیٹ کے حالات کے مطابق مستقل طور پر اصلاح اور موافقت کی ضرورت ہے۔
The Dow Theory Trend Adaptive Momentum Strategy is an advanced trading approach based on classic Dow Theory principles, designed to guide trading decisions by identifying key turning points in market trends. The strategy focuses on detecting and confirming the fundamental dynamics of price trends, using Higher Highs and Higher Lows to define uptrends, and Lower Highs and Lower Lows to define downtrends. This method aims to provide a systematic approach to capturing market trends and responding promptly when trends change.
The core principle of this strategy is based on the classic Dow Theory trend identification method. The strategy detects key turning points using ta.pivothigh() and ta.pivotlow() functions. Specific implementation includes the following key steps:
The Dow Theory Trend Adaptive Momentum Strategy is a powerful trend-following method that provides traders with a systematic trend identification tool through innovative turning point analysis techniques. Despite some inherent risks, its flexibility and dynamism make it a valuable approach in modern quantitative trading strategies. Successfully applying this strategy requires a deep understanding of its working principles and continuous optimization and adjustment based on specific market environments.
/*backtest
start: 2025-03-29 00:00:00
end: 2025-03-30 09:00:00
period: 2m
basePeriod: 2m
exchanges: [{"eid":"Futures_Binance","currency":"BNB_USDT"}]
*/
//@version=5
// strategy(title="Dow Theory Trend Strategy v3", shorttitle="Dow Trend Strat v3", overlay=true,
// initial_capital=10000, default_qty_type=strategy.percent_of_equity, default_qty_value=10,
// commission_type=strategy.commission.percent, commission_value=0.1, // Example strategy settings with commission
// process_orders_on_close=true) // Consider processing on bar close for more stable backtests
strategy(title="Dow Theory Trend Strategy v3", shorttitle="Dow Trend Strat v3", overlay=true) // Basic strategy settings
// --- 設定 ---
// Calculation Settings
pivotLookback = input.int(10, title="Pivot Lookback Period", minval=1, tooltip="ピボットハイ/ローを検出するための左右のバーの数", group="Calculation Settings")
// Display Settings
showPivotPoints = input.bool(true, title="Show Pivot Points", tooltip="ピボットハイ/ローのポイントを表示します", group="Display Settings")
showTrendChange = input.bool(true, title="Show Trend Change Signals", tooltip="トレンド転換のシグナル(エントリーポイント)を表示します", group="Display Settings")
// Strategy Settings
// --- Manual Trend Override (配列定義を input 内に変更) ---
manualTrendMode = input.string("Auto", title="Manual Trend Mode",
options=["Auto", "Long Only", "Short Only"], // オプションをここで直接定義
tooltip="手動でトレード方向を指定 (Auto: ダウ理論に従う, Long Only: ロングのみ, Short Only: ショートのみ)",
group="Strategy Settings")
// Risk Management Settings
useStopLoss = input.bool(true, title="Use Stop Loss", group="Risk Management")
stopLossTicks = input.float(100, title="Stop Loss (Ticks)", minval=1, group="Risk Management", tooltip="エントリー価格からのストップロスまでのティック(最小値動き)数。例:EURUSDで20 pips (tick=0.00001)なら200。")
useTakeProfit = input.bool(true, title="Use Take Profit", group="Risk Management")
takeProfitTicks = input.float(200, title="Take Profit (Ticks)", minval=1, group="Risk Management", tooltip="エントリー価格からのテイクプロフィットまでのティック(最小値動き)数。例:EURUSDで40 pips (tick=0.00001)なら400。")
// --- ピボットハイ/ローの検出 ---
pivotHighPrice = ta.pivothigh(high, pivotLookback, pivotLookback)
pivotLowPrice = ta.pivotlow(low, pivotLookback, pivotLookback)
// --- ピボットポイントの値を保持するための変数 ---
var float lastPivotHigh = na
var float prevPivotHigh = na
var float lastPivotLow = na
var float prevPivotLow = na
var int lastPivotHighBar = na
var int prevPivotHighBar = na
var int lastPivotLowBar = na
var int prevPivotLowBar = na
// --- 新しいピボットが確定したかどうかの検出と値の更新 ---
if not na(pivotHighPrice)
if na(lastPivotHigh) or pivotHighPrice != lastPivotHigh
prevPivotHigh := lastPivotHigh
prevPivotHighBar := lastPivotHighBar
lastPivotHigh := pivotHighPrice
lastPivotHighBar := bar_index - pivotLookback
if not na(pivotLowPrice)
if na(lastPivotLow) or pivotLowPrice != lastPivotLow
prevPivotLow := lastPivotLow
prevPivotLowBar := lastPivotLowBar
lastPivotLow := pivotLowPrice
lastPivotLowBar := bar_index - pivotLookback
// --- ダウ理論に基づくトレンド判定 (改良版) ---
var int trendDirection = 0
bool hasEnoughPivots = not na(lastPivotHigh) and not na(prevPivotHigh) and not na(lastPivotLow) and not na(prevPivotLow)
if hasEnoughPivots
isHigherHigh = lastPivotHigh > prevPivotHigh
isHigherLow = lastPivotLow > prevPivotLow
isUptrendConfirmed = isHigherHigh and isHigherLow
isLowerHigh = lastPivotHigh < prevPivotHigh
isLowerLow = lastPivotLow < prevPivotLow
isDowntrendConfirmed = isLowerHigh and isLowerLow
if isUptrendConfirmed
trendDirection := 1
else if isDowntrendConfirmed
trendDirection := -1
else
trendDirection := trendDirection[1]
// --- トレンド転換の検出 ---
bool trendChanged = ta.change(trendDirection) != 0
bool changedToUp = trendChanged and trendDirection == 1
bool changedToDown = trendChanged and trendDirection == -1
// --- 描画処理 ---
bgcolor(trendDirection == 1 ? color.new(color.blue, 85) : trendDirection == -1 ? color.new(color.red, 85) : color.new(color.gray, 90), title="Trend Background")
plotshape(showPivotPoints and not na(pivotHighPrice), title="Pivot High", location=location.abovebar, color=color.new(color.maroon, 20), style=shape.triangledown, size=size.tiny, offset=-pivotLookback)
plotshape(showPivotPoints and not na(pivotLowPrice), title="Pivot Low", location=location.belowbar, color=color.new(color.navy, 20), style=shape.triangleup, size=size.tiny, offset=-pivotLookback)
plotshape(showTrendChange and changedToUp, title="Uptrend Start Signal", location=location.belowbar, color=color.new(color.green, 0), style=shape.labelup, text="▲ UP", textcolor=color.white, size=size.small)
plotshape(showTrendChange and changedToDown, title="Downtrend Start Signal", location=location.abovebar, color=color.new(color.red, 0), style=shape.labeldown, text="▼ DOWN", textcolor=color.white, size=size.small)
// --- ストラテジーロジック ---
bool allowLong = manualTrendMode == "Auto" or manualTrendMode == "Long Only"
bool allowShort = manualTrendMode == "Auto" or manualTrendMode == "Short Only"
if (changedToUp and allowLong)
strategy.entry("L", strategy.long, comment="Go Long")
if (useStopLoss or useTakeProfit)
float slValue = useStopLoss and stopLossTicks > 0 ? stopLossTicks : na
float tpValue = useTakeProfit and takeProfitTicks > 0 ? takeProfitTicks : na
strategy.exit("LX", from_entry="L", loss=slValue, profit=tpValue, comment_loss="SL Long", comment_profit="TP Long")
if (changedToDown and allowShort)
strategy.entry("S", strategy.short, comment="Go Short")
if (useStopLoss or useTakeProfit)
float slValue = useStopLoss and stopLossTicks > 0 ? stopLossTicks : na
float tpValue = useTakeProfit and takeProfitTicks > 0 ? takeProfitTicks : na
strategy.exit("SX", from_entry="S", loss=slValue, profit=tpValue, comment_loss="SL Short", comment_profit="TP Short")
// --- デバッグ用 ---
// plot(trendDirection, title="Trend Direction Value")