工作已完成
![](https://c.mql5.com/i/avatar/avatar_na2.png)
![](https://c.mql5.com/i/avatar/avatar_na2.png)
指定
The EA is relatively simple.
Sell Signal: If the price is larger than the M4 pivot before the 15th of each month, we look to sell when the MACD becomes smaller than the signal line.
Buy Signal: If the price is smaller than the pivot M1 before the 15th of each month, we look to buy when the MACD becomes larger than the signal line.
Trade management: 1% risk for the total trade. Position 1 = 60% of 1% of total risk and position 2 40% of total risk.
Both will have the same stop, but different targets. When TP1 is hit, put p2 in breakeven.
Inputs:
input ulong Magic=12345;
input double totalrisk=1.00; //total risk in %
input int P1risk=60; //risk per position of total risk in %
input int P2risk=40; //risk per position of total risk in %
input int breakeven=-15; //breakeven in points
input int stop= 1000; // stop in points
input int target1= 750; // target 1 in points
input int target2=1500; //target 2 in points
input int date=15; //date for a valid signal
input int MACD_FastEMA = 12;
input int MACD_SlowEMA = 26;
input int MACD_SignalSMA = 9;
input ENUM_APPLIED_PRICE MACD_AppliedPrice = PRICE_CLOSE;
The Expert advisor must work with all brokers. The account is in Hedging.
I would like to have an alert system when a trade is placed, a stop or a target is hit and if there is an error.
The code must be robust to ensure proper operation.
Thanks in advance.