Wave Trend Oscillator MTF MT4
- Indicators
-
Evgenii Sutulov
I build trading indicators, strategies, and dashboards that don't repaint.
Seven years doing this. MetaTrader 4, MetaTrader 5, TradingView.
Closed bars only. What you see is what happened.
The bar being formed never changes a published value. - Version: 1.3
An oscillator that ignores every cross in the middle of the range. Wave Trend Oscillator MTF publishes a cross only when it happens inside a zone the market has actually reached, grades it by how deep that zone was, finds divergences on the fast line and can draw them on the price chart where you trade, and it can compute all of this on a higher timeframe while you watch your own. Free, no trial, no locked functions.
The fast line measures how far the typical price has run from its own smoothed centre, relative to its recent average deviation, and a slower average of that fast line is drawn beside it. Three things are published: the cross, the grade of the zone it happened in, and the divergences found on the fast line.
The cross, the grade and the divergence
A buy cross counts only while the slow line is below the oversold level, and a sell cross only while it is above the overbought level. Anything else is ignored.
A signal is grade one when it happened in the armed zone, and grade two when the slow line also reached the deeper level. The grade describes how far into the zone the market was, not how likely the trade is to work.
Divergence is found by comparing pivots on the fast line with pivots in price. Bullish and bearish disagreements are marked and connected with a line. The same divergence can also be drawn on the price chart itself, between the two price pivots, so you see it where you actually trade.
The momentum histogram between the two lines is coloured by whether the current bar is expanding on the previous one or fading against it, so a still positive but shrinking histogram reads differently from a growing one. This colouring can be switched off, which returns the plain single colour histogram exactly.
What is on the chart
In its own sub-window, with a dotted zero level: the fast and slow wave lines, and the histogram of their difference, coloured by expansion and fading. Divergence lines are drawn in the sub-window and, optionally, on the price chart as well.
The panel
A canvas panel sits by default on the price chart rather than in the oscillator pane, though it can be put there. It is draggable, collapsible and closeable. It shows the timeframe in force, the channel length and the average length; what the last closed bar is, meaning the two wave values and either BUY with its grade, SELL with its grade, or no cross; and whether the numbers came from the properties dialog or from the panel, and how many of them were changed.
The gear opens a sheet of three tabs. Values holds the timeframe, the channel length, the average length, overbought level 1, oversold level 1, whether divergence lines are drawn, and the shortest and longest pivot span a divergence may have. Every row has steppers, a range and a sentence of help. Alerts holds the master switch, the per-event switches, four channels, the cooldown in minutes and a test alert. Styles holds the palette, whether the lines and the momentum histogram are drawn, and the line width; it is appearance only and recomputes nothing.
A value moved on the panel takes effect at once, on a closed market too: the lines, the histogram and the signals are recomputed there and then rather than waiting for the next tick. Three colour schemes are included, one of them colour-blind safe, built on blue and orange so that red is never set against green. Panel state and every change made on the sheet persist per chart across a timeframe change and a terminal restart. The interface is English.
Alerts
Alerts are off out of the box. Six events can be raised: a BUY signal, a SELL signal, a bullish divergence formed on the fast line, a bearish divergence formed on the fast line, the fast line crossing the zero line up, and the fast line crossing it down.
Four channels carry them: popup window, sound, push to the mobile terminal, and e-mail. Switches are per event and per channel, and a cooldown, two hours by default, keeps a repeat quiet.
Alerts fire on the last closed bar. Two further alerts, off by default, speak on the forming bar within a chosen number of seconds of its close, and they are labelled early because a cross that exists mid-bar can be gone at the close. There is deliberately no forming-bar divergence alert: a divergence needs a confirmed pivot, and announcing one on an unfinished bar would be a guess rather than an early reading. Telegram is not part of this product.
Multi-timeframe
The Timeframe setting computes on a higher timeframe and draws the result here, reading only closed senior bars. A chart bar shows the newest senior bar that had already closed by its own time, not the one that contains it.
Divergence lines are anchored by bar time rather than by index, because on a foreign timeframe the pivots are senior bars and an index into that series means nothing on this chart.
A foreign series is built in the background. The first read of it can return nothing, the indicator retries, and the panel says whether it is waiting for a download or short of history.
Reading it from an EA
Fourteen buffers, all readable through iCustom. MetaTrader 4 draws only the leading buffers, so the drawn series come first and the readable contract sits behind them. This map is not the MetaTrader 5 edition's map: an EA written against that edition must be re-pointed to the indices below.
Buffers 0 to 4 are the display split of the momentum histogram, one plain histogram per state: neutral, expanding up, fading up, expanding down, fading down. Buffer 5 is WT1, the fast wave line, and buffer 6 is WT2, the slow one. Buffer 7 is WT1-WT2, the histogram as one series, and buffer 8 is the colour index that goes with it. Buffer 9 is Signal: +1 on a BUY cross, -1 on a SELL cross, 0 when there is none. Buffer 10 is Grade, 1 or 2 on a signal bar. Buffer 11 is Div, the divergence state. Buffer 12 is Zero: +1 when the fast line crossed zero upwards, -1 when it crossed downwards, 0 when it did neither. Buffer 13 is Override, the number of settings changed from the panel.
The Data Window lists the seven drawn rows, the five histogram columns and the two wave lines. The contract, buffers 7 to 13, does not appear there, and that proves nothing: iCustom reads every index above just the same. This product has no separate Buy and Sell price buffers; the signal is buffer 9 and its grade is buffer 10.
MQL4 has no input groups, so the parameter list an EA passes to iCustom here is shorter than the MetaTrader 5 edition's, and the positions differ. Build the call against this edition's input list, not the other platform's.
The Styles tab hides a plot by taking its colour away, never by emptying a buffer. An instance created by iCustom is read-only and always uses the parameters you passed. Buffer 13 exists so that a strategy can tell that a chart instance is running on values changed by hand from the panel.
Provenance
This is a port of "WaveTrend [LazyBear]" from TradingView. The provenance is a reconstruction: the formulas are canonical and widely mirrored, and they were used as the working specification for this product. The script is openly published, which makes a port by formula admissible.
The product carries the method's name because that is what it implements. The original work is LazyBear's and no authorship of it is claimed here.
Honest limits
The oscillator is live on the forming bar. A cross that exists mid-bar can be absent at the close, and the panel line and the grade go with it. Closed bars do not change.
Divergence marks are never placed on the forming bar. A pivot needs the bars on either side of it to exist before it is a pivot, so divergence appears after the fact by construction. That is a property of divergence rather than a defect, and it also means a divergence is never drawn into a past bar that did not have one.
The grade describes the depth of the zone reached, not a probability. A grade 2 signal was further into the zone. That is all it says.
A cross is not direction. In a trend the oscillator will reach one zone repeatedly, and every cross it produces will be against that trend.
The channel length and the average length move every cross the product will ever show. Two settings give two different sets of signals, and neither one of them is the correct one.
No profit figure, win rate or backtest result is claimed here.

