Spread check won't work - help!

 

I'm trying to perform a simple spread check before placing trades, but I just can't get it to work.  Can someone help me out?  thanks!!!!

 

extern double MaxSpread1 = 3;


if(MarketInfo("GBPUSD",MODE_SPREAD) < MaxSpread1)
     {
      OrderSend ("GBPUSD",OP_SELL,1.0,MarketInfo("GBPUSD",MODE_BID),10,0,0);
     }
 
mpr:

I'm trying to perform a simple spread check before placing trades, but I just can't get it to work.  Can someone help me out?  thanks!!!!

 

 

OrderSend ("GBPUSD",OP_SELL,1.0,MarketInfo("GBPUSD",MODE_BID),10,0,0);

At what price do you open a sell trade  ???

OrderSend

Why aren't you checking if it succeed or fails ???

you are not checking OrderSelect() return value 

don't you wanna know why it fails ???     DO your checking

 
mpr:

I'm trying to perform a simple spread check before placing trades, but I just can't get it to work.  Can someone help me out?  thanks!!!!

In what way doesn't this work ?  are you expecting  3  to be 3 Pips on a 5 Digit Broker ?
 
RaptorUK:
In what way doesn't this work ?  are you expecting  3  to be 3 Pips on a 5 Digit Broker ?



RaptorUK, 

Yes I was thinking that was going to check for a 3 pip spread or less.

 thanks!

 
mpr:


RaptorUK, 

Yes I was thinking that was going to check for a 3 pip spread or less.

A value of  3  only means 3 pips on a 4 Digit Broker . . .  if your Broker is a 5 digit Broker you need to allow for this

4/5 Digit Brokers 

 
RaptorUK:

A value of  3  only means 3 pips on a 4 Digit Broker . . .  if your Broker is a 5 digit Broker you need to allow for this

4/5 Digit Brokers 


Wow, never would have thought of that.

thanks!!!!! 

Reason: