Download MetaTrader 5

CTrade requote

To add comments, please log in or register
chinaski
922
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:


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
922
chinaski  

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
5019
Jose Miguel Soriano  
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
10366
Rodrigo Malacarne  
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