Half Trend ADX MT4
- Indicatori
-
Allan Aparece Ninal
Sviluppo indicatori ed Expert Advisor per MetaTrader 5.
Come lavoro:
- Ogni indicatore viene controllato contro il repainting: i segnali vengono decisi solo su barre chiuse, e un test su ogni tick conferma che non cambiano in seguito. - Versione: 1.1
- Aggiornato: 23 novembre 2026
- Attivazioni: 10
Half Trend ADX MT4 is a trend indicator for MetaTrader 4 that draws a trend line with buy and sell arrows where the trend turns. It adds an ATR channel and alerts. Arrows appear when a bar closes and never move afterwards. Run the free demo in the Strategy Tester on your own symbol before you decide.
It is an indicator, not a trading system: it places no orders and manages no trades. Arrows and alerts come from closed bars and do not repaint.
Standalone: everything is built in. You do not need to buy or install any other product named on this page.
In plain words
Price moves up and down all the time. A trend line tries to show which way the market has really turned, so small pullbacks do not distract you.
Half Trend ADX draws one line that is blue in an up trend and red in a down trend. In an up trend the line sits under recent lows and can only rise. In a down trend it sits over recent highs and can only fall.
When the market turns, the line flips colour and one arrow marks that bar. A buy arrow means the trend turned up. A sell arrow means it turned down.
Not every turn is worth your attention. Turns in a flat market are often weak. The ADX is a number that measures how strong a trend is. With the ADX filter on, the indicator hides turns where ADX is below 25.
The arrow marks where the trend turned. It does not say how far price will go.
MetaTrader 4 edition: the same calculation, line, arrows, channel, ADX filter, alerts and buffers 0-6 as the MetaTrader 5 version. Only the arrow distance is set as a fraction of ATR(14), because MetaTrader 4 cannot shift arrows by pixels. The arrow buffers hold the arrow's price, that distance below the low or above the high.
What you see on the chart
- The Half Trend line follows the market. It is blue while the trend is up and red while it is down.
- Price breaks the other way. A bar closes beyond the previous bar's extreme, and the recent bars confirm the turn. The line flips colour.
- The indicator checks ADX on that bar. If ADX is at least 25, the bar gets a buy arrow under its low or a sell arrow over its high.
- Pop-up and push alerts are sent once for that closed bar.
- Two optional dotted lines draw the ATR channel around the trend line. The ADX value shows in the Data Window.
Worked example
XAUUSD H4, default inputs, from the parity test dump of this indicator (bar open times in server time). Amplitude is 2, so the window is the last two bars.
| Bar opens | High | Low | Close | Line | State |
|---|---|---|---|---|---|
| 29 Sep 2026 16:00 | 4175.20 | 4144.44 | 4145.60 | 4140.29 | down trend, no signal |
| 29 Sep 2026 20:00 | 4185.21 | 4142.10 | 4180.11 | 4140.29 | turns up: buy arrow at 4142.10 |
| 30 Sep 2026 00:00 | 4187.60 | 4176.67 | 4176.67 | 4142.10 | up trend, line at the arrow low |
On the 20:00 bar the average of the last two lows is (4144.44 + 4142.10) / 2 = 4143.27. That is above the lowest recent high, 4140.29, which the down-trend line followed. The close, 4180.11, is above the previous bar's high of 4175.20. So the trend turns up.
ADX on that bar is 42.3, above the minimum of 25, so the arrow shows. The arrow and its alert appear when the 20:00 bar has closed.
Key facts
| Type | Indicator drawn on the price chart, for MetaTrader 4. |
| Draws | The Half Trend line in two colours, buy and sell arrows, an optional ATR channel. ADX is in the Data Window. |
| When a signal is final | When its bar closes. The forming bar never carries an arrow, and a closed bar's arrow never changes. The line and channel can move on the forming bar. |
| Reload and timeframe change | All arrows are calculated again from closed bars and come out the same with the same inputs and history. No alerts are sent for those old signals. |
| Alerts | Pop-up and push are on. Sound and e-mail are off. One alert per signal, sent once per closed bar. Alerts are silent in the Strategy Tester. |
| Trades | No. It places no orders. |
| Other products needed | None. |
| Symbols and timeframes | Any symbol and timeframe. Checked on EURUSD, GBPJPY, XAUUSD and BTCUSD at M15, H1 and H4. |
| History needed | The channel and arrows start at the 100th bar of history, when ATR(100) exists. With the ADX filter on, an arrow also needs ADX, which starts at the 28th bar with the default period. |
Quick start
- Attach it to any chart. The defaults are Amplitude 2 and the ADX filter on with Minimum ADX for a signal 25.
- Raise Amplitude or Minimum ADX for fewer arrows, lower them for more.
- Pop-up and push alerts are on. Switch on Play a sound or E-mail if you want them. Push needs your MetaQuotes ID in the terminal options.
Who it is for
For traders who read trend turns on the chart, or build their own rules or Expert Advisor on an indicator. Not for anyone looking for an automatic trading robot.
How it works under the hood
The Half Trend rule
The rule follows the HalfTrend indicator by everget on TradingView and is rewritten in MQL5. Let A be the Amplitude (default 2). For each bar the indicator takes the highest high and lowest low of the last A bars. It also takes the average high and average low of those bars.
- The trend turns up when the average low is above the lowest recent high and the close is above the previous bar's high.
- The trend turns down when the average high is below the highest recent low and the close is below the previous bar's low.
- In an up trend the line follows the lowest low of the last A bars, and only ever rises. In a down trend it follows the highest high of the last A bars, and only ever falls.
- On the turn bar the line takes the value of the old line, then follows the new trend.
ATR channel
The channel is the line plus and minus Channel deviation x ATR(100) / 2. ATR is Wilder's average true range, seeded with the simple average of the first 100 true ranges, as on TradingView.
ADX filter
ADX is Wilder's. The +DM, -DM and true range are smoothed with a 1/N weight. DX is the gap between +DI and -DI over their sum, and ADX is the smoothed DX. The default period is 14. Exact ties between an up move and a down move count as no move.
The filter checks ADX on the signal bar. If it is below the minimum, the arrow and its alert are hidden. The line itself always follows the trend. Switch the filter off for an arrow on every turn.
When a signal is final
Signals are decided on closed bars only. The newest closed bar is checked for a turn. The mark and the alert appear when the next bar opens, and they do not move afterwards.
This differs from TradingView in two ways. Arrows sit at the bar's low or high, not at the line minus or plus half an ATR. And the ADX filter is on by default.
Reload, restart and timeframe change
After a reload, a terminal restart or a timeframe change, the indicator reads the closed bars again and redraws every arrow. The arrows land on the same bars with the same inputs and history. If your broker corrects old bars, arrows on those bars can change.
Inputs
| Input | Default | What it does |
|---|---|---|
| Amplitude | 2 | Bars in the high/low window. Larger values give fewer, slower turns. |
| Channel deviation | 2.0 | Channel width as a multiple of ATR(100) / 2. |
| Only show signals when ADX is strong | on | Turns the ADX filter on or off. |
| ADX period | 14 | Period of the ADX calculation. |
| Minimum ADX for a signal | 25 | Turns below this ADX are skipped. |
| Draw the Half Trend line | on | Shows or hides the line. |
| Draw the ATR channel | on | Shows or hides the channel. |
| Arrow distance from the candle | 0.3 | Gap as a fraction of ATR(14). |
| Pop-up alert | on | Alert window in the terminal. |
| Play a sound | off | Plays the sound file below. |
| Sound file | alert.wav | File from the terminal Sounds folder. |
| Push notification | on | Needs your MetaQuotes ID. |
| off | Needs e-mail set up in the terminal options. | |
| Debug log for bug reports | false | Found a problem? |
Starting settings
The starting settings screenshot shows four presets, one per timeframe. They are M15 (Amplitude 3, Minimum ADX 30), H1 (2, 25), H4 (2, 20) and D1 (1, 20). They differ in how many arrows they give, not in how well they trade. None is optimised. Arrows per month, counted from October 2023 to October 2026 on EURUSD, GBPUSD, USDJPY and XAUUSD.
| Timeframe | Arrows per month |
|---|---|
| M15 | 13 to 15 |
| H1 | about 10 |
| H4 | about 4 |
| D1 | about 1 |
Alerts and Expert Advisor use
Alerts. One alert per signal, sent when the bar closes. The text gives BUY or SELL, the close, the line value and the ADX value. None is sent twice for the same bar, while the history loads or in the Strategy Tester.
Buffers for Expert Advisors. Read buffers 2 and 3 from bar 1, the last closed bar, backwards. Empty values are EMPTY_VALUE.
| Buffer | Content |
|---|---|
| 0 and 1 | Half Trend line and its colour (0 up, 1 down) |
| 2 | Buy arrow (the bar's low) |
| 3 | Sell arrow (the bar's high) |
| 4 and 5 | Channel upper and lower line |
| 6 | ADX |
How it was checked
- Code check: an every-tick run in the MetaTrader 4 Strategy Tester on EURUSD H1, 2026: 8,417,316 ticks, 4,812 closed bars and 109 signals. No signal changed after its bar closed and none appeared on the live bar.
- Code check: in the MetaTrader 4 Strategy Tester, the line, channel, ADX and every arrow matched an independent reference calculation. That covers 37 runs on EURUSD, GBPJPY, XAUUSD and BTCUSD, M15, H1 and H4, with three settings.
- These checks show the indicator behaves as described. They do not show that the arrows are profitable.
Not tested: alerts on a live chart (the tester is silent for alerts). No profit or accuracy test was made. This is a drawing and alert tool, not a strategy.
Limits
- An arrow marks a trend turn. It is not a bottom or top call, and price can turn back.
- The turn is confirmed on a closed bar, so the arrow comes after the extreme, never on it.
- It gives no stop loss, target or lot size.
- The ADX filter hides weak turns, and a hidden turn can still become a strong trend.
- Arrows depend on your broker's bars. Another broker's history can give different arrows.
- The first 100 bars of history carry no channel or arrows.
- Alerts need the terminal running with the chart open.
FAQ
Does it repaint? Arrows and alerts are decided at bar close and do not change afterwards. The line and channel can move on the forming bar.
Can I try it first? The Market demo runs in the Strategy Tester, in visual mode, only.
Does it work on gold and crypto? It runs on any symbol and timeframe. XAUUSD and BTCUSD were part of the checks above.
Can I get alerts on my phone? Yes, switch on Push notification and set your MetaQuotes ID in the terminal.
Do I need the ADX filter? No. Switch it off for an arrow on every turn.
What happens if I change the timeframe or reload the chart? The indicator reads the closed bars again and draws the same arrows. It sends no alerts for old signals.
Can an Expert Advisor read it? Yes. Read buffers 2 and 3 from bar 1.
Can I run it on a VPS? Yes, like any indicator. It needs a running terminal with the chart open and it places no orders.
Try it first
The Market demo runs in the Strategy Tester, in visual mode. Pick your own symbol and timeframe, then check each arrow against its bar. The history shows when each arrow appeared, not what price did next.
Works well with
These are workflow suggestions. I have not found that any pair gives better trading results. You do not need any of them.
| Product | How to use them together | Why |
|---|---|---|
| Risk Position Tool MT4 | Pick the trade from the chart, then drag the entry and stop lines. The tool gives the lot for your risk. | It separates where you enter from how much you risk. The tool places no orders. |
| Session Levels MT4 | Add it to the same chart. | It draws session boxes and previous day and week levels as context. It is not a signal. |
| Signal Trader Pro MT4 | Choose Half Trend as the source and put this indicator on the same chart. | You see the arrows the EA reads. No preset is validated for this source. |
Stacking more indicators was not found to improve results in my gold tests, so I do not suggest it.
Related products
- Half Trend ADX: the same indicator for MetaTrader 5.
- SuperTrend Signal Alerts MT4: free trend-flip arrows on closed bars, with optional EMA and RSI filters and the same alert channels.
- UT Bot Signal Alerts MT4: free buy and sell arrows from a trailing line, on closed bars, with the same alert channels.
- Confluence Dashboard MT4: a dashboard of eight checks across many symbols; Half Trend is one of them (off by default).
- Confluence Signal Alerts MT4: the same eight checks on one chart, as a free card with arrows.
- Repaint and Signal Scorecard MT4: a free indicator that checks whether another indicator's signals repaint and how they did on history.
- Indicator Arrow Trader MT4: a free EA that trades the buy and sell buffers of an indicator you name.
- Signal Trader MT4: an Expert Advisor that trades the UT Bot, SuperTrend, Range Filter or Half Trend signal. The calculation is built in.
- All my products on MQL5
Custom work
Want an EA that trades this indicator, a custom version of it, several of my indicators or EAs combined into one, an EA that trades another indicator you use (mine or another developer's), or a new indicator or EA of your own? Order it through MQL5 Freelance and choose me as the developer: order through Freelance. Send your requirements, rules and the flow or algorithm you want. The whole order, payment and delivery stay inside MQL5 Freelance.
Found a problem?
- In the inputs, set "Debug log for bug reports" to true.
- Repeat what went wrong.
- Open the Experts tab in the Toolbox. Copy the lines that start with "DBG" and paste them in a comment on this page, with the symbol and timeframe.
- Set the debug log back to false.
The debug lines never contain your account number, name, server, balance or equity.
If you find it useful, a short review on this page helps other traders find it.
Questions: use the comments on this page or send me a message on MQL5.
Trading carries risk of loss, and past behaviour of an indicator says nothing about the future.
