Simple MACD histogram strategy

Trabajo finalizado

Plazo de ejecución 4 días

Tarea técnica

We need an Expert Advisor for MetaTrader 4. 

 

It needs to be able to work on different time periods, currency pairs,  and MADC indicator.

 

Bullet points

 

·     It only opens one trade each time Macd Histogram change direction (+ to - or -to +).

·     If a trade is close before Macd histogram change directions, because it meets take profit, it will not open a new trade until Macd histogram change direction and parameters are meet. 

·     It closes a trade when Macd Histogram change direction or by a stop loss.

·     The actual bar needs to finish to be a certain trade signal.

 

Strategy

 

Opening positions

 

a.        When Macd Histogram change from negative to positive or positive to negative.

b.       In order it to be a positive trade signal the bar needs to finish. 

c.        It will open a trade in the direction of Macd Histogram (positive long and negative short). 

d.       It will only open one trade each time Macd Histogram change direction, if the trade meet objective it will wait until Macd Histogram change direction again.

e.        The Macd histogram change direction must be in the trading hours and minutes.

f.          If Macd Histogram level is set, Macd histogram will need to cross this line and finish the actual bar in order to be a positive trade signal.

 

There are two types of entries; at closing price of the bar or chosen distance from the closing price of the bar. 

 

1.        At closing price of the bar: it will open a limit order with the closing price of the previous bar.

 

2.        “Open order win” parameter. Chosen distance from the closing price of the bar: limit order is set up XX (defined points on expert properties) points opposite the direction of the trade.

 

Closing positions

 

a.        When Macd Histogram change from negative to positive or positive to negative.

b.       In order it to be a positive trade signal the bar needs to finish. 

c.        It can close a position after hours if the conditions are met.

 

There are three options for closing trade; when Macd Histogram change direction, stop loss or trailing stop loss.

 

1.        Macd Histogram change direction and is confirmed by finishing a Bar on Macd Histogram change direction: it creates a market order.

2.        Stop loss, if conditions of pint 1 are meet before stop loss it must close position as option 1.

3.        Trailing stop is set. Same as point number 2. 

 

 

Pending orders removing

 

When Macd histogram change direction limit orders need to be close. Open orders may not meet, they need to be close when Macd histogram has change direction.

 

Input Parameters

 

§  Lot:  *****

§  Increment lot: if 0%, lot will be always what is defined. If above 0% it will be use in the following formula, “lot x (increment of balance) x increment lot” equals new lot to be use. Increment of balance is “Latest balance ÷ previous balance”.

§  Take profit: In points, if 0, when the Macd Histogram change directions

§  Stop loss: In points, if 0, when the Macd Histogram change directions

§  Trailing Stop: in points from profit

§  Start Hour: when robot starts to work

§  Start Min: when robot starts to work

§  End Hour: No open order is set, only closing trades after this time

§  End Min: No open order is set, only closing trades after this time

§  Macd Histogram Level entry: the value of the histogram, it is shown as an absolute number, but in short trades it will be negative

§  Macd Histogram Level close: this level will be use when closing trades. The value of the histogram, it is shown as an absolute number, but in short trades it will be negative

§  Fast EMA period: 12 (by default)

§  Slow EMA period: 26 (by default)

§  MACD SMA: 9 (by default)

§  Open order win: if 0, the closing price of the bar that confirms change direction. If other value, XX points opposite the direction of the trade from the closing price of the bar that confirms change direction.


Example 1

 

Parameters

 

§  Lot: 0.1

§  Increment lot: 50%

§  Take profit: 75

§  Stop loss: 0

§  Trailing Stop: 0

§  Start Hour: 07:00

§  Start Min: 00:30

§  End Hour: 15:00

§  End Min: 00:00

§  Macd Histogram Level entry: 20

§  Macd Histogram Level close: 0

§  Fast EMA period: 12

§  Slow EMA period: 26

§  MACD SMA: 9

§  Open order win: 0

 

1.        Macd histogram breaks positive after being in negative (It happens after Start Hour 07:00). 

2.        Macd histogram breaks Level entry and finish above.

3.        It finishes above entry level line, it triggers an open order at closing price of the bar, price 1.1537, for 0.1 lots X “0.1 x (increment of the deposit) x increment lot @ 50%”.

4.        Open order is meet and a trade is open. Price goes to 1.1548, as take profit is meet, it triggers a “market order”, position is close with profit. Macd histogram still above entry lever line and there is no trade open, it doesn’t open any more open order. It will only open one single open order each time macd histogram enters into a new direction.

5.        Macd histograms breaks negative after being in positive. 

6.        Macd histogram breaks Level entry, and finish below.

7.        It finishes below entry level line, it triggers an open order at closing price of the bar, price 1.1519 X “0.1 x (increment of the deposit) x increment lot @ 50%”. 

8.        Open order is meet and a trade is open. Price goes to 1.1455, as take profit is meet, it triggers a “market order”, position is close with profit. Macd histogram still below entry lever line and there is no trade open, it doesn’t open any more open order or trades. It will only open one single open order each time macd histogram enters into a new direction.


 

Example 2

 

Parameters

 

§  Lot: 0.1

§  Increment lot: 50%

§  Take profit: 0

§  Stop loss: 0

§  Trailing Stop: 0

§  Start Hour: 07:00

§  Start Min: 00:30

§  End Hour: 15:00

§  End Min: 00:00

§  Macd Histogram Level entry: 0

§  Macd Histogram Level close: 0

§  Fast EMA period: 12

§  Slow EMA period: 26

§  MACD SMA: 9

§  Open order win: 30

 

1.        Macd histogram breaks positive after being in negative (It happens after Start Hour 07:00). 

2.        Bar finish and Macd histogram end on positive, it confirms direction change. Open order is set, as “open order” parameter is set at 30, it means; (closing price 1.15270 – 30 = 1.15240). Open order at 1.15240 is met and trade is open.

3.        Macd histogram breaks into negative from positive and finish on negative, it confirms direction change.

4.        A market order is executed to close the buy trade, it trigged at closing price 1.15280. it generates a profit of 40 points. (no spread or market order is taken in account for this example)

5.        Open order is set with an open order win of 30, closing price of the bar at 1.15280 + 30 = 1.15310. Look that as this is a sell order the “open order win” needs to be sum. It looks like open order is meet and a sell trade is on.

6.        Macd histogram breaks positive and change direction is confirm as bar finish. This is happening after “end hour”, so the robot will only be executing market orders and not open orders. 

7.        Market order is executed at closing price of 1.14750 giving a profit of 560 points (56 pips).

 

Archivos adjuntos:

Han respondido

1
Desarrollador 1
Evaluación
(173)
Proyectos
201
49%
Arbitraje
18
11% / 44%
Caducado
1
0%
Libre
2
Desarrollador 2
Evaluación
(236)
Proyectos
440
26%
Arbitraje
125
21% / 57%
Caducado
96
22%
Trabaja
3
Desarrollador 3
Evaluación
(1091)
Proyectos
1771
61%
Arbitraje
14
64% / 7%
Caducado
84
5%
Trabaja
4
Desarrollador 4
Evaluación
(130)
Proyectos
184
32%
Arbitraje
17
29% / 59%
Caducado
27
15%
Trabaja
5
Desarrollador 5
Evaluación
(221)
Proyectos
369
66%
Arbitraje
10
50% / 0%
Caducado
46
12%
Libre
6
Desarrollador 6
Evaluación
(1853)
Proyectos
3455
88%
Arbitraje
73
40% / 15%
Caducado
265
8%
Libre
7
Desarrollador 7
Evaluación
(563)
Proyectos
932
47%
Arbitraje
301
59% / 25%
Caducado
124
13%
Trabaja
8
Desarrollador 8
Evaluación
(105)
Proyectos
135
42%
Arbitraje
19
16% / 53%
Caducado
20
15%
Trabajando
9
Desarrollador 9
Evaluación
(356)
Proyectos
632
26%
Arbitraje
89
73% / 13%
Caducado
12
2%
Libre
10
Desarrollador 10
Evaluación
(2422)
Proyectos
3042
66%
Arbitraje
77
48% / 14%
Caducado
340
11%
Trabaja
11
Desarrollador 11
Evaluación
(66)
Proyectos
143
34%
Arbitraje
10
10% / 60%
Caducado
26
18%
Libre
12
Desarrollador 12
Evaluación
(33)
Proyectos
35
40%
Arbitraje
11
9% / 91%
Caducado
4
11%
Libre
13
Desarrollador 13
Evaluación
(5)
Proyectos
4
25%
Arbitraje
2
0% / 100%
Caducado
1
25%
Libre
Solicitudes similares
Long Position 1. Trend Line: When a Lower High (LH) is formed, draw a trend line from the previous Higher High (HH) to the new LH. 2. Trend Line Adjustment: If a new Lower High (LH) is formed without breaking the trend line, redraw the trend line to the new LH. Draw a trend line between the Higher High (HH) and the Higher Low (HL). If a new Higher High (HH) is formed, remove the previous trend line and draw a new one
I have a custom EA that works fine in the live market trading, but when doing a back test in the strategy tester , it does not open sell orders. There are no errors or warnings; it just doesn't open sell orders. I've checked every possible reason that might be the reason why it does not open sell orders, but I can't find anything, especially since it works fine in the real market and it opens both buys and sells
I'm looking for someone to help me create an arbitrage trading robot that can trade on any decentralized exchange and forex market. I already have some source code to a strategy but would like to enhance it to make it profitable and automated
I installed the E.A. into the Experts folder in MT4. When I double click on it nothing happens. When I right click and "attach to chart" nothing happens. The E.A. is not grayed out, it simply will not attach. Any help would be greatly Appreciated
I have an EA and want to add few new logic to fetch profit taking factors and other values from an external master data and use it in existing EA
I need EA that works on MT5 to be able to do the following: - Can recognize Support/Resistance area - Can recognize VWAP direction. - Can recognize RSI. - Can recognize Double Top/bottom, Bullish/Bearish hammer candle, Bullish/bearish engulfing candle. - Ability to set Stoploss below/above support/resistance, but risk must be fixed at a certain price. - Stoploss
I want a program that will help calculate and enter the market on full margin for me. I just need to put in the price for entry, Stop loss and TP then it will calculate the lot sizes for entering the trade on full margin on Mt5
I am seeking a highly skilled and experienced developer to assist with an important project. I need a development of an automated trading bot for NinjaTrader, utilizing a 4 SMA (Simple Moving Average) crossing strategy, with additional custom diversions for trade entries. The bot needs to be based on a strategy involving the crossing of four different SMAs. The exact periods for these SMAs and the conditions for
So i have copier EA. The idea is the EA will triggered through manual OP by user via mobile or whatever platform. Let's say 0.01 lot to trigger it. After the EA takes master's position, the EA will be standby mode. If the master take more OP, the EA still not take the master's position (OP) until the user input manually once again via mobile for another 0.01 lot. Since this is a MT4 EA, Whenever user want to close
preciso de um robô com duas médias móveis, uma exponencial high e uma exponencial low. preciso também ter a opção de utilizar e todos os tempos gráficos e alterar os parâmetros das médias. entrada de compra será feita quando um candle de alta romper e fechar a cima da média high e fechará a posição quando um candle de baixa romper e fechar a baixo da média low. a venda será feita quando o candle de baixa romper e

Información sobre el proyecto

Presupuesto
50 - 100 USD
IVA (21%): 10.5 - 21 USD
Total: 60.5 - 121 USD
Para el ejecutor
45 - 90 USD
Plazo límite de ejecución
de 3 a 6 día(s)