Every small wiggle is a peak if you look closely enough. The peak buy sell indicator confirms swing highs and lows with a three-bar rule, then drops any whose swing is smaller than a quarter of the average range. What remains gets a buy or sell mark and a dot on the turn.
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: Peak Buy, Peak Sell, Swing Low Dot, Swing High Dot |
| Alerts | popup, push notification, email, sound |
| Inputs | 12 |
Plots this indicator declares
Two signal marks and two dot plots.
`Peak Buy` prints lime at width 2 with arrow 233.
`Peak Sell` prints red at width 2 with arrow 234.
`Swing Low Dot` marks troughs in dodger blue.
`Swing High Dot` marks peaks in orange.
`InpArrowGapPoints` `30` sets the mark gap.
- Peak Buy: arrow, lime, width 2, arrow code 233
- Peak Sell: arrow, red, width 2, arrow code 234
- Swing Low Dot: arrow, dodger blue, width 1, arrow code 159
- Swing High Dot: arrow, orange, width 1, arrow code 159

How the source computes it
Finding a turn
`InpSwingDepth` `3` bars either side must stay beyond the candidate. That confirms a peak or trough without waiting too long.
The confirmation
`InpConfirmBars` `1` adds one closed bar after the turn. With `InpNonRepaint` on, the forming bar never takes part.
The size check
`InpAtrFilterMul` `0.25` of an `InpAtrPeriod` `14` range is the smallest swing kept. Set it to zero to keep every turn.
Reading it on a live chart
A lime mark sits under a confirmed trough.
Likewise, a red mark sits over a confirmed peak.
Dots, however, show the exact turning bar.
Small swings are dropped by the size check, so marks stay sparse.
Because of the confirmation, marks arrive a few bars late.
Warm-up needs about twenty bars.
Alert channels in this build: popup, push notification, email and sound, one message per closed bar.
A confirmed peak or trough is what reports. `InpEnableAlerts` is the master switch; the popup and the sound playing `InpSoundFile` ship on, while push and email stay off.
Every Peak Buy Sell Indicator input
Core settings
| Setting | What it does | Default |
|---|---|---|
InpSwingDepth |
Pivot depth (bars each side). Bars either side of a turn, `3`. | 3 |
InpConfirmBars |
Confirmation bars after pivot. Closed bars after the turn, `1`. | 1 |
InpAtrFilterMul |
Min ATR-multiple swing range (0=off). Smallest swing kept, in ranges, `0.25`. | 0.25 |
InpAtrPeriod |
ATR period. Range window, `14`. | 14 |
InpNonRepaint |
Non-repaint: skip current bar. Skip the forming bar, `true`. | on |
Display settings
| Setting | What it does | Default |
|---|---|---|
InpArrowGapPoints |
Arrow distance from bar (points). Mark gap in points, `30`. | 30 |
Alert settings
| Setting | What it does | Default |
|---|---|---|
InpEnableAlerts |
Master alert switch. Master switch for peak news, `true`. | on |
InpEnablePopup |
Popup alerts. Popup, `true`. | on |
InpEnablePush |
Mobile push. Mobile push, `false`. | off |
InpEnableEmail |
Email alerts. | off |
InpEnableSound |
Sound alert. Sound, ships on, `true`. | on |
InpSoundFile |
Sound file. | alert.wav |

Where to run it
Three-bar swings with a size check suit most liquid charts. EURUSD H1 is the reference chart, with several marked turns a day. On M5 the size check does most of the work. On D1 each mark is a meaningful swing.
When not to trust the output
A confirmed peak is always a few bars old.
Trends produce many small counter-peaks.
A quarter of the range is a light size check.
The sound route ships on.
Copy the compiled Peak Buy Sell 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 Peak Buy Sell Indicator for MT4 and MT5
The zip holds the compiled Peak Buy Sell 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
How late does a Peak Buy mark arrive?
Three bars after the trough for the swing rule, plus one more for `InpConfirmBars`. That delay is the price of never moving a mark once it prints.
What does InpAtrFilterMul 0.25 drop?
Swings smaller than a quarter of the 14-bar average range. Those are the wiggles inside a move, and dropping them keeps the marks on turns that mattered.
What are the Swing Low Dot marks for?
They show the exact bar of each confirmed trough, separate from the signal mark. The dot is where the turn happened; the arrow is where it was confirmed.
What happens with InpNonRepaint off?
The forming bar can take part in the swing test, so a mark may appear sooner but can also disappear if the bar changes before it closes.
Are results guaranteed?
No. Trading involves risk. Results are not guaranteed; past performance is not indicative of future results. Use the Peak Buy Sell Indicator as one input. Always backtest before trading live.
Category: this is part of our Signal and Forecast collection. Browse more Signal and Forecast for MetaTrader, or explore every MT4 indicator and MT5 indicator on the site.
External references
- Learn more about the underlying method in Choice architecture on Wikipedia.
- For wider market background, see Forex at Investopedia.
