(MQ4) Needed script for close group of opened orders

 

Many times I have opened opposite orders for one Symbol(), for example:

EURUSD #buy 0.01

EURUSD #buy 0.01

EURUSD #buy 0.01

EURUSD #buy 0.03

EURUSD #buy 0.09

EURUSD #sell 0.01

EURUSD #sell 0.05

For example there are opened #buy 0.14 Lots and #sell 0.06 Lots

And there are some waiting orders like:

EURUSD #buylimit 0.05

EURUSD #selllimit 0.05


Now I need ONE script for close all the opened orders in the following steps:


setp 1/. OrderCloseBy() - close all the opened opossite orders, one by other

when there are NO opposite orders then step 2

step 2/. OrderClose() - for the rest of opened sell or buy orders

and next

step 3/. OrderDelete() - for each opened buylimit and sellimit order


Can anybody help me to write the script containig three above steps?

 
puncher:

Can anybody help me to write the script containig three above steps?


Sure, we will help you with your code. BTW where's your code.??

You will need orderclose() and orderdelete() function to build your code..

 
dineshydv:

Sure, we will help you with your code. BTW where's your code.??

You will need orderclose() and orderdelete() function to build your code..


NO I NEED 3 STEPS no 2 STEPS:

setp 1/. OrderCloseBy() - close all the opened opossite orders, one by other

when there are NO opposite orders then step 2

step 2/. OrderClose() - for the rest of opened sell or buy orders

and next step 3

step 3/. OrderDelete() - for each opened buylimit and sellimit order

 
o & don't forget to count down https://www.mql5.com/en/forum/139654
 
qjol:
o & don't forget to count down https://www.mql5.com/en/forum/139654

Ok thank YOU - the subject is CLOSED.

I have already written my own script.

Reason: