How not to open an order if you already have an order in the vicinity?

 

Hi,

I´m trying to learn MQL4 and I can´t figure out how to avoid buying if you already an open buy order less than 25 pips away, for both sides, or open a sell order if you have another sell order less than 25 pips away.

Can anyone help me to code this?

Thanks,

J Fonseca

 

Hi,

I already found a way of doing it.

J Fonseca

Reason: