CTrade requote

 

Hello,

can anyone help how to solve the requote problem. If i do a buy or sell with CTrade,

i get sometimes no transaction because there was a requote.

(I set also the SetDeviationInPoints to 100, would should not be the solution in real trading)

This is from backtest log:


CG      0       17:20:16.069    Core 1  2010.01.12 19:00:00   CTrade::OrderSend: instant buy 0.01 EURUSD at 1.45059 [done at 1.45067]
EG      0       17:20:16.069    Core 1  2010.01.12 23:00:00   requote 1.44859 / 1.44877 / 1.44859 (instant buy 0.01 EURUSD at 1.44851)
RH      0       17:20:16.069    Core 1  2010.01.12 23:00:00   CTrade::OrderSend: instant buy 0.01 EURUSD at 1.44851 [requote (1.44859/1.44877)]
JD      0       17:20:16.069    Core 1  2010.01.12 23:00:00   ERROR BUY EURUSD result-ret=10004 result-deal=0

 

The SetDeviationInPoints seems to intended for closing a position only.

To get order through, i used a MqlTick.ask - for buy orders and  MqlTick.bid for sell orders, which is updated right before placing order SymbolInfoTick.

This solved my problem 

 
chinaski:

Hello,

can anyone help how to solve the requote problem. If i do a buy or sell with CTrade,

i get sometimes no transaction because there was a requote.

(I set also the SetDeviationInPoints to 100, would should not be the solution in real trading)

This is from backtest log:


The logic is put OrderSend () inside a loop that is repeated several times or until it returns "true". At each step of the loop the slip increases several points to ensure the implementation of the operation
 
josemiguel1812:
The logic is put OrderSend () inside a loop that is repeated several times or until it returns "true". At each step of the loop the slip increases several points to ensure the implementation of the operation
A very dangerous approach, don't you think? IMHO, you can open orders and positions in duplicity using this approach. So, I'm not sure if this is the best way to solve the requote problem...
Reason: