Questions from Beginners MQL5 MT5 MetaTrader 5 - page 1067

 

Error when opening an order:

4756 : Failed to send trade request

Which appears unpredictably at all, is this analogous to re-quotes in MT4 ?



 
Igor Makanu:

Error when opening an order:

4756 : Failed to send trade request

Which appears unpredictably at all, is this analogous to re-quotes in MT4 ?



A requote is a response from the server, and here it failed to send a trade request to the server for some reason. Probably - I don't know exactly.

 
Artyom Trishkin:

A requote is a response from the server, and here it failed to send a trade request to the server for some reason. Probably - I don't know exactly.

most likely a requote, no other errors when opening an order, the error is exactly when opening a market order, reproduced once out of 5-10 attempts, here is the terminal log looked at:

NH 0 15:59:13.488 Experts expert tst_Cdeal (EURUSD,H1) loaded successfully

MI 0 15:59:15.997 Trades '13725593': instant sell 0.01 EURUSD at 1.13162 (deviation: 30)

JP 0 15:59:16.153 Trades '13725593': requote 1.13160 / 1.13169 (instant sell 0.01 EURUSD at 1.13162 (deviation: 30))

EL 0 15:59:16.158 Trades '13725593': instant buy 0.02 EURUSD at 1.13169 (deviation: 30)

RK 0 15:59:16.301 Trades '13725593': accepted instant buy 0.02 EURUSD at 1.13169 (deviation: 30)

IF 0 15:59:16.346 Trades '13725593': deal #387636456 buy 0.02 EURUSD at 1.13169 done (based on order #411059914)

KH 0 15:59:16.362 Trades '13725593': order #411059914 buy 0.02 / 0.02 EURUSD at 1.13169 done in 204.132 ms

CR 0 15:59:16.362 Trades '13725593': buy stop 0.03 EURUSD at 1.13369

KH 0 15:59:16.442 Trades '13725593': accepted buy stop 0.03 EURUSD at 1.13369

KI 0 15:59:16.718 Trades '13725593': order #411059919 buy stop 0.03 / 0.03 EURUSD at market done in 355.459 ms

MS 0 15:59:16.718 Trades '13725593': sell limit 0.04 EURUSD at 1.13560

FG 0 15:59:16.753 Trades use Hosting Service to speed up the execution - 0.69 ms via 'MQL5 Amsterdam 01 (MQL5.community)' instead of 88.47 ms

MN 0 15:59:16.867 Trades '13725593': accepted sell limit 0.04 EURUSD at 1.13560

IK 0 15:59:16.871 Trades '13725593': order #411059921 sell limit 0.04 / 0.04 EURUSD at market done in 153.059 ms

EH 0 15:59:16.871 Trades '13725593': buy limit 0.05 EURUSD at 1.12971

OR 0 15:59:16.942 Trades '13725593': accepted buy limit 0.05 EURUSD at 1.12971

DH 0 15:59:16.942 Trades '13725593': order #411059922 buy limit 0.05 / 0.05 EURUSD at market done in 71.460 ms

NI 0 15:59:16.942 Trades '13725593': sell stop 0.06 EURUSD at 1.12960

KR 0 15:59:17.178 Trades '13725593': accepted sell stop 0.06 EURUSD at 1.12960

DK 0 15:59:17.178 Trades '13725593': order #411059923 sell stop 0.06 / 0.06 EURUSD at market done in 235.868 ms


 

OK a requote is a requote..., how do I detect requotes in MT5?

error 4756 : Failed to send trade request

Not good, what is the best way to detect a requote? I don't want to send 10 requests to the server if I get 4756, MT4 usually try to avoid requotes, but MT5 is cooler ;)


i read the search results on the forum, but as far as i understood there is no more efficient way to deal with requotes than sending a couple dozens of trade requests to the server.

https://www.mql5.com/ru/forum/1744/page2#comment_14948

Реквоты в тестере - что такое и как бороться?
Реквоты в тестере - что такое и как бороться?
  • 2010.08.16
  • www.mql5.com
Вопрос два - вызов функции аналога RefreshRates (делаю путем вызовов SymbolInfoTick и SymbolInfoDouble(,SYMBOL_BID)) обновляет цену при первой попытке рефреша, но ошибка 10004 не уходит.
 
Igor Makanu:

OK a requote is a requote..., how do I detect requotes in MT5?

error 4756 : Failed to send trade request

Not good, what is the best way to detect a requote? I don't want to send 10 requests to the server if I get 4756, MT4 usually try to avoid requotes, but MT5 is cooler ;)


i read the search results on the forum, but as far as i understood there is no more efficient way to deal with requotes than sending a couple dozens of trade requests to the server.

https://www.mql5.com/ru/forum/1744/page2#comment_14948

Is (deviation: 30) not too little?

 
Alexey Viktorov:

Is (deviation: 30) not too little?

On EURUSD it is even by a large margin not on the news market.

 
fxsaber:

On EURUSD it is even by a wide margin not on the news market.

It depends on which broker. Even the best ones are prone to artificial slippages. And 3 points in a case like this is nothing...

 
Alexey Viktorov:

It depends on which broker. Even the most well promoted ones are prone to artificial slippages. And 3 points in a case like this is nothing...

Missed the n-twenty years.

 
Please advise, I may have some kind of problem. I have to calculate the lot for the deal opened at the current price so that the breakeven of all deals was in Pip points of the current price Ask. All trades are unidirectional, let it be buy.

Breakeven formula:

breakeven = sum(Pi*Li)/sum(Li). Where Piis the opening price of a trade, Li is the lot of that trade

Now I want to open an order with lot X at the current price, so the distance to the CUE of all trades would be Pip.

So we get the following formula

Ask+Pip=(sum(Pi*Li)+Ask*X)/(sum(Li)+X)

And using mathematics we come to the lot

X=(sum(Pi*Li)-sum(Li)*(Ask+Pip))/Pip

But for some reason it ends up with a very small number, of course wrong, what is wrong?
 
Roman Sharanov:
Please give me a hint, I'm having some kind of problem. I have to calculate a lot for a deal opened at current price so that the breakeven point of all deals was in Pip points of the current Ask price. All trades are unidirectional, let it be buy.

Breakeven formula:

breakeven = sum(Pi*Li)/sum(Li). Where Piis the opening price of a trade, Li is the lot of that trade

Now I want to open an order with lot X at the current price, so that the distance to the CU of all trades is Pip.

So we get the following formula

Ask+Pip=(sum(Pi*Li)+Ask*X)/(sum(Li)+X)

And using mathematics we come to the lot

X=(sum(Pi*Li)-sum(Li)*(Ask+Pip))/Pip

But for some reason we end up with a very small number, of course not correct, what is wrong?

It's up to you, of course, but PI (Pi, pI, pi) is still a bit different )))

Reason: