Download MetaTrader 5

CTrade requote

To add comments, please log in or register
Do you know C++? MQL5 has much in common with it. Just try it yourself!
chinaski
890
chinaski 2014.07.08 18:13 

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

chinaski
890
chinaski 2014.07.08 19:55  

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 

Jose Miguel Soriano
4957
Jose Miguel Soriano 2014.07.09 17:38  
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
Rodrigo Malacarne
Moderator
9891
Rodrigo Malacarne 2014.07.09 19:37  
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...
To add comments, please log in or register