The apex trend indicator hangs two bands around the median price and shows whichever one the trend is using. `AtrPeriod` sets the volatility window and `Mult` sets the distance. Each band only tightens while the trend holds. When a close breaks the far band, the line flips and an arrow marks the bar.
This build ships as a compiled .ex4 for MT4 and .ex5 for MT5; the screenshots below come from EURUSD H1.
| Platforms | MT4 (.ex4) + MT5 (.ex5) |
|---|---|
| Chart window | Main price chart |
| Plots | 4: Apex Trend Up, Apex Trend Down, Apex Buy, Apex Sell |
| Alerts | popup, push notification, email, sound |
| Inputs | 9 |
What the Apex Trend Indicator draws on the chart
Apex Trend Up is the dodger blue line, drawn while the direction reads up.
Apex Trend Down is the red line for the other direction.
Apex Buy and Apex Sell mark the bar where the direction flipped.
The code stitches one bar of the previous segment so the colours join cleanly.
- Apex Trend Up: line, dodger blue, width 2
- Apex Trend Down: line, red, width 2
- Apex Buy: arrow, dodger blue, width 3, arrow code 233
- Apex Sell: arrow, red, width 3, arrow code 234

How the Apex Trend Indicator calculates its values
Building the raw bands
hl2 takes high plus low over two. upBasic adds `Mult` `3.0` times iATR at `AtrPeriod` `10`, and loBasic subtracts it. Those two are recalculated fresh on every bar before any ratcheting happens.
Ratcheting the final bands
fUp keeps the tighter of upBasic and the previous upper band, unless the previous close broke above it. fLo does the mirror. That rule is what stops the line drifting back toward price during a pullback.
Flipping the direction
dir moves to 1 when the close clears the previous upper band and to minus 1 when it breaks the previous lower one. Otherwise it carries forward. STBuf then takes fLo in an uptrend and fUp in a downtrend.
How to read the signals
The visible line is the band the trend is leaning on.
A flip arrow marks the close that broke the opposite band.
Distance from price to the line tells you how much room the current setting allows.
Lower `Mult` for a line that hugs price and flips sooner.
Alert channels in this build: popup, push notification, email and sound, one message per closed bar.
The alert block sits behind `EnableAlerts`, which ships on, and `EnablePopup` delivers the text. `EnablePushNotify`, `EnableEmail` and `EnableSound` all start false. `SoundFile` picks the clip. One turn message follows each closed bar.
Every Apex Trend Indicator input
Core settings
| Setting | What it does | Default |
|---|---|---|
AtrPeriod |
ATR period. Bars in the ATR reading, default `10`. | 10 |
Mult |
ATR band multiplier. Band distance in ATR units, default `3.0`. | 3.0 |
Display settings
| Setting | What it does | Default |
|---|---|---|
ArrowOffset |
Flip-arrow offset (points). Flip mark distance from the bar in points, default `30`. | 30 |
Alert settings
| Setting | What it does | Default |
|---|---|---|
EnableAlerts |
Master alert switch. Master switch over the turn alerts, default `true`. | on |
EnablePopup |
Popup alert. Terminal dialog when the line turns, default `true`. | on |
EnablePushNotify |
Push notification to mobile. Mobile push when the line turns, default `false`. | off |
EnableEmail |
Email alert. Mail delivery when the line turns, default `false`. | off |
EnableSound |
Sound alert. Sound playback when the line turns, default `false`. | off |
SoundFile |
Sound file. Wav clip for the turn alert, default `alert.wav`. | alert.wav |

Settings that fit your chart
A ten-bar ATR reacts quickly, so the bands adapt within a session. EURUSD H1 is the reference chart. On M5 the short window makes the line jumpy and flips arrive in bunches. On H4 the same setting covers under two days, which keeps the line responsive without constant turns.
When the Apex Trend Indicator fails
A short ATR window makes the bands widen and narrow sharply after one busy bar.
Ranges produce repeated flips, each giving back the band distance.
The flip test reads the previous band, so a violent bar can flip the line and reverse on the next.
Copy the compiled Apex Trend Indicator file into your MQL4/Indicators folder, and the MT5 build into MQL5/Indicators, then restart the terminal and drag it onto a chart. The step-by-step guide with screenshots is at how to install MT4 and MT5 indicators.
Download the Apex Trend Indicator for MT4 and MT5
The zip holds the compiled Apex Trend Indicator build for MT4 and MT5, plus a short README. Compiled files only, no source. Enter your email below and the download link arrives in your inbox.
Download this indicator free
Enter your email and the file is yours. You also get the full MT4 and MT5 library.
FAQ
What does AtrPeriod at 10 change here?
How quickly the bands respond to a change in volatility. Ten bars is short, so one large candle widens the bands noticeably. A longer window smooths that out and keeps the line steadier through a single busy session.
Why does Mult default to 3.0?
It is the usual starting distance for a banded trend line. Three ATR is wide enough to sit through an ordinary pullback and tight enough to flip when a real turn happens. Lower it to 2.0 for a line that tracks price more closely.
What stitches the Apex Trend Up segments together?
The code writes the previous bar value into the same buffer at each flip. Without that step the two coloured lines would leave a one-bar gap where the direction changed, which makes the chart harder to read than it needs to be.
Does ArrowOffset affect the calculation?
No. It only moves the flip mark away from the candle, by `30` points at the default. The band values, the ratcheting and the direction test all run the same whatever you set here. Raise it on charts with tall bars.
Are results guaranteed?
No. Trading involves risk. Results are not guaranteed; past performance is not indicative of future results. Use the Apex Trend Indicator as one input. Always backtest before trading live.
External references
- Learn more about the underlying method in Floor broker on Wikipedia.
- For wider market background, see Six Month Cycle MACD at StockCharts ChartSchool.
