MTF Structure Vote TradingView Indicator

Written by Dominic Walsh · Published

MTF Structure Vote is a trend alignment indicator TradingView traders can use to filter local entries. Also, three higher timeframes each cast one vote. The script pulls the 1-hour, 4-hour and daily series, compares each close with its own 50-period EMA, and returns plus one or minus one. Indeed, add the three and you get a net score running from minus three to plus three.

It is free and open source. Still, you can add it to any chart from the MTF Structure Vote script page on TradingView, and the full Pine source is published there for you to read.

What MTF Structure Vote plots on the price chart

The script plots one line: the 9-period local EMA. Thus, its colour switches to the buy colour under bull confluence, the sell colour under bear confluence, and grey the rest of the time. Flags mark signals below the bar for buys and above for sells, each carrying the text MSV with two softer glow layers behind it. Hence, the chart background tints while confluence holds, and the signal bar gets recoloured. A nine-row dashboard lists each higher timeframe with its BULL or BEAR vote, the net vote, confluence state, threshold, current position and bars since the last signal.

How MTF Structure Vote is built

How the three votes work

The script calls request.security three times, once per higher timeframe. Next, defaults are 60 minutes, 240 minutes and the daily. Each call runs the same short expression on that timeframe: does close sit above the 50-period EMA? Then, above returns plus one, below returns minus one. Every call passes lookahead=barmerge.lookahead_off, so no future higher timeframe data reaches the chart.

Be clear on what this measures. Yet, the name says structure, yet the code never looks for higher highs, lower lows, breaks of structure or swing pivots. Each vote is one comparison of close against a 50 EMA on that timeframe. Truly, so it works as a trend-direction poll, not as a market-structure engine.

Adding the three votes gives the net vote, from minus three to plus three. Plainly, bull confluence needs the net vote at or above the Min Net Vote input, which defaults to 2. Bear confluence needs minus two or lower. Also, set the input to 3 and you demand a unanimous read across all three timeframes.

How a signal fires

Confluence alone prints nothing. Indeed, the script also wants a local trigger. It builds a 9-period EMA on your chart timeframe and waits for close to cross it. Still, a crossover inside active bull confluence gives an up entry. A crossunder inside active bear confluence gives a down entry.

Three further gates then apply. Thus, the script tracks a position state and refuses a second buy while it already reads long, so signals alternate. A five-bar cooldown must elapse. Hence, and barstate.isconfirmed must be true, so a flag appears only once the chart bar closes. An optional session window can narrow things further, though it ships off with a 0000-2400 default.

One input does nothing. Next, ATR Length feeds a variable that the rest of the script never reads. Changing it alters no vote, no signal and no drawing.

How to read the signals

Read the dashboard top to bottom. Then, the three timeframe rows show where disagreement sits. A net vote of plus two with the daily row reading BEAR is a very different picture from a unanimous plus three, even though both clear the default threshold.

Treat the background tint as permission, not as a signal. Yet, it stays on for as long as confluence holds, which can run for hundreds of bars. The flag is the timed part, and it needs a fresh 9 EMA cross inside that window.

Historical and live votes can differ. On past bars each higher timeframe value reflects the last completed higher timeframe bar. In real time the same value updates as the current 1-hour, 4-hour or daily bar builds, so a dashboard row can flip mid-session. Truly, signals still wait for a confirmed chart bar, so printed flags stay where they printed.

Every MTF Structure Vote setting explained

The script exposes 16 inputs, grouped in the settings panel exactly as shown below. Defaults are the published values.

MTF

SettingWhat it doesDefaultRange
HTF 1First higher timeframe for the structure vote.60
HTF 2Controls htf 2.240
HTF 3Controls htf 3.D
HTF Trend EMAEMA computed on each HTF to define its structural bias.505 to 200
Local Reclaim EMASets the local reclaim ema used in the calculation.92 to 50
ATR LengthSets the atr length used in the calculation.145 to 50

Signal Logic

SettingWhat it doesDefaultRange
Min |Net Vote|2 = at least 2 of 3 HTFs agree; 3 = unanimous.21 to 3
Cooldown BarsSets the cooldown bars used in the calculation.51 to 40

Filters

SettingWhat it doesDefaultRange
Restrict to SessionToggles restrict to session on the chart.offon / off
Session WindowControls session window.0000-2400

Visual

SettingWhat it doesDefaultRange
Show DashboardToggles show dashboard on the chart.onon / off
Show 3-Layer GlowToggles show 3-layer glow on the chart.onon / off
Show Local EMAToggles show local ema on the chart.onon / off
Buy ColorColour used for buy color.#38bdf8
Sell ColorColour used for sell color.#fb7185
Dashboard BGColour used for dashboard bg.color.new(#04121f, 14)

Alerts built into MTF Structure Vote

The script ships 14 alert conditions. Plainly, open the alert dialog on the chart, pick the indicator as the condition source, then choose the event you want. Alerts fire on the close of the bar, so they follow the same confirmed-bar rule the on-chart signals use.

  • MSV Buy
  • MSV Sell
  • MSV Any Signal
  • MSV Bull Conf
  • MSV Bear Conf
  • MSV Unanimous Bull
  • MSV Unanimous Bear
  • MSV Vote Change
  • MSV Local Up
  • MSV Local Down
  • MSV Any Conf
  • MSV Webhook JSON

Other markets and timeframes

Nothing here is instrument specific. Also, each vote compares close with an EMA, so the script runs on any symbol with price data. It reads no volume, which makes it equally valid on spot forex, gold, indices, crypto and stocks. Indeed, your timeframe choice matters far more than the market. A 5-minute chart voting on 1-hour, 4-hour and daily gives a slow, heavy filter. Still, match the three higher timeframes to your holding period rather than to the asset.

Limitations worth knowing

The script filters direction. Thus, it does not manage a trade. There is no stop, no target, no sizing and no risk model. Hence, the position row in the dashboard only records which signal fired last.

Confluence lags by construction. Next, a daily 50 EMA turns slowly, so the vote often confirms a move already underway. In ranges the three timeframes disagree and the script goes quiet for long stretches. Then, that behaviour is the design, but it does mean you miss early turns.

The trigger is a plain 9 EMA cross. Yet, it fires on any pullback that pokes through the line, so inside a long confluence stretch you can get repeated flags, spaced only by the five-bar cooldown and the alternating position state.

It detects no market structure despite the name, and it draws no swing points, order blocks or break-of-structure lines.

Get MTF Structure Vote on TradingView

Open MTF Structure Vote on TradingView

If you also trade MetaTrader, the MT4 and MT5 indicator library is available below.

Get the complete indicator library

One email unlocks the full MT4 and MT5 indicator library. Truly, this TradingView script stays free on TradingView – the button above adds it to your chart.

Using it alongside MetaTrader

Adding a script on TradingView takes one click, so there is no install step here. Plainly, if you want the same idea on MetaTrader, the MT4 and MT5 indicator installation guide walks through copying files into the data folder and attaching them to a chart. You can also browse the full MetaTrader indicator library, the MT4 indicators section, or the other free TradingView scripts published on this profile. For related chart tools see the MT5 indicators section and the forex trading strategies guides.

External references

Frequently asked questions

Is MTF Structure Vote genuinely multi-timeframe?

Yes. Also, the script calls request.security three times, on the 1-hour, 4-hour and daily by default, each with lookahead disabled. What it pulls from those timeframes is simple though: one comparison of close against a 50-period EMA. Indeed, it reads trend direction on each timeframe, not market structure.

Does it repaint?

Signals do not. Still, both booleans require barstate.isconfirmed, and the flags, glow layers and bar colour all key off them, so a flag prints only at bar close. The dashboard vote rows behave differently in real time – they follow the higher timeframe bar as it builds, so a row can change before that bar closes.

What does Min Net Vote change?

It sets how many timeframes must agree. Thus, at the default of 2, two of the three must point the same way. At 3 you require all three. Hence, at 1 a single agreeing timeframe is enough, which produces far more signals and far weaker filtering.

Which higher timeframes should I pick?

Keep them stepped well above your chart. On a 15-minute chart the 1-hour, 4-hour and daily defaults work well. On a daily chart, move them up to weekly and monthly. Next, timeframes too close to the chart produce three near-identical votes and the confluence test stops filtering anything.

How much should I rely on this indicator?

Treat it as one input, not a decision. Then, it is a chart analysis tool, not trading advice. Test it on your own markets and timeframes before relying on it. Results are not guaranteed; past performance is not indicative of future results.

Dominic Walsh - Forex trader and MT4/MT5 developer

About the author

Written by Dominic Walsh, a Forex trader and MT4/MT5 indicator, Expert Advisor and script developer. Every tool on forexmt4systems.com is tested on live charts before release and ships with ready-to-use compiled MT4 (.ex4) and MT5 (.ex5) files. Learn more about the trader and developer behind this site.

How we build, test and correct every tool: Editorial & Testing Policy. Trading carries risk; see the disclaimer.

Leave a Comment