New article Several Ways of Finding a Trend in MQL5 is published:
Any trader would give a lot for opportunity to accurately detect a trend at any given time. Perhaps, this is the Holy Grail that everyone is looking for. In this article we will consider several ways to detect a trend. To be more precise - how to program several classical ways to detect a trend by means of MQL5.
How to detect forex trends
Detecting a trend is an important part of predicting direction in a
currency pair. Tomorrow’s prices usually follow or continue today’s
trend. There will, of course, be reversals and ranging behavior within
the trend but it is easier to trade with a known trend than to predict
when it changes. The task of the forex trader is to detect variations or
waves of sentiment. The trader needs to ask: is there a shape to
changes in sentiment and can it be detected? To answer this question, we
can turn to price break charts (also called three-line break charts).
In recent months, Bloomberg Professional stations added these charts.
They also are available in many retail charting programs such as eSignal
Price break charts show only a new high close or a new low close. For
example, if a trader using a candlestick chart of a daytime interval
converts it to a three-line price break chart, he would see the price
action from a different vantage point. The price break chart would only
show consecutive new day high closes, or consecutive new day low closes.
If no new high or new low is reached, then no additional bar would
appear. But when the price reverses, it shows a new column only if the
price reverses three previous highs (downward reversal) or three
previous lows. This is why it is called a
three-line break chart. The conditions for a bullish and bearish
reversal are easily identified.
Three-line break charts enable significant insights into the shape of
sentiment in the price action. A trader can detect the prevailing
sentiment, how strong it is, whether a change in sentiment has occurred
and project where the next trend reversal will occur. Several examples
of using the three-line break as an indicator occurred in the GBP/USD
pair in 2009 (see “Show me the move”).
The year started with a series of three consecutive new lows. It then
reversed to a distance of four new consecutive highs. The sequence
reversed back to four new consecutive lows followed by three consecutive
new highs. In April, we see a very significant sentiment event, a
flip-flop. This is a new downward reversal followed immediately by an
upward reversal. In other words, market sentiment did not continue into a
series. When a flip-flop occurs, it is rarely followed by another
immediate reversal and therefore is a signal that the trend direction
after the flip-flop will continue for a longer distance. This is exactly
what occurred. The GBP/USD flipped from a low of 1.4252 on March 30 to a
high of 1.5002 on April 15.
Also in the pound, we see a long sequence of 20 new consecutive day
highs that occurred between May 1 and June 11, taking it from 1.4490 to
1.6598. While the ultimate length of the sequence is not predicable,
what was clear to the trader was that the previous highest uptrend
sequence before the long run up was five new consecutive highs. When a
previous sequence of highs or lows is broken by a new sequence, this is
an alert that the sentiment is becoming stronger than ever.
After the 20 new consecutive highs were achieved, GBP/USD no longer
had the energy to repeat this sequence. It entered into a series of
smaller consecutive new daily highs, and reversals into consecutive new
lows. GBP/USD ended with a reversal up with two consecutive new daily
Price break charts can be used for any time frame. Scalpers could use
a one-minute price break to spot what is the intra-hour prevailing
sentiment. While price break charts do not predict the duration, or the
distance of a new trend, they reveal the strength of the prevailing
sentiment. That can be enough to get an edge for the scalper or the