I simply want an EA that will be a utility. when it is launched it will simply check for open positions, and open an opposite trade. example on what this EA needs to do.
1) on launch and check every second if there is no active order (any direction) do nothing.
2) If there is 1 or more buy orders but no sell orders, place a sell market order at that price where it is right now.
3) If there is 1 or more sell orders but no buy orders, place a buy market order at that price where it is right now.
once the trade has been opened, keep monitoring all active trades, and once there are no more active BUY orders place a sell order, or when there is no more active SELL orders place a buy order.
PS: I would need you to give me the MQ4 version (source) any questions feel free to ask.