PROTECTED SOURCE SCRIPT
更新済

MTF MA Model

2 597
MTF MA Model

Multi-timeframe moving average trend filter with pivot-confirmed entries and automatic order block visualization

Overview

MTF MA Model is a comprehensive trend-following indicator that combines dual-timeframe moving average analysis with pivot-based entry confirmation. The system uses a 5-13-34 MA stack on your chart timeframe for precise entries, filtered by a 34-55-200 MA stack on a higher timeframe for trend direction. Signals only trigger when price breaks key pivot levels, ensuring you enter with momentum confirmation rather than lagging crossovers alone.

Key Features

  • Dual-Timeframe Analysis: Entry signals on your chart timeframe, filtered by higher timeframe trend:
    Entry Stack (5-13-34): Fast, mid, and slow MAs for precise timing.
    HTF Filter (34-55-200): Ensures you trade with the larger trend.
  • Pivot Confirmation: Entries require price to break through a pivot high (for longs) or pivot low (for shorts), adding momentum confirmation to crossover signals.
  • Order Block (OB) Lines: Automatically drawn at confirmed signal levels, extending forward until invalidated by stop breach.
  • Multiple MA Types: Choose from SMA, EMA, SMMA (RMA), WMA, VWMA, EVWAP, or VRMA. Volume-weighted types include a decay multiplier for responsiveness tuning.
  • Auto HTF Selection: Intelligent timeframe mapping automatically selects the optimal higher timeframe based on your chart (e.g., 5m → 1H, 1H → 1D).
  • Position Sizing: Optional risk-based position size calculation with support for forex lots, futures contracts, and crypto units.
  • Monochrome Mode: Toggle to color all MAs based on stack bias (green for bullish, red for bearish) for cleaner visualization.


How It Works

  1. Setup Phase: A pending signal is created when all conditions align:
    Entry MAs are properly stacked (5 > 13 > 34 for bullish)
    Price is above/below all entry MAs
    HTF MAs confirm the trend direction
    A crossover occurs (EMA5 crosses EMA13)
  2. Tracking Phase: While pending, the system tracks the minimum low (for longs) or maximum high (for shorts) to calculate the optimal stop level.
  3. Confirmation Phase: Entry triggers only when price breaks the pivot level:
    Long: Close > Pivot High
    Short: Close < Pivot Low
  4. OB Line Visualization: Upon confirmation, an Order Block line is drawn from the pivot bar to the current bar. Lines extend forward and are automatically removed if the stop price is breached.


Use Cases

  • Trend Following: Trade in the direction of the higher timeframe trend with precise entry timing from the lower timeframe.
  • Swing Trading: Capture multi-day moves by entering on confirmed pivots with the trend.
  • Day Trading: Use on lower timeframes (1-15m) with automatic HTF filtering from 1H-4H charts.
  • Position Management: OB lines provide clear visual reference for where signals originated and when they become invalid.
  • Risk Management: Built-in position sizing calculates appropriate size based on your account and risk parameters.


Settings

  • Auto HTF Mode: Automatically select the higher timeframe based on your chart timeframe.
  • Manual HTF: Override with a specific HTF when Auto mode is disabled.
  • MA Type: Choose the moving average calculation method (EMA recommended for most markets).
  • Entry MA Lengths: Customize the 5-13-34 stack (default values work well for most timeframes).
  • HTF Filter Lengths: Customize the 34-55-200 HTF stack.
  • Show Entry/HTF MAs: Toggle visibility of each MA group.
  • Show OB Lines: Toggle Order Block line visualization.
  • OB Extend Type: Choose how lines extend (Extending All, Extending Latest, or Extending None).
  • Max OB Lines: Limit the number of OB lines displayed to prevent clutter.
  • Monochrome Mode: Color all MAs the same based on their stack direction.
  • Position Sizing: Enable to display calculated position size based on risk parameters.
  • Account Balance / Risk Amount: Configure your account size and risk per trade (% or fixed amount).


Signal Logic

  • Long Entry Requirements:Entry Stack: EMA5 > EMA13 > EMA34
    Price: Above all entry MAs AND all HTF MAs
    HTF Stack: EMA34 > EMA55 > EMA200 on the higher timeframe
    Trigger: EMA5 crosses above EMA13
    Confirmation: Close breaks above the most recent pivot high
  • Short Entry Requirements:
    • Entry Stack: EMA5 < EMA13 < EMA34
    • Price: Below all entry MAs AND all HTF MAs
    • HTF Stack: EMA34 < EMA55 < EMA200 on the higher timeframe
    • Trigger: EMA5 crosses below EMA13
    • Confirmation: Close breaks below the most recent pivot low


Technical Notes

  • Pivots are detected using candle direction changes: a bullish candle after a bearish candle creates a pivot low, and vice versa.
  • Stop levels are dynamically calculated as the extreme price between signal creation and confirmation.
  • OB lines are invalidated (removed) when price breaches the stop level.
  • EVWAP and VRMA types use an exponential decay on volume-weighted calculations, with the decay multiplier controlling responsiveness.
  • The dashboard displays current bias, stack status, and active signal details including entry, stop, and position size.
  • Alerts are triggered on confirmed entries for automation compatibility.

リリースノート
- More Timeframe Support
リリースノート
- Cleanup

免責事項

この情報および投稿は、TradingViewが提供または推奨する金融、投資、トレード、その他のアドバイスや推奨を意図するものではなく、それらを構成するものでもありません。詳細は利用規約をご覧ください。