How do I do in my robot that if the spread is too high it will not open a transaction

 
How do I do in my robot that if the spread is too high it will not open a transaction
 

Until you can state your requirements in concrete terms, it can not be coded.

I simply ignore ticks when the spread is more than twice the average.
          How to trade "day" bar in Oanda data? - Expert Advisors and Automated Trading - MQL5 programming forum #4 (20.04.15)

Reason: