Forux: Met with a problem - when testing at a certain point for unknown reasons, an error "invalid stops" appears, but the stops are correct.
This is what we ended up with (started 2010.05.01):
What could be the problem? (80% of the deposit was free at the time)
The error message pops up in response to position modification. At the same time, there is no check of the allowable distance of sl/tp levels from the current price in the code. It may happen that the current market price approaches the levels of sl or tp at a distance shorter than allowed by the server. Look in ORDER_STOPS_LEVEL handbook
Yedelkin: The error message pops up in response to position modification. The code does not check the allowable distance of sl/tp levels from the current price. It may happen that while processing two trade requests, the current market price has moved closer to the sl or tp levels than the distance allowed by the server. Look in the ORDER_STOPS_LEVEL handbook
Made changes to the code to check:
price = SymbolInfoDouble(_Symbol, isBuy ? SYMBOL_ASK : SYMBOL_BID);
Print(" --- Can not modify order --- error = " + GetLastError() + " order = " + order + " price = " + price);
as a result the error line did not change (i.e. the price did not change). And it probably couldn't, it's two and a half years of testing on minutes, on alpari history (98% history quality).
It looks more like an error of the MetaTrader itself, because before that the same thing was happening, but there was no error.
Yedelkin: Ну а проверку на допустимый отступ тоже сделали?
Yedelkin: Have you checked the allowable indentation as well?
The allowable distance in the test is 0. And the price has not changed, after the error it is the same as the price at which the order was created, before the modification.
price = SymbolInfoDouble(_Symbol, isBuy ? SYMBOL_ASK : SYMBOL_BID);
Print("SymbolInfoInteger(_Symbol, SYMBOL_TRADE_STOPS_LEVEL) == " + SymbolInfoInteger(_Symbol, SYMBOL_TRADE_STOPS_LEVEL));
Print(" --- Can not modify order --- error = " + GetLastError() + " isBuy = " + isBuy + " order = " + order + " price = " + price);
Log
2013.01.1614:32:28 Core 12011.03.1821:59:00 --- Can not modify order --- error = 4756 isBuy = false order = 4720 price = 1.417952013.01.1614:32:28 Core 12011.03.1821:59:00SymbolInfoInteger(_Symbol, SYMBOL_TRADE_STOPS_LEVEL) == 02013.01.1614:32:28 Core 12011.03.1821:59:00 failed modify sell 0.10 EURUSD sl: 0.00000, tp: 0.00000 -> sl: 1.42095, tp: 1.41495 [Invalid stops]
2013.01.1614:32:28 Core 12011.03.1821:59:00 order performed sell 0.10 at 1.41795 [#4720 sell 0.10 EURUSD at 1.41795]2013.01.1614:32:28 Core 12011.03.1821:59:00 deal performed [#4720 sell 0.10 EURUSD at 1.41795]2013.01.1614:32:28 Core 12011.03.1821:59:00 deal #4720 sell 0.10 EURUSD at 1.41795 done (based on order #4720)2013.01.1614:32:28 Core 12011.03.1821:59:00 exchange sell 0.10 EURUSD at 1.41795 (1.41795 / 1.42399 / 1.41795)
...
Forux: And the price hasn't changed, after the error it is the same as the price at which the order was created before the modification.
The price itself (in general) may initially be closer to the levels than the server currently allows. Therefore it is always advisable to check such a condition.
Forux: The allowable distance in the test is 0.
Yes, it's clear now that checking for indentation doesn't solve the problem in this case. Did I correctly understand that the sl/tp levels for a Sell position are set based on the Bid price?
The price itself (in general) may initially be closer to the levels than the server currently allows. Therefore it is always advisable to check such a condition.
Yes, it is clear now that checking for indentation does not solve the problem in this case. Did I understand correctly that sl/tp levels for Sell positions are set on the basis of Bid price?
Yes, and entry and exit are either at Ask or Bid, depending on the order type.
Forux: Yes, and entry and exit are either by asc or bid, depending on the order type.
Did I understand correctly that sl/tp levels for a Sell position are set based onthe Bid price? If not difficult, print out the current Ask, Bid, SL & TP for the problem area
Yedelkin: Did I understand correctly that the sl/tp levels for a Sell position are set based onthe Bid price? If not difficult, print out the current Ask, Bid, SL & TP for the problem area.
2013.01.1615:55:57 Core 12011.03.1821:59:00 --- Can not modify order --- error = 4756 isBuy = false order = 4720 price = 1.417952013.01.1615:55:57 Core 12011.03.1821:59:00 TP == 1.414952013.01.1615:55:57 Core 12011.03.1821:59:00 SL == 1.420952013.01.1615:55:57 Core 12011.03.1821:59:00 BID == 1.417952013.01.1615:55:57 Core 12011.03.1821:59:00 ASK == 1.423992013.01.1615:55:57 Core 12011.03.1821:59:00SymbolInfoInteger(_Symbol, SYMBOL_TRADE_STOPS_LEVEL) == 02013.01.1615:55:57 Core 12011.03.1821:59:00 failed modify sell 0.10 EURUSD sl: 0.00000, tp: 0.00000 -> sl: 1.42095, tp: 1.41495 [Invalid stops]
2013.01.1615:55:57 Core 12011.03.1821:59:00 order performed sell 0.10 at 1.41795 [#4720 sell 0.10 EURUSD at 1.41795]2013.01.1615:55:57 Core 12011.03.1821:59:00 deal performed [#4720 sell 0.10 EURUSD at 1.41795]2013.01.1615:55:57 Core 12011.03.1821:59:00 deal #4720 sell 0.10 EURUSD at 1.41795 done (based on order #4720)2013.01.1615:55:57 Core 12011.03.1821:59:00 exchange sell 0.10 EURUSD at 1.41795 (1.41795 / 1.42399 / 1.41795)
...
I have encountered a problem - when testing at a certain point, for unknown reasons, the error "invalid stops" appears, but the stops are correct.
The algorithm is trivial - put an order
when it is closed, repeat the procedure
As a result, I've got such results (I've started in 2010.05.01):
What could the problem be? (at that time 80% of my deposit was free)
This is what we ended up with (started 2010.05.01):
What could be the problem? (80% of the deposit was free at the time)
The error message pops up in response to position modification. The code does not check the allowable distance of sl/tp levels from the current price. It may happen that while processing two trade requests, the current market price has moved closer to the sl or tp levels than the distance allowed by the server. Look in the ORDER_STOPS_LEVEL handbook
Made changes to the code to check:
as a result the error line did not change (i.e. the price did not change). And it probably couldn't, it's two and a half years of testing on minutes, on alpari history (98% history quality).
It looks more like an error of the MetaTrader itself, because before that the same thing was happening, but there was no error.
Ну а проверку на допустимый отступ тоже сделали?
Have you checked the allowable indentation as well?
The allowable distance in the test is 0. And the price has not changed, after the error it is the same as the price at which the order was created, before the modification.
Log
The price itself (in general) may initially be closer to the levels than the server currently allows. Therefore it is always advisable to check such a condition.
Yes, it's clear now that checking for indentation doesn't solve the problem in this case. Did I correctly understand that the sl/tp levels for a Sell position are set based on the Bid price?
The price itself (in general) may initially be closer to the levels than the server currently allows. Therefore it is always advisable to check such a condition.
Yes, it is clear now that checking for indentation does not solve the problem in this case. Did I understand correctly that sl/tp levels for Sell positions are set on the basis of Bid price?
Did I understand correctly that the sl/tp levels for a Sell position are set based onthe Bid price? If not difficult, print out the current Ask, Bid, SL & TP for the problem area.
Hello! There was no MT-5 programme before, but now they have started giving me in the "signals" section
I don't need any information. I use mobile Internet and pay for every Mb.
And these signals increased the consumption of the Internet by 3-4 times.
Question: how to configure what and where not to receive these signals? I have not subscribed to any of the signals.