HalfTrend is a stepped trend line on MT4 and MT5 with an ATR channel drawn around it and Buy/Sell arrows on the flips. The name is literal: while the line is long it only looks at the lows of each bar, and while it is short it only looks at the highs.

Gold H1 at the default amplitude of 2: the line stepping up through lows, down through highs, with the channel filled on both sides

The half it looks at

In an uptrend the indicator keeps a running high-water mark of the lowest price of each bar. Every new bar raises it if that bar's low is higher than the mark, and never lowers it. The line you see is that mark. Highs are invisible to it: a bar can spike as far up as it likes and the line doesn't care, because in an uptrend a high tells you nothing about whether the trend is failing.

In a downtrend it's mirrored, and it becomes a low-water mark of the highs.

That's the whole reason the line looks the way it does. It is a ratchet built from one side of the candle, and the side it uses is the side that would have to break for the trend to be in trouble.

What it takes to flip

Two things have to be true on the same bar, and the second one is stricter than most people expect.

First, the short average of the highs over the last amplitude bars has to fall below the running high-water mark of lows. That means recent highs are no longer holding above where the lows have already been, which is the structural part of the test.

Second, the bar has to close below the previous bar's low. Not below the line, not below the channel: below the actual low of the bar before it. That's a hard, discrete event, and it's why flips happen on decisive bars rather than on slow drifts.

When the flip fires, the new line is set to the last value of the other side. That's the vertical jump you see at every arrow โ€” the line doesn't slide across, it lands on the level the opposite ratchet had been holding, and starts again from there.

Amplitude does more than it looks like it does

amplitude is 2 by default, which is short enough that the highs-average part of the test is nearly the current bar. The heavy lifting at that setting is done by the high-water mark and the close-below-the-previous-low trigger.

Raise it and the character changes completely. Here is the same gold chart at 6:

Gold H1 at amplitude 6: the same construction, roughly half as many flips, longer shelves

Same window, same instrument, about half the flips. The averages are longer, so the structural half of the test takes longer to fail, and the line rides through pullbacks that would have flipped it at 2. It is the one setting worth spending time on.

The channel

The dotted lines and the shaded ribbons are the line plus and minus channelDeviation ร— ATR(100)/2. At the default deviation of 2 that's exactly one ATR either side.

Two honest things about it:

The ATR period is fixed at 100 and there is no input for it. You can change the deviation multiplier, not the period.

The channel does not gate any signal. It's context, and it's where the arrow gets drawn โ€” half an ATR off the line so it doesn't sit on the candle. Nothing in the flip logic references it. If you were hoping price has to clear the channel to trigger, it doesn't.

Both ribbons are drawn at once, above and below, rather than only the side that matters for the current trend. So the pink band is visible in an uptrend too.

EURUSD H4: the same construction on a slower instrument, where the flips thin out considerably

Moving average ATR trailing stop This
Uses which part of the bar Close High and low both One side only, depending on trend
Can move against the trend Yes No No
Flip test Cross Distance from extreme Structure test and close beyond previous low/high
On a flip the line Continues Jumps by the stop width Lands on the opposite ratchet's last value
Channel None Is the signal Drawn, but not part of any signal

What you get

The coloured line, two dotted channel lines, two shaded ribbons, Wingdings arrows and Buy/Sell text at the flips. Notifications go through the shared block โ€” alert, email, push or Telegram โ€” once per bar per message.

For EA use: on MT5 the line is buffer 6, its colour index is 7, and the trend state is buffer 9, where 0 is up and 1 is down. On MT4 the layout is different because MT4 has no coloured line, so the line is drawn as two overlaid buffers and the arrows are real DRAW_ARROW buffers at 8 and 9 that an EA can read directly. Reading the trend state buffer is more reliable than watching for the arrow either way, because the state is defined on every bar.

Where it's weak

The arrow and the text label sit at the same price. Both are anchored to the channel edge, so on MT5 the Wingding and the word "Sell" overlap and neither is easy to read at a glance. Turn one of the two off โ€” showArrows or showLabels โ€” and the chart gets much cleaner.

The two platforms don't ship with the same notification default. MT5 starts with the alert popup enabled; MT4 starts with notifications off. Set noti_type explicitly on whichever platform you use rather than assuming it matches the other.

101 bars of warm-up before anything is drawn. The fixed ATR(100) sets the floor. On a fresh chart with a short history the left side stays empty, and on a symbol your terminal hasn't downloaded yet you may see nothing at all until the history arrives.

Amplitude 2 is noisy on fast charts. The gold H1 chart above has fourteen flips in three weeks. That is what the default does, and it is not a criticism of the maths โ€” it is what a 2-bar structural test produces. Read the two gold charts side by side before you decide which setting you want.

The signal is a chart object on MT5, and objects can be removed. If a flip happens mid-bar and unwinds before the close, the arrow is deleted again. The alert that already fired is not. AlertOnBarClose is true by default, which is the right setting, and you should leave it there.

No trend context of any kind. Higher-timeframe agreement, session filters, momentum: none of it is here. Every flip is treated the same whether it is the third one this morning or the first one in a week.

Nothing adapts to the instrument. Amplitude and deviation are the same numbers whatever you attach it to. The ATR channel scales with volatility, but the flip test doesn't.

Questions you'll have

Does HalfTrend repaint? The line on closed bars does not change. The forming bar can flip and unflip while it develops, and the arrow on it is deleted when that happens.

Why does the line jump instead of sliding when it flips? Because the new value is taken from the opposite ratchet, which has been sitting on the other side of price. That gap is the flip, drawn.

What does "half" mean? It only reads one side of each bar: the lows while it is long, the highs while it is short.

What exactly triggers a flip? Two conditions together: the short average of the highs falls below the running mark of lows, and the bar closes below the previous bar's low. Mirrored for the other direction.

Does price have to break the channel? No. The channel is drawn for context and to place the arrow. It's not in the signal logic.

Can I change the ATR period? No, it's fixed at 100. You can change the deviation multiplier.

What should I set amplitude to? Start at 2 to see what it does, then compare against 4 to 6. Higher means fewer, later, cleaner flips.

Can an EA read it? Yes. Use the trend state buffer rather than the arrows: buffer 9 on MT5, and on MT4 the arrows are readable buffers too.

Best timeframe? H1 and above. On M5 with the default amplitude the flips come too fast to act on.

MT4? Both platforms are included, one download each. Same flip logic and same channel; MT4 draws the ribbon as histogram bars rather than a solid fill, so it looks slightly hatched.

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.