Close Pendingorders if opposite Pendingorders hit takeprofit

 

Hello together,

i have a little problem to close my pendingorders.

I set a grid of 5 Buystops and 10 Sellstops. The Buystop have the same takeprofit and if they hit the takeprofit, all Sellstop should be deleted.

How can i do that or do you have a little script that works well?

Thanks for your advice!

Kind regards

mondalsys

 

Hi,

the number ofo pending orders are always the same?

 

Yes always the same number.

 
mondalsys:
Yes always the same number.

THe orders had a magic number? Are opened from an ea?

In the level of Takeprofit of a Buystop there is the other pending?

You have to be more specific.

Thank you

 

Opened from ea, yes!

Orders have no magicnumbers.

But if it is better to control the orders for close, i can set magicnumbers.

I don't know how i can fix the problem!

In attachment i have a script that could be work, but i don't know how it works.

Files:
 

Sorry now i receive an error when i try to upload the file or paste the code.

 

This is not my script. I have found this in ff.com. I must take a part from this script and insert it to my ea.

 

Hi,

try to insert this code in your start().

It need magicnumber so seti it in your ea and do the same in my code.

Hope it work fine.

code.txt

Files:
code.txt  3 kb
 

Thanks i try.

Reason: