Specification
0. Improve an Expert Advisor (MQL4) based on ForexFactory/Calendar (Reference: https://www.mql5.com/en/job/87766) (Attached file: MQL4.zip)
1. Input parameter group 1: all filter in the forexfactory/calendar, default as displayed in the picture below:
2. Input parameter group 2: date range on forexfactory/calendar, default as displayed in the picture below:
3. If the News Event is about "Interest Rate" open the trade for 1M chart. Others, use 5M chart.
4. Input parameter group 3: Pairs to be opened (default: All major and minor pairs related to the news event must be opened), magic number (default: 11099), comment (default: NewsEA_11099)
5. Input parameter group 4: OpenTradeWaitTime (default: 90 seconds), LotSize (default: 1 lot), StraddleSize (default: 20 pips),
StopLoss (default: 20 pips), TakeProfit (default: 100 pips), TrailingStopLoss (default: 20 pips), TrailingMultiplier (default: 3)
6. For each chart, 90 seconds (OpenTradeWaitTime) before the News Event, open a pending orders using LotSize: both a 1 lot BUY STOP and a 1 lot SELL STOP, 20 pips (StraddleSize) away from each other to form a straddle as displayed below:
5. For the BUY STOP, the Stop Loss is -20 pips and take profit is +100 pips. For the SELL STOP, the Stop Loss is +20 pips and take profit is -100 pips.
All StopLoss, TakeProfit and TrailingStopLoss should be hidden. (Reference: https://www.mql5.com/en/code/11649) (Attached file: 11649.zip)
6. When the News Event occurs, one of the pending stop order will be triggered and the other one should be cancelled (closed).
7. After the second candle is formed after the News event, move the Stop Loss to break even (by default it is 20 pips away).
8. Trail the Stop Loss (default: 60 pips = TrailingStopLoss x TrailingMultiplier).
9. After trailing 20 more pips, reduce the TrailingMultiplier - 0.5, so that it will trail at 50 pips away.
Then after trailing 20 more pips, reduce again, so that it will trail at 40 pips away.
Then after trailing 20 more pips, reduce again, so that it will trail at 20 pips away.
10. After 15 min, close 5% of the LotSize. After 15 min later, close another 5%. After 15 min later, close another 5%.
10. When TakeProfit is reached, 65% of the LotSize. Reduce the Trailing multiplier to 0.5, so that it will trail at 10 pips away.
11. If the trade is not closed after 55 min, then close all of remaining open trade.
12. The output should be MQL4 file and PDF file for installation and user guide manual.