EA to Open & Close Orders

 

When I open this EA on a chart I would like it to have the following inputs:

1. Magic #

2. Lot size

3. Indicate One Pair to Buy

4. Indicate One Pair to Sell

5. Profit in $

6. Open New Order (True= to open new orders and assign the inputted magic # to the new opened orders opened by the EA, False=do not open new orders)

Rules for closing trades: close all open orders whose magic # equals the input, and combined profit of all pairs with this magic # = profit input)

I have seens EA's where when instructed to close trades some are left open for some reason. I do not want TP, SL, slippage, or requote to affect the opening and closing of orders. I want open and closing of orders to be forced until they are open or closed at the market, regardless of slippage or requote.

"Trade context is busy” may occur when two or more orders are trying to be processed at the same time. If a trade is placed and do not wait until it processes completely and then try to place the same trade or a different trade, the commands go into a loop and “Tread context is busy” is received. So with this EA one order should finish processing before the 2nd order is inditiated, both on the open and close.

Please post the MQ4 file which should be open for future edits.

Your help in creating this EA would be appreciated.

 

JTP

You should be able to adapt this one 'RUBBERBANDS_3 EA'

to your needs

Good Luck

-BB-

Reason: