Skip to main content
Version: 2.0

No.40: Trading based on candle pattern signals

Description

You can find an example for the Expert Advisor Builder on this page. If you need to familiarize yourself with the MetaTrader strategy tester and the Expert Advisor Builder, please begin with the Getting Started article.

A unique form of signal includes candle, chart, and Fibonacci patterns. The Expert Advisor Builder provides a broad array of search engines to detect signals not based on algorithms. A commonly used form of this is candle patterns. With over 20 types of searchable patterns, signals for trading strategies can be generated.

In this example, ten different types of bullish candle patterns are searched. Whenever one of the patterns is detected, a long trade is opened. As is common with many examples for the Expert Advisor Builder, only one trade is allowed to be open at a time, which implies that some signals may be overlooked. In addition, every trade is equipped with an average true range trailing stop loss.

Please note that this is not a plug-and-play trading strategy. A trading strategy needs suitable adjustments, fine-tuning to the timeframe and symbol, and thorough backward and forward testing. Therefore, providing fully working trading strategies as read-to-use examples is impossible. However, this example could serve as a foundation for your trading strategy.

Reset of inputs

Locate the Expert Advisor Builder application in the dropdown menu of the strategy tester settings under FEA Trading\MT4\Expert Advisor Builder 2.0 if you're using a MetaTrader 4 instance or FEA Trading\MT5\Expert Advisor Builder 2.0 if you're using a MetaTrader 5 instance. You can replicate the entire example in minutes by following the steps outlined in this article. To begin, kindly reset the strategy tester input as indicated.

Reset of MetaTrader strategy tester inputs.png

The default input parameters of the Expert Advisor Builder are designed to be highly functional. This implies that only some parameters must be adjusted when creating a new strategy. As a result, even with minimal reconfiguration, the output strategy can be significantly different.

Inputs configuration

Most examples can be executed in any timeframe and on any symbol. However, please set EURUSD as the symbol to be tested, M15 as the timeframe, select Open prices only (MT4) or 1 minute OHLC (MT5) as the model, and the previous four weeks as the test period. Finally, enable the visual testing mode.

Refer to the table below to set up the input parameters for the Expert Advisor Builder.

Input variable within MetaTrader
(Identifier in SET file)
Example valueUser manual chapters
> (OUF) Idea output description (max 63 characters)
(IN_strOufIdeaOutputDescription)
No.40: Trading based on candle pattern signalsOutput Folder
> (CAS) Signal in use
(IN_enmCasSignalInUse)
ONConfiguration
Available Pattern
> (CAS) COND, Selection 1
(IN_enmCasSelection1)
HAMMER
> (CAS) COND, Selection 2
(IN_enmCasSelection2)
BULLISH BELT HOLD
> (CAS) COND, Selection 3
(IN_enmCasSelection3)
BULLISH ENGULFING
> (CAS) COND, Selection 4
(IN_enmCasSelection4)
BULLISH HARAMI
> (CAS) COND, Selection 5
(IN_enmCasSelection5)
BULLISH HARAMI CROSS
> (CAS) COND, Selection 6
(IN_enmCasSelection6)
BULLISH DOJI
> (CAS) COND, Selection 7
(IN_enmCasSelection7)
BULLISH LONG LEGGED DOJI
> (CAS) COND, Selection 8
(IN_enmCasSelection8)
BULLISH GRAVESTONE DOJI
> (CAS) COND, Selection 9
(IN_enmCasSelection9)
BULLISH DRAGONFLY DOJI
> (CAS) COND, Selection 10
(IN_enmCasSelection10)
DARK CLOUD COVER

Confirm the inputs by pressing OK, and finally, start the test run with Start.

Chart example and SET file download

The underlying algorithm is highly optimized for execution speed. Generally, it only takes a few minutes until the entire test period is simulated. At the end, you will see a chart similar to the following.

Expert advisor builder example chart 0, Trading based on candle pattern signals.png
tip

To reproduce the chart from this example, you can download and use the SET file package eab_example_40_v_2_0.set.