<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
	<channel>
		<title>Форум QUIK [тема: Заполнение флагов для заявок с tif=FOK]</title>
		<link>http://forum.quik.ru</link>
		<description>Новое в теме Заполнение флагов для заявок с tif=FOK форума  на сайте Форум QUIK [forum.quik.ru]</description>
		<language>ru</language>
		<docs>http://backend.userland.com/rss2</docs>
		<pubDate>Mon, 13 Apr 2026 14:53:22 +0300</pubDate>
		<item>
			<title>Заполнение флагов для заявок с tif=FOK</title>
			<description><![CDATA[<b><a href="http://forum.quik.ru/messages/forum10/message34171/topic3983/">Заполнение флагов для заявок с tif=FOK</a></b> в форуме <a href="http://forum.quik.ru/forum10/">Программирование на языке Lua</a>. <br />
			<br />====quote====<br /><a class="blog-p-user-name" id="bp_lo5V6FAD" href="/user/12592/" bx-tooltip-user-id="12592">bazuce</a> написал:<br />Допустил ошибку в первом пункте, да и темы тоже. <br /><br />Заявка отправляется с типом IOC.<br />Это несколько меняет логику, получается по такому типу заявок можно получить флаг исполнения в сообщении получаемом при обработки OnOrder только при полном исполнении?<br /><br />Что в первом, что во втором примере заявка исполнилась только частично<br />=============<br /><br />Заявка с типом IOC может исполниться частично, после чего сама снимается.<br />В Вашем случае, она была частично исполнена после чего снята, это Вы и видите.<br />Частичное исполнение должно быть видно в параметре ext_order_status, проверьте этот момент.<br />Однако ошибка про кросс курсы, в данном случае не понятна. &nbsp;Как уже было сказано и еще раз повторим, про нее может ответить только Ваш брокер. У нас нет совершенно никакой возможности определить причины ее возникновения.<br />Вероятная причина уже была озвучена, но без брокера это лишь догадки, не более. <br />
			<i>03.10.2018 05:54:50, Sergey Gorokhov.</i>]]></description>
			<link>http://forum.quik.ru/messages/forum10/message34171/topic3983/</link>
			<guid>http://forum.quik.ru/messages/forum10/message34171/topic3983/</guid>
			<pubDate>Wed, 03 Oct 2018 05:54:50 +0300</pubDate>
			<category>Программирование на языке Lua</category>
		</item>
		<item>
			<title>Заполнение флагов для заявок с tif=FOK</title>
			<description><![CDATA[<b><a href="http://forum.quik.ru/messages/forum10/message34167/topic3983/">Заполнение флагов для заявок с tif=FOK</a></b> в форуме <a href="http://forum.quik.ru/forum10/">Программирование на языке Lua</a>. <br />
			Допустил ошибку в первом пункте, да и темы тоже. <br /><br />Заявка отправляется с типом IOC.<br />Это несколько меняет логику, получается по такому типу заявок можно получить флаг исполнения в сообщении получаемом при обработки OnOrder только при полном исполнении?<br /><br />Что в первом, что во втором примере заявка исполнилась только частично <br />
			<i>02.10.2018 16:10:56, bazuce.</i>]]></description>
			<link>http://forum.quik.ru/messages/forum10/message34167/topic3983/</link>
			<guid>http://forum.quik.ru/messages/forum10/message34167/topic3983/</guid>
			<pubDate>Tue, 02 Oct 2018 16:10:56 +0300</pubDate>
			<category>Программирование на языке Lua</category>
		</item>
		<item>
			<title>Заполнение флагов для заявок с tif=FOK</title>
			<description><![CDATA[<b><a href="http://forum.quik.ru/messages/forum10/message34166/topic3983/">Заполнение флагов для заявок с tif=FOK</a></b> в форуме <a href="http://forum.quik.ru/forum10/">Программирование на языке Lua</a>. <br />
			<br />====quote====<br />Не понятно зачем гадать. Флаги описаны в документации QLUA.chm<br />-Описание битовых флагов<br />--Флаги для таблиц Заявки, Заявки на внебиржевые сделки, Сделки, Сделки для исполнения<br />=============<br />Я не гадаю, это и есть интерпретация на основе документации<br />====quote====<br /><br />у Вас флаги flags=286.<br />В битовом представлении это число 100011110<br />Видим что 0x1 равен 0, а 0x2 равен 1.<br />Согласно документации это значит что заявка снята.<br />И на скриншоте она у Вас снята. И по reject_reason она снята.<br />Почему Вы думаете что она исполнена совсем не понятно. Посмотрите сами в таблице заявок, колонка Статус<br />=============<br />Это скриншот таблицы сделок, заявка была исполнена, есть биржевой номер.<br />====quote====<br />&quot;кросс сделка&quot; это потенциальная сделка с самим собой. <br />Возможно в момент срабатывания заявки у Вас была активна другая заявка противоположного направления?<br />В любом случае, как Вы на нее наткнулись подскажет только брокер.<br />=============<br />Мне кажется Вы не совсем полностью рассмотрели второй пример или вообще не посмотрели, давайте опишу его словесно, чтобы стало понятнее:<br /><br />1. Я отправил заявку с типом FOK (Полностью или отклонить), получил подтверждение что она принята с номером 39888085050<br />2. Я получил несколько экземпляров OnTrade с частичным исполнением заявки под номером 39888085050<br />3. Я получил OnOrder по уже частично исполненной заявке 39888085050 со статусом rejected=&quot;Вследствие возможной кросс-сделки&quot;, и флагами, что заявка снята.<br />4. После я получил вторую пачку сообщений OnTrade с второй частью исполнения на 10 лотов (не добавил кусок лога)<br /><br />Является ли валидной ситуация в которой я получил две сделки и статус по заявке - снята с причиной rejected=&quot;Вследствие возможной кросс-сделки&quot;? <br />
			<i>02.10.2018 16:00:44, bazuce.</i>]]></description>
			<link>http://forum.quik.ru/messages/forum10/message34166/topic3983/</link>
			<guid>http://forum.quik.ru/messages/forum10/message34166/topic3983/</guid>
			<pubDate>Tue, 02 Oct 2018 16:00:44 +0300</pubDate>
			<category>Программирование на языке Lua</category>
		</item>
		<item>
			<title>Заполнение флагов для заявок с tif=FOK</title>
			<description><![CDATA[<b><a href="http://forum.quik.ru/messages/forum10/message34160/topic3983/">Заполнение флагов для заявок с tif=FOK</a></b> в форуме <a href="http://forum.quik.ru/forum10/">Программирование на языке Lua</a>. <br />
			<br />====quote====<br /><a class="blog-p-user-name" id="bp_6KvrojP8" href="/user/12592/" bx-tooltip-user-id="12592">bazuce</a> написал:<br />1. Насколько я понимаю, флаги в данном случае заполнились неверно? И причина описанная в reject_reason тоже невалидная? Как правильно определить что заявка с типом FOK была исполнена при обработке OnOrder ?<br />=============<br />Не понятно зачем гадать. Флаги описаны в документации QLUA.chm<br />-Описание битовых флагов<br />--Флаги для таблиц Заявки, Заявки на внебиржевые сделки, Сделки, Сделки для исполнения<br /><br />Там написано<br /><br />====quote====<br /><br />бит 0 (0x1) &nbsp;Заявка активна, иначе – не активна &nbsp;<br />бит 1 (0x2) &nbsp;Заявка снята. Если флаг не установлен и значение бита «0» равно «0», то заявка исполнена &nbsp;<br /><br />=============<br />у Вас флаги flags=286.<br />В битовом представлении это число 100011110<br />Видим что 0x1 равен 0, а 0x2 равен 1.<br />Согласно документации это значит что заявка снята.<br />И на скриншоте она у Вас снята. И по reject_reason она снята.<br />Почему Вы думаете что она исполнена совсем не понятно. Посмотрите сами в таблице заявок, колонка Статус<br /><br /><br />====quote====<br /><a class="blog-p-user-name" id="bp_weqZG3v1" href="/user/12592/" bx-tooltip-user-id="12592">bazuce</a> написал:<br />2. Почему по бирже СПБ приходят два одинаковых callback в OnOrder ?<br /><br />=============<br />Они не одинаковые. Посмотрите параметры uid и trans_id<br />Двойная отправка происходит как раз из-за обновления этих полей.<br /><br /><br />====quote====<br /><a class="blog-p-user-name" id="bp_Iz3FR6F0" href="/user/12592/" bx-tooltip-user-id="12592">bazuce</a> написал:<br />3. Зачем так много вызовов OnTrade?<br />=============<br />В отличии от OnOrder, тут другая история, Вы столкнулись с известной ошибкой повторной рассылки OnTrade.<br />Данная ошибка нам известна и к сожалению, пока не исправлена, но обязательно будет.<br /><br /><br />====quote====<br /><a class="blog-p-user-name" id="bp_6io40zTN" href="/user/12592/" bx-tooltip-user-id="12592">bazuce</a> написал:<br />4. Почему причина снятия заявки теперь reject_reason="Вследствие возможной кросс-сделки"?<br /><br />=============<br />"кросс сделка" это потенциальная сделка с самим собой. <br />Возможно в момент срабатывания заявки у Вас была активна другая заявка противоположного направления?<br />В любом случае, как Вы на нее наткнулись подскажет только брокер. <br />
			<i>02.10.2018 06:04:57, Sergey Gorokhov.</i>]]></description>
			<link>http://forum.quik.ru/messages/forum10/message34160/topic3983/</link>
			<guid>http://forum.quik.ru/messages/forum10/message34160/topic3983/</guid>
			<pubDate>Tue, 02 Oct 2018 06:04:57 +0300</pubDate>
			<category>Программирование на языке Lua</category>
		</item>
		<item>
			<title>Заполнение флагов для заявок с tif=FOK</title>
			<description><![CDATA[<b><a href="http://forum.quik.ru/messages/forum10/message34152/topic3983/">Заполнение флагов для заявок с tif=FOK</a></b> в форуме <a href="http://forum.quik.ru/forum10/">Программирование на языке Lua</a>. <br />
			Включил запись OnTrade, этот пример получился даже интереснее:<br /><br /><br />Отправил:<br />2018-10-01 16:53:26.626 lvl 4: {&#91;&quot;Условие исполнения&quot;&#93;=&quot;Снять остаток&quot;,ACTION=&quot;Ввод заявки&quot;,CLASSCODE=&quot;SPBXM&quot;,&#91;&quot;Комментарий&quot;&#93;=&quot;BBBBB/&quot;,TRANS_ID=&quot;1031&quot;,&#91;&quot;К/П&quot;&#93;=&quot;Покупка&quot;,&#91;&quot;Количество&quot;&#93;=&quot;20&quot;,&#91;&quot;Цена&quot;&#93;=&quot;99.22&quot;,&#91;&quot;Инструмент&quot;&#93;=&quot;SQ&quot;,&#91;&quot;Торговый счет&quot;&#93;=&quot;AAAAA&quot;,&#91;&quot;Класс&quot;&#93;=&quot;SPBXM&quot;,&#91;&quot;Тип&quot;&#93;=&quot;Лимитированная&quot;}<br /><br />Получил:<br />2018-10-01 16:53:26.641 lvl 4: OnTransReply()<br />2018-10-01 16:53:26.641 lvl 4: {sec_code=&quot;SQ&quot;,price=99.22,client_code=&quot;BBBBB&quot;,balance=0,time=165631,status=3,class_code=&quot;SPBXM&quot;,trans_id=1031,exchange_code=&quot;3988808505&quot;,date_time={week_day=1,hour=16,ms=880,mcs=880171,day=1,month=10,sec=31,year=2018,min=56},uid=1183,flags=262145,result_msg=&quot;Заявка 39888085050 успешно зарегистрирована.&quot;,brokerref=&quot;BBBBB/&quot;,firm_id=&quot;CCCCC&quot;,quantity=20,order_num=39888085050,server_trans_id=1863,account=&quot;AAAAA&quot;}<br />2018-10-01 16:53:26.683 lvl 4: OnTrade -&lt;<br />2018-10-01 16:53:26.683 lvl 4: {price=99.22,settle_date=20181003,trade_num=36712950,lower_discount=0,exchange_comission=0,value=992.2,qty=10,reporate=0,clearing_bank_accid=&quot;&quot;,class_code=&quot;SPBXM&quot;,userid=&quot;&quot;,tradenum=36712950,flags=0,canceled_datetime={week_day=1,hour=0,ms=0,mcs=0,day=1,month=1,sec=0,year=1601,min=0},datetime={week_day=1,hour=16,ms=877,mcs=877885,day=1,month=10,sec=31,year=2018,min=56},clearing_firmid=&quot;&quot;,kind=1,canceled_uid=0,ordernum=39888085050,sec_code=&quot;SQ&quot;,system_ref=&quot;&quot;,block_securities=0,repoterm=0,broker_comission=0,period=1,client_code=&quot;BBBBB&quot;,linked_trade=0,firmid=&quot;ALRBM&quot;,account=&quot;AAAAA&quot;,yield=0,seccode=&quot;SQ&quot;,trans_id=1031,upper_discount=0,repo2value=0,start_discount=0,tech_center_comission=0,trade_currency=&quot;USD&quot;,accrued2=0,order_num=39888085050,repovalue=0,exchange_code=&quot;3671295&quot;,accruedint=0,settle_currency=&quot;USD&quot;,cpfirmid=&quot;&quot;,uid=1183,brokerref=&quot;BBBBB/&quot;,station_id=&quot;3988808505&quot;,price2=0,clearing_comission=0,settlecode=&quot;T2&quot;,bank_acc_id=&quot;&quot;}<br />2018-10-01 16:53:26.683 lvl 4: OnTrade -&lt;<br />2018-10-01 16:53:26.683 lvl 4: {price=99.22,settle_date=20181003,trade_num=36712950,lower_discount=0,exchange_comission=0,value=992.2,qty=10,reporate=0,clearing_bank_accid=&quot;&quot;,class_code=&quot;SPBXM&quot;,userid=&quot;&quot;,tradenum=36712950,flags=0,canceled_datetime={week_day=1,hour=0,ms=0,mcs=0,day=1,month=1,sec=0,year=1601,min=0},datetime={week_day=1,hour=16,ms=877,mcs=877885,day=1,month=10,sec=31,year=2018,min=56},clearing_firmid=&quot;&quot;,kind=1,canceled_uid=0,ordernum=39888085050,sec_code=&quot;SQ&quot;,system_ref=&quot;&quot;,block_securities=0,repoterm=0,broker_comission=0,period=1,client_code=&quot;BBBBB&quot;,linked_trade=0,firmid=&quot;ALRBM&quot;,account=&quot;AAAAA&quot;,yield=0,seccode=&quot;SQ&quot;,trans_id=1031,upper_discount=0,repo2value=0,start_discount=0,tech_center_comission=0,trade_currency=&quot;USD&quot;,accrued2=0,order_num=39888085050,repovalue=0,exchange_code=&quot;3671295&quot;,accruedint=0,settle_currency=&quot;USD&quot;,cpfirmid=&quot;&quot;,uid=1183,brokerref=&quot;BBBBB/&quot;,station_id=&quot;3988808505&quot;,price2=0,clearing_comission=0,settlecode=&quot;T2&quot;,bank_acc_id=&quot;&quot;}<br />2018-10-01 16:53:26.683 lvl 4: OnTrade -&lt;<br />2018-10-01 16:53:26.684 lvl 4: {price=99.22,settle_date=20181003,trade_num=36712950,lower_discount=0,exchange_comission=0,value=992.2,qty=10,reporate=0,clearing_bank_accid=&quot;&quot;,class_code=&quot;SPBXM&quot;,userid=&quot;&quot;,tradenum=36712950,flags=0,canceled_datetime={week_day=1,hour=0,ms=0,mcs=0,day=1,month=1,sec=0,year=1601,min=0},datetime={week_day=1,hour=16,ms=877,mcs=877885,day=1,month=10,sec=31,year=2018,min=56},clearing_firmid=&quot;&quot;,kind=1,canceled_uid=0,ordernum=39888085050,sec_code=&quot;SQ&quot;,system_ref=&quot;&quot;,block_securities=0,repoterm=0,broker_comission=0,period=1,client_code=&quot;BBBBB&quot;,linked_trade=0,firmid=&quot;ALRBM&quot;,account=&quot;AAAAA&quot;,yield=0,seccode=&quot;SQ&quot;,trans_id=1031,upper_discount=0,repo2value=0,start_discount=0,tech_center_comission=0,trade_currency=&quot;USD&quot;,accrued2=0,order_num=39888085050,repovalue=0,exchange_code=&quot;3671295&quot;,accruedint=0,settle_currency=&quot;USD&quot;,cpfirmid=&quot;&quot;,uid=1183,brokerref=&quot;BBBBB/&quot;,station_id=&quot;3988808505&quot;,price2=0,clearing_comission=0,settlecode=&quot;T2&quot;,bank_acc_id=&quot;&quot;}<br />2018-10-01 16:53:26.684 lvl 4: OnOrder()<br />2018-10-01 16:53:26.684 lvl 4: {withdraw_datetime={week_day=1,hour=16,ms=877,mcs=877885,day=1,month=10,sec=31,year=2018,min=56},price=99.22,value_entry_type=0,balance=10,repo_value_balance=0,value=1984.4,qty=20,passive_only_order=0,class_code=&quot;SPBXM&quot;,activation_time=0,userid=&quot;&quot;,expiry=-1,flags=282,linkedorder=0,ordernum=39888085050,sec_code=&quot;SQ&quot;,canceled_uid=0,side_qualifier=0,client_code=&quot;BBBBB&quot;,visible=0,firmid=&quot;ALRBM&quot;,datetime={week_day=1,hour=16,ms=877,mcs=877885,day=1,month=10,sec=31,year=2018,min=56},yield=0,reject_reason=&quot;Вследствие возможной кросс-сделки&quot;,capacity=0,acnt_type=0,repo2value=0,start_discount=0,min_qty=0,ext_order_flags=0,exec_type=3,order_num=39888085050,repovalue=0,repoterm=0,accruedint=0,account=&quot;AAAAA&quot;,seccode=&quot;SQ&quot;,uid=0,brokerref=&quot;BBBBB/&quot;,exchange_code=&quot;3988808505&quot;,settlecode=&quot;T2&quot;,price2=0,trans_id=0,bank_acc_id=&quot;&quot;}<br />2018-10-01 16:53:26.684 lvl 4: OnOrder()<br />2018-10-01 16:53:26.685 lvl 4: {withdraw_datetime={week_day=1,hour=16,ms=877,mcs=877885,day=1,month=10,sec=31,year=2018,min=56},price=99.22,value_entry_type=0,balance=10,repo_value_balance=0,value=1984.4,qty=20,passive_only_order=0,class_code=&quot;SPBXM&quot;,activation_time=0,userid=&quot;&quot;,expiry=-1,flags=282,linkedorder=0,ordernum=39888085050,sec_code=&quot;SQ&quot;,canceled_uid=0,side_qualifier=0,client_code=&quot;BBBBB&quot;,visible=0,firmid=&quot;ALRBM&quot;,datetime={week_day=1,hour=16,ms=877,mcs=877885,day=1,month=10,sec=31,year=2018,min=56},yield=0,reject_reason=&quot;Вследствие возможной кросс-сделки&quot;,capacity=0,acnt_type=0,repo2value=0,start_discount=0,min_qty=0,ext_order_flags=0,exec_type=3,order_num=39888085050,repovalue=0,repoterm=0,accruedint=0,account=&quot;AAAAA&quot;,seccode=&quot;SQ&quot;,uid=1183,brokerref=&quot;BBBBB/&quot;,exchange_code=&quot;3988808505&quot;,settlecode=&quot;T2&quot;,price2=0,trans_id=1031,bank_acc_id=&quot;&quot;}<br /><br />3. Зачем так много вызовов OnTrade?<br />4. Почему причина снятия заявки теперь reject_reason=&quot;Вследствие возможной кросс-сделки&quot;? <br />
			<i>01.10.2018 17:25:29, bazuce.</i>]]></description>
			<link>http://forum.quik.ru/messages/forum10/message34152/topic3983/</link>
			<guid>http://forum.quik.ru/messages/forum10/message34152/topic3983/</guid>
			<pubDate>Mon, 01 Oct 2018 17:25:29 +0300</pubDate>
			<category>Программирование на языке Lua</category>
		</item>
		<item>
			<title>Заполнение флагов для заявок с tif=FOK</title>
			<description><![CDATA[<b><a href="http://forum.quik.ru/messages/forum10/message34151/topic3983/">Заполнение флагов для заявок с tif=FOK</a></b> в форуме <a href="http://forum.quik.ru/forum10/">Программирование на языке Lua</a>. <br />
			Возникла проблема при попытке интерпретации флагов, получаемых при обработке OnOrder(), биржа SPB.<br /><br />Я отправляю:<br />2018-10-01 15:10:55.731 lvl 4: {&#91;&quot;Условие исполнения&quot;&#93;=&quot;Снять остаток&quot;,ACTION=&quot;Ввод заявки&quot;,CLASSCODE=&quot;SPBXM&quot;,<br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&#91;&quot;Комментарий&quot;&#93;=&quot;comment&quot;,TRANS_ID=&quot;540&quot;,&#91;&quot;К/П&quot;&#93;=&quot;Продажа&quot;,&#91;&quot;Количество&quot;&#93;=&quot;50&quot;,&#91;&quot;Цена&quot;&#93;=&quot;100.97&quot;,<br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&#91;&quot;Инструмент&quot;&#93;=&quot;SQ&quot;,&#91;&quot;Торговый счет&quot;&#93;=&quot;AAAAA&quot;,&#91;&quot;Класс&quot;&#93;=&quot;SPBXM&quot;,&#91;&quot;Тип&quot;&#93;=&quot;Лимитированная&quot;}<br /><br />В ответ получаю набор сообщений:<br />2018-10-01 15:10:55.746 lvl 4: OnTransReply()<br />2018-10-01 15:10:55.746 lvl 4: {sec_code=&quot;SQ&quot;,price=100.97,client_code=&quot;BBBBB&quot;,balance=0,time=151400,status=3,<br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;class_code=&quot;SPBXM&quot;,trans_id=540,exchange_code=&quot;3988228638&quot;,date_time={week_day=1,<br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;hour=15,ms=963,mcs=963583,day=1,month=10,sec=0,year=2018,min=14},uid=1183,flags=393217,<br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;result_msg=&quot;Заявка 39882286380 успешно зарегистрирована.&quot;,brokerref=&quot;BBBBB&quot;,firm_id=&quot;CCCCC&quot;,<br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;quantity=50,order_num=39882286380,server_trans_id=1863,account=&quot;AAAAA&quot;}<br />2018-10-01 15:10:55.761 lvl 4: OnOrder()<br />2018-10-01 15:10:55.761 lvl 4: {withdraw_datetime={week_day=1,hour=15,ms=962,mcs=962914,day=1,month=10,sec=0,year=2018,min=14},<br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;price=100.97,value_entry_type=0,balance=1,repo_value_balance=0,value=5048.5,qty=50,passive_only_order=0,<br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;class_code=&quot;SPBXM&quot;,activation_time=0,userid=&quot;&quot;,expiry=-1,flags=286,linkedorder=0,ordernum=39882286380,<br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;sec_code=&quot;SQ&quot;,canceled_uid=0,side_qualifier=0,client_code=&quot;BBBBB&quot;,visible=0,firmid=&quot;CCCCC&quot;,<br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;datetime={week_day=1,hour=15,ms=962,mcs=962914,day=1,month=10,sec=0,year=2018,min=14},yield=0,<br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;reject_reason=&quot;Истекло время действия&quot;,capacity=0,acnt_type=0,repo2value=0,start_discount=0,<br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;min_qty=0,ext_order_flags=0,exec_type=3,order_num=39882286380,repovalue=0,repoterm=0,<br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;accruedint=0,account=&quot;AAAAA&quot;,seccode=&quot;SQ&quot;,uid=0,brokerref=&quot;BBBBB&quot;,exchange_code=&quot;3988228638&quot;,<br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;settlecode=&quot;T2&quot;,price2=0,trans_id=0,bank_acc_id=&quot;&quot;}<br />2018-10-01 15:10:55.761 lvl 4: OnOrder()<br />2018-10-01 15:10:55.761 lvl 4: {withdraw_datetime={week_day=1,hour=15,ms=962,mcs=962914,day=1,month=10,sec=0,year=2018,min=14},<br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;price=100.97,value_entry_type=0,balance=1,repo_value_balance=0,value=5048.5,qty=50,<br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;passive_only_order=0,class_code=&quot;SPBXM&quot;,activation_time=0,userid=&quot;&quot;,expiry=-1,<br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;flags=286,linkedorder=0,ordernum=39882286380,sec_code=&quot;SQ&quot;,<br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;canceled_uid=0,side_qualifier=0,client_code=&quot;BBBBB&quot;,visible=0,firmid=&quot;CCCCC&quot;,<br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;datetime={week_day=1,hour=15,ms=962,mcs=962914,day=1,month=10,sec=0,year=2018,min=14},yield=0,<br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;reject_reason=&quot;Истекло время действия&quot;,capacity=0,acnt_type=0,repo2value=0,start_discount=0,<br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;min_qty=0,ext_order_flags=0,exec_type=3,order_num=39882286380,repovalue=0,repoterm=0,<br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;accruedint=0,account=&quot;AAAAA&quot;,seccode=&quot;SQ&quot;,uid=1183,brokerref=&quot;BBBBB&quot;,<br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;exchange_code=&quot;3988228638&quot;,settlecode=&quot;T2&quot;,price2=0,trans_id=540,bank_acc_id=&quot;&quot;}<br /><br />Если я правильно обрабатываю поле, то мне пришли следующие флаги:<br />flag1 - Заявка снята<br />flag2 - Заявка на продажу<br />flag3 - Заявка лимитная<br />flag4 - Разрешить сделки по разным ценам<br />flag8 - Снять остаток<br /><br />При этом заявка была исполнена (на время не обращайте внимание, у меня рассинхронизация между логом и сервером, OnTrade к сожалению записывал):<br /><br /><img src="https://i.gyazo.com/22d75c53964e2e4db2f8a1e545acc64b.png" alt="Пользователь добавил изображение" border="0" /><br /><br /><br />1. Насколько я понимаю, флаги в данном случае заполнились неверно? И причина описанная в reject_reason тоже невалидная? Как правильно определить что заявка с типом FOK была исполнена при обработке OnOrder ?<br />2. Почему по бирже СПБ приходят два одинаковых callback в OnOrder ? <br />
			<i>01.10.2018 16:59:03, bazuce.</i>]]></description>
			<link>http://forum.quik.ru/messages/forum10/message34151/topic3983/</link>
			<guid>http://forum.quik.ru/messages/forum10/message34151/topic3983/</guid>
			<pubDate>Mon, 01 Oct 2018 16:59:03 +0300</pubDate>
			<category>Программирование на языке Lua</category>
		</item>
	</channel>
</rss>
