9635002

2020.03.19 Experts

Specification

Here is an example of Requirements Specification for the development of the MACD Sample Expert Advisor, which is available in the MetaTrader 5 standard package.

1. The idea of the trading system is as follows: market entries are performed when MACD's main and signal lines intersect in the current trend direction.

2. Trend is determined based on the Exponential Moving Average with the specified period (InpMATrendPeriod). If the current EMA value is greater than the previous one, the trend is seen as growing (ema_current > ema_previous). Alternatively, if current EMA is below the previous one, the trend is considered to be falling (ema_current< ema_previous).

3. Trading Signals:

  • Buy signal: the main MACD line crosses the signal line upwards (macd_current>signal_current && macd_previous<signal_previous).
  • Sell signal: the main MACD line crosses the signal line downwards (macd_current<signal_current && macd_previous>signal_previous). The below figure shows Buy and Sell cases.


4. Positions are closed at opposite signals: Buy positions are closed at Sell signals, and Sell positions are closed at Buy signals.

5. Positions are opened at the market price, when a new bar emerges. The Expert Advisor is to be tested using Open prices, so there is no need to add functions for disabling operations inside the bar.

6. Additional filters for opening a position:

The absolute value of MACD's main line will be used to filter out weak signals: the signal is only confirmed if this value is greater than open_level (in points). Signal confirmation conditions are as follows:

  • Confirmation of a buy signal: Abs(macd_current)>open_level
  • Confirmation of a sell signal: macd_current>open_level

7. Additional filters for closing a position:

The absolute value of MACD's main line will also be used to confirm position closure: the signal is confirmed if this value is greater than close_level (in points). Close signal confirmation conditions are as follows:

  • Confirmation to close Buy positions — macd_current>close_level
  • Confirmation to close Sell positions — Abs(macd_current)>close_level

8. Close by Take Profit — during position opening, a Take Profit level is set at a fixed distance from the open price, specified in points. The value is set in the InpTakeProfit input parameter.

9. Position management

TrailngStop is used to protect profit. Stop Loss is set if profit in points exceeds the value specified in the InpTrailingStop parameter. If the price continues to move in the profit direction, Stop Loss should be trailed at the given distance. Stop Loss cannot be moved towards the loss direction, i.e. the Stop Loss value cannot be increased. If none of protective orders (Take Profit or Stop Loss) triggers, the position should be closed by an opposite signal. No other position exit methods are available.


Responded

1
Developer 1
2020.03.19
Rating
5
(71)
Projects
94
26%
Arbitration
10
0% / 90%
Overdue
19
20%
Working
2
Developer 2
2020.03.19
Rating
4.8
(82)
Projects
129
17%
Arbitration
51
10% / 59%
Overdue
50
39%
Working
3
Developer 3
2020.03.19
Rating
0
Projects
0
0%
Arbitration
0
Overdue
0
Working
4
Developer 4
2020.03.19
Rating
4.95
(204)
Projects
256
41%
Arbitration
10
20% / 30%
Overdue
77
30%
Loaded
5
Developer 5
2020.03.19
Rating
5
(10)
Projects
13
15%
Arbitration
1
0% / 100%
Overdue
6
46%
Working
6
Developer 6
2020.03.19
Rating
4.87
(172)
Projects
395
52%
Arbitration
42
45% / 33%
Overdue
195
49%
Loaded
7
Developer 7
2020.03.19
Rating
5
(1)
Projects
2
0%
Arbitration
0
Overdue
1
50%
Busy
8
Developer 8
2020.03.19
Rating
4.92
(332)
Projects
514
41%
Arbitration
32
25% / 47%
Overdue
48
9%
Working
9
Developer 9
2020.03.20
Rating
4.85
(55)
Projects
122
32%
Arbitration
7
14% / 71%
Overdue
30
25%
Working

Project information

Budget
30+ USD
For the developer
27 USD

Customer

Placed orders1
Arbitrage count0