EA to open pending orders based on SMA crosses

To add comments, please log in or register
Deven Parmar
49
Deven Parmar  

Dear All

I would like some help in coding an EA. I'm not good at it all.


My query, is it possible to make the EA Open hedge pending orders?

I only trade in Gold with the following 2 strategies:

1. if 12 SMA crosses above 20 SMA, then I want to open a set of buy stop & sell limit orders as below;

For e.g. the current price when SMA crosses is $1300.00 then;

1st buy stop @ 1302.00 & sell limit @ 1302.50

2nd buy stop @ 1303.00 & sell limit @ 1303.50

3rd buy stop @ 1304.00 & sell limit @ 1304.50

4th buy stop @ 1305.00 & sell limit @ 1305.50


2. if 12 SMA crosses below 20 SMA, then I want to open a sell stop & buy limit orders as below;

For e.g. the current price when SMA crosses is $1300.00 then;

1st sell stop @ 1298.00 & buy limit @ 1297.50

2nd sell stop @ 1297.00 & buy limit @ 1296.50

3rd sell stop @ 1296.00 & buy limit @ 1295.50

4th sell stop @ 1295.00 & buy limit @ 1294.50


I need the EA to accept the order size manually and then place the pending orders based on the above SMA crosses. I'm currently trading on the MT4 platform with a virtual server and have searched everywhere for an EA to do this. Only closest I have found is your EA for MT5 platform (https://www.mql5.com/en/articles/723) but I would rather stay on MT4.


Please I hope someone can assist me.

thanks

Dev

MQL5 Wizard: How to Teach an EA to Open Pending Orders at Any Price
MQL5 Wizard: How to Teach an EA to Open Pending Orders at Any Price
  • 2013.09.25
  • Vladimir Karputov
  • www.mql5.com
An Expert Advisor generated using the MQL5 Wizard can only open pending orders at the fixed distance from the current price. This means that if the market situation changes (e.g. a change in market volatility), the Expert Advisor will have to be run again with new parameters. This would not be suitable for many trading systems. In most cases...
To add comments, please log in or register