![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
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