The author of the idea –Â
mq5 code author –Â
NOTE: The EA works on hedge accounts only! Netting is prohibited!
The Expert Advisor sets pending Buy limit and Stop limit orders. The robot uses data of the iMA (Moving Average, MA) and iEnvelopes (Envelopes) indicators. The EA works only when a new bar appears and has a limitation of the working time range: from Start hour to End hour.Â
It is able to set up to three pending limit orders in each direction forming a grid: a separate magic number is assigned to each order. Magic number assignment rule:Â
- for BUY #1:Â magic number + 1
- for BUY #2: magic number + 2
- for BUY #3: magic number +3
- for SELL#1: magic number – 1
- for SELL#2: magic number – 2
- for SELL#3: magic number – 3
If there are non-activated pending orders, and the server time exceeds End hour, all pending orders are removed.
The default parameters, EURUSD M5: