Double Entry

 

Hi my EA have some issue that it can double entry the position with the same magic number.. 

im already using this logic as my header code but it can entry twice.. 

if (orderposition(100) != 0 )

condition of trade

}


can someone give me a hint how to make it not entry twice the same magic number ?  thanks

 

It is hard to say smth not seeing all your codes.

but check your expert to not, more than one working on same chart