Errors when placing orders...

 
Hi Metaquotes,

Quite a number of times each day, I'm getting orders rejected by the trading server with an "[Invalid S/L or T/P]" error, only to have the order accepted if I try it again. The section of log below shows this for a USDCAD trade...


10:30:00 '457682': instant order sell 12.50 USDCAD at 1.1240 sl: 1.1249 tp: 0.0000
10:30:00 '457682': order sell 12.50 USDCAD opening at 1.1240 sl: 1.1249 tp: 0.0000 failed [Invalid S/L or T/P]
10:30:06 '457682': instant order sell 12.50 USDCAD at 1.1240 sl: 1.1249 tp: 0.0000
10:30:06 '457682': request was accepted by server
10:30:06 '457682': request in process
10:30:06 '457682': order was opened : #3916326 sell 12.50 USDCAD at 1.1240 sl: 1.1249 tp: 0.0000

The S/L price is calculated by adding/subtracting the stop level (marketInfo("<Currency pair>, MODE_STOPLEVEL)) to/from what will become the closing order's price - for instance, the price used for an S/L for a BUY order would be calculated as Bid minus the stop_level. I understand that for a market order, this is the minimum distance that an S/L can be placed from an entry price?

Another thing I've noticed is that it's possible to place S/L order's closer to the entry price when using Stop/Limit orders. For instance in the above example, the minimum number of points between the entry and S/L price is 9 (i.e. spread points + stop_level points) whereas if a Stop or Limit order is placed, I'd be able to place the S/L "stop_level" points away (i.e. without requiring the spread point difference) from the entry price.

Any ideas? I'm using the latest version (build 198) of the client. Thanks in advance for your help.
Reason: