Can I handle the spread with OrderSend Operation Types 2...5?

 

Sorry if it's difficult to understand at first,

I will try to explain.

In my expert I don't open orders OP_BUY or OP_SELL. I open orders 2-5 (OP_BUYLIMIT, OP_SELLLIMIT, OP_BUYSTOP, OP_SELLSTOP).

I was wondering if the spread of the moment the order is opened could be handled, just as I used to do with the others...

Something like

if ((MarketInfo(Symbol(),MODE_SPREAD) <= 7)){

//Open Order

}


Thanks a lot!

 

AFAIK, once the pending order has been sent to the server, it will work independently of your EA so you won't be able to control whether it's opened or not. Either send / don't send as a market order, or have some code that deletes pending orders once your spread limit is breached.

V

 
Thanks a lot, that's what I'd imagined... I'll look for other ways.
Reason: