(Code) If statement that only allows the ticket if spread < x value

 
Or just a way to programmatically calculate spread value.
 
heathbm:
Or just a way to programmatically calculate spread value.
double X=10;

if(MarketInfo(Symbol(),MODE_SPREAD)<X)
 {
  // Allow Trade
 }
 
Marco vd Heijden:
Great thanks!
 
Marco vd Heijden: I have an unrelated issue regarding code. There seem to be some strange error popping up here, could you take a look or point me in the right direction?
Files:
 
heathbm:
 
Marco vd Heijden:
Thanks again Marco!