Bayesian Trend Indicator runs on MT4 and MT5, and it starts from a complaint about the
way most trend filters count.
The usual one asks a yes or no question of each moving average: is it higher than it
was? Four averages, four votes, and an average that has crawled up by a tick counts
exactly the same as one that has run away. This one grades the answer. Each average is
checked against where it sat ten bars ago, then nine, then eight, down to one, and the
score is how far back you have to look before the comparison still holds. Higher than
ten bars ago scores 1.0. Only higher than the bar before scores 0.1.

What the number actually is
Four kinds of moving average, computed twice.
The slow set is an EMA, an SMA, a DEMA and a volume weighted average over length, 60
bars by default. The fast set is the same four over length minus gap_length, so 40.
All eight get the graded score above, and each score is then smoothed by a four period
EMA of itself, so no single bar flips a vote on its own.
Average the four slow scores and you have the prior. Average the four fast ones and you
have the likelihood. Then:
posterior = prior ร likelihood / (prior ร likelihood + (1 โ prior) ร (1 โ likelihood))
Above 0.52 the candle is olive green, below 0.48 it's orange, and in between it's grey.
There's less grey than you'd expect, because that formula pushes results toward the
ends: two mildly bullish readings multiply into a confidently bullish one.
Now, the name. This is Bayes' rule used as a blending function, not inference over a
probability model. Nothing is being updated, and there's no evidence in the statistical
sense โ the slow set's reading is treated as a prior and the fast set's reading as new
information about it. That's a sensible way to make a slow signal and a fast signal
argue with each other. It isn't a Bayesian model, and I'd rather you heard that from me
than worked it out afterwards.
Where this differs from a plain moving average vote
| What a trend filter has to decide | What most of them do | What this one does |
|---|---|---|
| How strongly an average is trending | Yes or no: higher than last bar | Ten graded steps, by how far back the comparison holds |
| How to stop one bar flipping the state | Nothing, or a fixed bar delay | Each of the eight scores carries its own four period EMA |
| How fast and slow should interact | Take the fast signal, filter it by the slow one | The slow set is the prior, the fast set updates it |
| Where the boundary sits | One threshold, so the state is always up or down | A neutral band, 0.48 to 0.52, drawn grey |
| Which average to use | One, usually an EMA | Four kinds, because DEMA and VWMA disagree with EMA at the interesting moments |
The last row is the one that changes what you see. A DEMA turns earlier than an EMA of
the same length and a VWMA turns on volume the other two can't see, so the four spend
the middle of a move in agreement and disagree at both ends. That disagreement is what
the grading measures.
Two ways to draw it
Display style has two settings and they're genuinely different pictures.
Colour candles, the default, paints the candle itself and marks each change of state
with an arrow, placed 1.5 ร ATR(50) beyond the bar's high or low. Set Signal Arrow
display to At current price and the arrow sits on the close instead, which is tidier
on a low volatility pair and unreadable on gold.
ATR trail line leaves the candles alone and draws a trailing line instead โ orange
above price while the state is down, olive below it while the state is up, at the same
1.5 ร ATR distance. Same arrows, same state, one line to put a stop behind.

What it doesn't move
A closed bar's colour is written once and never revisited. After the first pass, every
tick recalculates exactly one bar: the newest.
An arrow lands one bar after the state changes, and it's anchored to the bar that
changed. That delay is the price of not drawing an arrow and then taking it away. Once
it's on the chart it stays there.
The candle currently forming does change colour while it's open. It has to. Its close
hasn't happened yet.
Alerts only fire once the indicator has been running, not during the first pass over
history. Load it on a year of gold and you get a year of arrows and no alerts at all.

What it can't do
There's no volatility normalisation. gap is ten bars on gold and ten bars on
EURUSD, and ten bars mean very different things on those two. It's the first setting I'd
change per symbol, and the one most likely to need it.
Ranges produce pairs of arrows. When price goes sideways the fast four and the slow
four agree on noise, and a red and a blue arrow land within a few bars of each other.
There's a cluster exactly like that in the picture below, on 10 and 11 August. Nothing
in the formula measures range, so the tool doesn't know it's in one.
Only the last 5000 bars are drawn by default, which is what Lookback bar controls.
Set it to 0 for all history if you're studying an old move, and expect the first load to
take a moment.
Telegram alerts are MT5 only. Both builds do platform alerts and email; the MT5 one
also takes a bot token and a channel id. That's a difference in the two MetaTrader APIs,
not something I left out of MT4 to save time.

You won't find a win rate table in this listing, and I'd be careful with any indicator
listing that has one. It colours candles and it marks the bars where its eight averages
change their mind. What you do with that is the part that decides your results.
The fiddliest part of shipping this had nothing to do with the maths. MQL4 numbers its
bars backwards from MQL5, so the one line that detects a change of state was reading the
older neighbour on one platform and the newer one on the other โ the same source,
compiling cleanly, drawing a chart that looked completely reasonable, with the arrows
inverted. Both platforms now mark the same bars.
Questions you'll have
Does Bayesian Trend Indicator repaint? Closed bars, no. A bar's colour is written
once and an arrow stays on the bar it appeared on. The candle still forming changes
colour until it closes, because the close is half of what's being measured.
What do the arrows mean? A change of state, nothing more. Blue under a low means the
eight averages have swung from down to up; red above a high is the other way. They are
not entries and the indicator makes no attempt to grade them.
Why is my candle grey? The posterior landed between 0.48 and 0.52, so the fast set
and the slow set disagree. Grey is the honest answer rather than a coin flip, and it's
rare enough to be worth noticing.
What are the best settings for Bayesian Trend Indicator? Start with the defaults and
change gap first, since that's the one with no per symbol default that makes sense. On
a fast pair try 5 or 6; on gold on H1, 10 is about right.
Does it work on M1 or M5? It draws, but the four averages spend most of an M1 session
disagreeing, so you get colour changes every few bars. H1 and above is where I'd use it.
Can I get Telegram alerts? On MT5, yes: fill in the bot token and channel id in the
notification block. The MT4 build has alerts and email only.
MT4 or MT5? Both, and your subscription covers both. Same formula, same defaults, one
download each.
Support
Message me through the site with a screenshot showing the chart, plus the symbol and
timeframe. That's usually enough for me to tell you what happened. Updates are included
for as long as your subscription is running.
Analysis tool. It places no trades and makes no profitability claim. Past price
behaviour is not a guide to future price behaviour.