FORTS: OnTradeTransaction() return codes - page 11 1...4567891011 New comment Mikhail Filimonov 2015.12.02 20:11 #101 Dmitry Fedoseev: It is not clear exactly what state the order was in.To REMOVE an order, it is important that it DOES exist and is not in an "in-between" state.Look carefully (with all explanations):https://www.mql5.com/ru/forum/58012/page9#comment_2074928 ФОРТС: OnTradeTransaction() коды возврата www.mql5.com Сейчас, коды возврата торгового сервера функции OnTradeTransaction() выглядят так:. - Страница 9 - Категория: биржевой трейдинг Dmitry Fedoseev 2015.12.02 20:14 #102 Михаил: To REMOVE an order, it is important that it DOES exist and is not in an "in-between" state.Look carefully (with all explanations):https://www.mql5.com/ru/forum/58012/page9#comment_2074928 Still interesting, and might be useful, as a clear argument to servicedesk. Mikhail Filimonov 2015.12.02 20:16 #103 Dmitry Fedoseev: Still interesting, and might be useful, as a clear argument for the servicedesk.So you think the CheckOrderState() function is not written correctly?P/S SD, silent as always.... Dmitry Fedoseev 2015.12.02 20:33 #104 Михаил: So you think the CheckOrderState() function is not written correctly?P/S SD, silent as always....I don't know. If it was ORDER_STATE_PLACED, it's probably the same bug.And if it was ORDER_STATE_PARTIAL, I don't know. Alexander didn't tell us about this case and maybe there are some subtleties.In any case, the function can be improved to know exactly what state the order had. [ARCHIVE!] Any rookie question, Discussion of article "Triangular Errors, bugs, questions Mikhail Filimonov 2015.12.02 20:45 #105 Dmitry Fedoseev: I don't know. If it was ORDER_STATE_PLACED, it's probably the same bug.And if it was ORDER_STATE_PARTIAL, I don't know. Alexander didn't tell us about this case, maybe there are some subtleties.In any case, the function can be improved to know what exactly was the state of the order.Perhaps it can be improved, but (in my opinion) the following is important:1. When the order is in an intermediate state, viz:ORDER_STATE_STARTEDORDER_STATE_REQUEST_ADDORDER_STATE_REQUEST_MODIFYORDER_STATE_REQUEST_CANCELthen nothing can be done with it, so ORD_BUSY(I don't see the point of these states at all)2. If the order is not in the history, it DOES exist, and can take ONLYtwo states:ORDER_STATE_PARTIAL = ORD_EXIST_PARTIALORDER_STATE_PLACED = ORD_EXIST3. All these conclusions are not taken "from the ceiling", but from MQL5 documentation,and if the developers have any "peculiarities" they MUSToutline them in the manual!4. I, for example, am not clairvoyant and can't know what the developers meant bywhen they wrote this or that function.Whatever explanation they gave you, that's the result!P/S Of course, you may misunderstand something, but not in this case. [ARCHIVE]Any rookie question, so Damned Martin two diffrent EA on prostotrader 2016.09.02 22:34 #106 Why is there no return code when the order is "kicked back" by the broker (exchange)?case ORDER_NONE_REJECTED: Print( __FUNCTION__, ": Main ордер отклонён брокером(биржей). Билет = ", trans.order, " Причина: ", result.retcode, " ", result.retcode_external ); break2016.09.02 16:11:05.687 trader (GAZR-12.16,H1) OnTradeTransaction: Main ордер отклонён брокером(биржей). Билет = 43595612 Причина: 0 02016.09.02 16:11:05.687 Trades 'xxxxx': exchange buy 9.00 GAZR-12.16 at market 2016.09.02 16:11:05.687 Trades 'xxxxx': accepted exchange buy 9.00 GAZR-12.16 at market 2016.09.02 16:11:05.687 Trades 'xxxxx': exchange buy 9.00 GAZR-12.16 at market placed for execution in 11.344 ms 2016.09.02 16:18:45.902 Trades 'xxxxx': buy limit 9.00 GAZR-3.17 at 14165 2016.09.02 16:18:45.908 Trades 'xxxxx': accepted buy limit 9.00 GAZR-3.17 at 14165 2016.09.02 16:18:45.909 Trades 'xxxxx': buy limit 9.00 GAZR-3.17 at 14165 placed for execution Renat Fatkhullin 2016.09.02 22:42 #107 prostotrader: Why is there no return code when the order is "kicked back" by the broker (exchange)?There is not always this code when you give the execution to a party.We will check the gateways and consider filling in this return code if we find the exact answers. prostotrader 2016.09.02 22:43 #108 Renat Fatkhullin: This code is not always there when you give the execution to a party.We will check the gateways and consider filling in this return code. Thank you. prostotrader 2016.10.21 01:57 #109 Today there was some kind of glitch on the MT5 server Orders were redirected but no reason (0 0).....Print( __FUNCTION__, ": Buy ордер отклонён брокером(биржей). Билет = ", trans.order, " Причина: ", result.retcode, " ", result.retcode_external );2016.10.20 20:31:08.793 trader (PLT-12.16,H1) OnTradeTransaction: Buy ордер отклонён брокером(биржей). Билет = 46614026 Причина: 0 02016.10.20 20:31:08.797 trader (TATN-12.16,H1) StopTrading: Время сервера = 20:31:08; Статус ордера = BUY_ORDER; Билет = 46614027 Ордер отклонён.2016.10.20 20:31:08.797 trader (TATN-12.16,H1) OnTradeTransaction: Buy ордер отклонён брокером(биржей). Билет = 46614027 Причина: 0 02016.10.20 20:31:08.801 trader (BR-12.16,M1) StopTrading: Время сервера = 20:31:08; Статус ордера = SELL_ORDER; Билет = 46614028 Ордер отклонён.2016.10.20 20:31:08.801 trader (BR-12.16,M1) OnTradeTransaction: Sell ордер отклонён брокером(биржей). Билет = 46614028 Причина: 0 02016.10.20 20:31:08.804 trader (SNGP-12.16,H1) StopTrading: Время сервера = 20:31:08; Статус ордера = BUY_ORDER; Билет = 46614029 Ордер отклонён.2016.10.20 20:31:08.804 trader (SNGP-12.16,H1) OnTradeTransaction: Buy ордер отклонён брокером(биржей). Билет = 46614029 Причина: 0 02016.10.20 20:31:08.806 trader (MXI-12.16,M1) StopTrading: Время сервера = 20:31:08; Статус ордера = BUY_ORDER; Билет = 46614030 Ордер отклонён. Questions from Beginners MQL5 Backtesting/Optimization Intra Day Trading 1...4567891011 New comment
It is not clear exactly what state the order was in.
To REMOVE an order, it is important that it DOES exist and is not in an "in-between" state.
Look carefully (with all explanations):
https://www.mql5.com/ru/forum/58012/page9#comment_2074928
To REMOVE an order, it is important that it DOES exist and is not in an "in-between" state.
Look carefully (with all explanations):
https://www.mql5.com/ru/forum/58012/page9#comment_2074928
Still interesting, and might be useful, as a clear argument for the servicedesk.
So you think the CheckOrderState() function is not written correctly?
P/S SD, silent as always....
So you think the CheckOrderState() function is not written correctly?
P/S SD, silent as always....
I don't know. If it was ORDER_STATE_PLACED, it's probably the same bug.
And if it was ORDER_STATE_PARTIAL, I don't know. Alexander didn't tell us about this case and maybe there are some subtleties.
In any case, the function can be improved to know exactly what state the order had.
I don't know. If it was ORDER_STATE_PLACED, it's probably the same bug.
And if it was ORDER_STATE_PARTIAL, I don't know. Alexander didn't tell us about this case, maybe there are some subtleties.
In any case, the function can be improved to know what exactly was the state of the order.
Perhaps it can be improved, but (in my opinion) the following is important:
1. When the order is in an intermediate state, viz:
ORDER_STATE_STARTED
ORDER_STATE_REQUEST_ADD
ORDER_STATE_REQUEST_MODIFY
ORDER_STATE_REQUEST_CANCEL
then nothing can be done with it, so ORD_BUSY
(I don't see the point of these states at all)
2. If the order is not in the history, it DOES exist, and can take ONLY
two states:
ORDER_STATE_PARTIAL = ORD_EXIST_PARTIAL
ORDER_STATE_PLACED = ORD_EXIST
3. All these conclusions are not taken "from the ceiling", but from MQL5 documentation,
and if the developers have any "peculiarities" they MUST
outline them in the manual!
4. I, for example, am not clairvoyant and can't know what the developers meant by
when they wrote this or that function.
Whatever explanation they gave you, that's the result!
P/S Of course, you may misunderstand something, but not in this case.
Why is there no return code when the order is "kicked back" by the broker (exchange)?
Why is there no return code when the order is "kicked back" by the broker (exchange)?
There is not always this code when you give the execution to a party.
We will check the gateways and consider filling in this return code if we find the exact answers.
This code is not always there when you give the execution to a party.
We will check the gateways and consider filling in this return code.
Today there was some kind of glitch on the MT5 server Orders were redirected but no reason (0 0).....
" Причина: ", result.retcode, " ", result.retcode_external );
2016.10.20 20:31:08.797 trader (TATN-12.16,H1) StopTrading: Время сервера = 20:31:08; Статус ордера = BUY_ORDER; Билет = 46614027 Ордер отклонён.
2016.10.20 20:31:08.797 trader (TATN-12.16,H1) OnTradeTransaction: Buy ордер отклонён брокером(биржей). Билет = 46614027 Причина: 0 0
2016.10.20 20:31:08.801 trader (BR-12.16,M1) StopTrading: Время сервера = 20:31:08; Статус ордера = SELL_ORDER; Билет = 46614028 Ордер отклонён.
2016.10.20 20:31:08.801 trader (BR-12.16,M1) OnTradeTransaction: Sell ордер отклонён брокером(биржей). Билет = 46614028 Причина: 0 0
2016.10.20 20:31:08.804 trader (SNGP-12.16,H1) StopTrading: Время сервера = 20:31:08; Статус ордера = BUY_ORDER; Билет = 46614029 Ордер отклонён.
2016.10.20 20:31:08.804 trader (SNGP-12.16,H1) OnTradeTransaction: Buy ордер отклонён брокером(биржей). Билет = 46614029 Причина: 0 0
2016.10.20 20:31:08.806 trader (MXI-12.16,M1) StopTrading: Время сервера = 20:31:08; Статус ордера = BUY_ORDER; Билет = 46614030 Ордер отклонён.