Repository navigation
Tinvest.new_order: для стоп заявок сохранять stop_order_id - #4
Open
oleg-dixon wants to merge 1 commit into
Open
oleg-dixon wants to merge 1 commit into
oleg-dixon wants to merge 1 commit into
Conversation
…er_request_id PostStopOrder возвращает stop_order_id и order_request_id. В order.id попадал order_request_id, который пустой, поэтому у стоп заявки не было идентификатора: cancel_order (CancelStopOrder по stop_order_id) падал с ошибкой 30027, а в списке активных заявок (get_orders, GetStopOrders) та же заявка шла под stop_order_id. Теперь в обеих ветках (Stop и StopLimit) используется stop_order_id.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Здравствуйте, Игорь! Нашёл ещё одно расхождение в
Tinvest.new_order, на этот раз для стоп заявок.Проблема. В ветках Stop и StopLimit в
order.idпопадаетresponse.order_request_id. В ответеPostStopOrderэто поле пустое, настоящий идентификатор стоп заявки —stop_order_id. В результате у стоп заявки нет идентификатора:cancel_order(CancelStopOrderпоstop_order_id) падает с ошибкой 30027 (заявка не найдена), а вget_ordersта же заявка идёт подstop_order_id, то есть сопоставить её с отправленной нельзя.Как наблюдал. 23.10.2026 на боевом счёте T-Инвестиции: рыночная покупка 1 акции SBER, затем стоп заявка на продажу (Stop) и стоп-лимитная (StopLimit) ниже рынка. После
new_orderorder.idпустой;cancel_order(order)падает с ошибкой 30027; вget_ordersзаявка есть подstop_order_id, иCancelStopOrderпо нему проходит.Правка. Две строки:
order.id = response.stop_order_idв обеих ветках. С правкой проверил повторным запуском:idсовпадает с идентификатором изget_orders,cancel_orderснимает стоп заявку, активных заявок не остаётся. Остальной код не затронут.Если считаете, что идентификаторы нужно обрабатывать иначе, подскажите — переделаю.