Check magicnumber of open position

Hi guys,

I want to check for every position to open if there is a position (magicnumber + symbol) already open.
Who can help?

JulyHedge.zip (668 Bytes)

Best Regards,