UT Bot Alerts is an ATR trailing stop on MT4 and MT5 with an arrow every time price closes through it. Two inputs matter, and really only one of them does. This page is mostly about that one.

Gold H1 at Key Value 3: the stop line ratcheting under and over price, six signals in three weeks

The stop

One line. On every bar it computes a distance, nLoss = Key Value ร— ATR(period), and then applies four rules:

  • Price above the stop, and it was above on the previous bar too: the stop rises to price โˆ’ nLoss if that is higher than where it already is, and otherwise holds.
  • Price below on both bars: mirrored, the stop can only fall.
  • Otherwise โ€” meaning price just crossed โ€” the stop jumps to price โˆ’ nLoss or price + nLoss, whichever side price is now on.

So it ratchets while the side is stable and snaps across when the side changes. The snap is why the line looks like it steps over price rather than crossing it.

The signal is not an EMA cross

The original describes the signal as an EMA crossing the trailing stop. In the code, that EMA has a length of one.

An EMA of length one is the price. So the crossover being tested is price crossing the stop, and the extra condition sitting next to it in the source โ€” price above the stop โ€” is already implied by the crossover test.

I'm spelling this out because it changes what you can tune. There's no smoothing to adjust and no second series to line up. There is one number that sets how far the stop sits from price, and everything else follows from it.

Key Value is the entire product

At the default of 1.0 the stop sits one ATR from price and the indicator is very talkative. Same window, same instrument, Key Value at 1:

Gold H1 at the default Key Value of 1: around thirty-five signals in the same three weeks

Roughly thirty-five arrows against six. Neither is the right answer โ€” that's the trade-off the input exists to give you, and it's the first thing to test on whatever you actually trade. Values of 2 to 3 on H1 are where this stops behaving like a scalping tool and starts behaving like a trend filter.

ATR Period at 10 is the second lever, and it's much blunter: it changes how quickly the distance responds to a change in volatility, not how far away the stop sits on average.

EURUSD H4 at the defaults: the same construction on a slower instrument, still busy through the July range

Moving average cross Parabolic SAR This
What crosses what Two averages Price and the dot Price and its own stop
Distance from price Emergent Accelerates over time Key Value ร— ATR, fixed in ATR terms
On a flip the level Continues Restarts at the extreme Snaps to the other side of price
Settings that matter Two lengths Step and max One, effectively
Signal count at defaults Moderate High High

The Heikin Ashi option is an approximation

UseHeikin is described as taking signals from Heikin Ashi candles. What it actually does is replace the close with (open + high + low + close) / 4.

That is the Heikin Ashi close formula, and it's the only part of Heikin Ashi that this uses. Real Heikin Ashi candles also have a recursive open โ€” each bar's open is the average of the previous HA bar's open and close โ€” and none of that is here.

The practical effect is still useful: an average of the whole bar is less jumpy than the close alone, so signals thin out a little. But it isn't the same series a Heikin Ashi chart would give you, and if you're comparing against one you'll find they disagree.

What you get

The coloured stop line, arrow buffers for buy and sell, and notifications through the shared block โ€” alert, email, push or Telegram.

Everything is a buffer, including the arrows, which is worth knowing if you write EAs: an arrow here is a value in a plotted buffer at that bar, not a chart object, so it can be read with iCustom directly and nothing has to be scraped off the chart. The stop is buffer 0 on MT5 and the position state, +1 or โˆ’1, sits in buffer 4.

Where it's weak

Alerts fire on the forming bar and there's no confirmed option. A cross that happens mid-bar sends the alert immediately. If price closes back on the original side, the arrow is gone from the chart on the next recalculation and the alert has already reached your phone. Every other indicator I've written up has an AlertConfirmed switch; this one doesn't, and that's the single biggest thing I'd change about it.

Notifications are off by default. noti_type starts at none on both platforms, so you'll see arrows and hear nothing until you set it.

The long line is dark green, not bright green. At one pixel wide on a light chart it reads as near-black, while the buy arrows are bright lime. They look like different things and they aren't. Widen the line in the chart properties if it bothers you.

Nothing confirms anything. The stop and the signal come from the same price series. There's no trend filter, no higher timeframe, no momentum. In a range you get alternating arrows every few bars, as the July stretch on the EURUSD chart shows.

Signals and stop come from closes only. A wick through the line means nothing here; only a close counts. That's a sensible design and it also means an intrabar spike that takes out a real stop order leaves this indicator unmoved.

Show Line only exists on MT5. The MT4 build always draws the stop. Minor, but it's a real difference between the two.

One setting has to work everywhere. Key Value 1.0 on gold H1 and on EURUSD H4 are very different propositions. The ATR scaling handles the instrument's volatility; it does nothing about the timeframe or your holding period.

Questions you'll have

Does UT Bot Alerts repaint? The stop on closed bars doesn't change. The forming bar can cross and uncross, so its arrow can appear and disappear. The alert that fired doesn't come back.

Is the signal really an EMA cross? No. The EMA has a length of one, which is the price itself, so it's price crossing the stop.

What should I set Key Value to? Start by comparing 1 against 3 on your own chart. The two gold charts above are the same three weeks at those two settings.

Why does the line jump over price? Because when the side changes the stop is recomputed on the other side of price rather than trailing across.

Does the Heikin Ashi option use real Heikin Ashi candles? No, it uses the ohlc4 average, which is the Heikin Ashi close formula only. There's no recursive open.

Why am I not getting alerts? Set noti_type; it defaults to none.

Can I get alerts only on closed bars? Not in this build. Alerts evaluate on the forming bar.

Can an EA read it? Yes, and easily โ€” the arrows are plotted buffers, not objects, and the position state is a buffer as well.

Best timeframe? M30 and above, and raise Key Value as you go down. On M5 at the default it signals constantly.

MT4? Both platforms are included, one download each. Same stop, same signals; MT4 draws the line as two buffers and has no Show Line switch.

Support

Send me a message with a screenshot, the symbol and the timeframe, and I'll tell you what the tool was doing on that bar.

Analysis tool. It places no trades and makes no profitability claim. Past price behaviour is not a guide to future price behaviour.