MQL5 - Can this be done?

I am running a system in MT4 using an EA. I am looking at the possibility of moving to a broker with MT5 (offering much better spreads) but i dont think it is possible to re-create the EA to run on MT5.

The bit i am worried about is the order management. The EA will open Long only or Short only depending on certain criteria. Every time it gets a signal to enter it enters a new position at the specified lot size (so it may have several orders open on a particular instrument in the same direction). MT4 treats all these separately but doesnt MT5 treat it as an overall position? When it gets a close signal it loops the open orders and only closes those at a profit. It does this every time it gets a close signal so profits per order are variable.

I have read a bit about FIFO and MT5 aggregating positions and cant seem to find any way to close orders individually in MQL5. Can i do this or is there a way around it.

thats exactly how MT5 handles it (and thats why i dont use it no more) … if there is a way around it depends on your system, but i would avoid the hassle and rather look for a good MT4 ECN broker

Thats what i thought. MT5 seems like a massive backwards step. The only point of it is to allow US brokers to rip off clients more efficiently. They dont seem to care that the stupid American rules only apply to Americans and not to those of us elsewhere.