<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
	<channel>
		<title>Форум QUIK [тема: limit_kind в таблице depo_limit]</title>
		<link>http://forum.quik.ru</link>
		<description>Новое в теме limit_kind в таблице depo_limit форума  на сайте Форум QUIK [forum.quik.ru]</description>
		<language>ru</language>
		<docs>http://backend.userland.com/rss2</docs>
		<pubDate>Fri, 18 Sep 2026 04:34:34 +0300</pubDate>
		<item>
			<title>limit_kind в таблице depo_limit</title>
			<description><![CDATA[<b><a href="http://forum.quik.ru/messages/forum10/message83052/topic8865/">limit_kind в таблице depo_limit</a></b> в форуме <a href="http://forum.quik.ru/forum10/">Программирование на языке Lua</a>. <br />
			<br />====quote====<br /><a class="blog-p-user-name" id="bp_lAa9JKUh" href="/user/62/" bx-tooltip-user-id="62">nikolz</a> написал:<br />Я ответил вам про параметр NUMBER limit_kind<br />что непонятно? &nbsp;<br />=============<br />То, что теперь limit_kind - это дата, а не число. <br />
			<i>01.08.2026 19:31:23, Сергей Че.</i>]]></description>
			<link>http://forum.quik.ru/messages/forum10/message83052/topic8865/</link>
			<guid>http://forum.quik.ru/messages/forum10/message83052/topic8865/</guid>
			<pubDate>Sat, 01 Aug 2026 19:31:23 +0300</pubDate>
			<category>Программирование на языке Lua</category>
		</item>
		<item>
			<title>limit_kind в таблице depo_limit</title>
			<description><![CDATA[<b><a href="http://forum.quik.ru/messages/forum10/message83051/topic8865/">limit_kind в таблице depo_limit</a></b> в форуме <a href="http://forum.quik.ru/forum10/">Программирование на языке Lua</a>. <br />
			для фьючерсов ставлю NUMBER type=0 <br />
			<i>01.08.2026 11:50:25, nikolz.</i>]]></description>
			<link>http://forum.quik.ru/messages/forum10/message83051/topic8865/</link>
			<guid>http://forum.quik.ru/messages/forum10/message83051/topic8865/</guid>
			<pubDate>Sat, 01 Aug 2026 11:50:25 +0300</pubDate>
			<category>Программирование на языке Lua</category>
		</item>
		<item>
			<title>limit_kind в таблице depo_limit</title>
			<description><![CDATA[<b><a href="http://forum.quik.ru/messages/forum10/message83050/topic8865/">limit_kind в таблице depo_limit</a></b> в форуме <a href="http://forum.quik.ru/forum10/">Программирование на языке Lua</a>. <br />
			<ul><li><p>limit_kind — это число, кодирующее режим расчётов:</p><ul><li>0 — T+0;<br /><li>1 — T+1;<br /><li>2 — T+2;<br /><li>365 — Tx (плановая позиция с максимальной датой расчётов).<br /></ul></ul> <br />
			<i>01.08.2026 11:49:02, nikolz.</i>]]></description>
			<link>http://forum.quik.ru/messages/forum10/message83050/topic8865/</link>
			<guid>http://forum.quik.ru/messages/forum10/message83050/topic8865/</guid>
			<pubDate>Sat, 01 Aug 2026 11:49:02 +0300</pubDate>
			<category>Программирование на языке Lua</category>
		</item>
		<item>
			<title>limit_kind в таблице depo_limit</title>
			<description><![CDATA[<b><a href="http://forum.quik.ru/messages/forum10/message83049/topic8865/">limit_kind в таблице depo_limit</a></b> в форуме <a href="http://forum.quik.ru/forum10/">Программирование на языке Lua</a>. <br />
			ставьте 0 или 1 или 2 или 3 <br /> limit_kind режим расчётов по сделке:<ul><li>0 — Т+0 (расчёт в день сделки);<br /><li>1 — Т+1 (расчёт на следующий рабочий день);<br /><li>2 — Т+2 и так далее.<br /></ul> <br />
			<i>01.08.2026 11:46:10, nikolz.</i>]]></description>
			<link>http://forum.quik.ru/messages/forum10/message83049/topic8865/</link>
			<guid>http://forum.quik.ru/messages/forum10/message83049/topic8865/</guid>
			<pubDate>Sat, 01 Aug 2026 11:46:10 +0300</pubDate>
			<category>Программирование на языке Lua</category>
		</item>
		<item>
			<title>limit_kind в таблице depo_limit</title>
			<description><![CDATA[<b><a href="http://forum.quik.ru/messages/forum10/message83048/topic8865/">limit_kind в таблице depo_limit</a></b> в форуме <a href="http://forum.quik.ru/forum10/">Программирование на языке Lua</a>. <br />
			<br />====quote====<br /><a class="blog-p-user-name" id="bp_oTPiWrFL" href="/user/16669/" bx-tooltip-user-id="16669">Сергей Че</a> написал:<br /> <br />====quote====<br /><noindex><a href="/user/62/" target="_blank" rel="nofollow">nikolz</a></noindex> написал:<br /> &nbsp;<br />====quote====<br /> <noindex><a href="/user/16669/" target="_blank" rel="nofollow">Сергей Че</a></noindex> &nbsp;написал:<br />limit_kind<br />=============<br /> &nbsp; limit_kind&gt;=0<br />=============<br /> &nbsp;<br /> <br /> Очень информативно! (нет!) <br />Если не можете дать чёткий ответ, лучше не писать.<br />=============<br />Я ответил вам про параметр NUMBER limit_kind<br />что непонятно? &nbsp; <br />
			<i>01.08.2026 11:44:10, nikolz.</i>]]></description>
			<link>http://forum.quik.ru/messages/forum10/message83048/topic8865/</link>
			<guid>http://forum.quik.ru/messages/forum10/message83048/topic8865/</guid>
			<pubDate>Sat, 01 Aug 2026 11:44:10 +0300</pubDate>
			<category>Программирование на языке Lua</category>
		</item>
		<item>
			<title>limit_kind в таблице depo_limit</title>
			<description><![CDATA[<b><a href="http://forum.quik.ru/messages/forum10/message83044/topic8865/">limit_kind в таблице depo_limit</a></b> в форуме <a href="http://forum.quik.ru/forum10/">Программирование на языке Lua</a>. <br />
			<br />====quote====<br /><a class="blog-p-user-name" id="bp_NrXie3Jh" href="/user/62/" bx-tooltip-user-id="62">nikolz</a> написал:<br /> <br />====quote====<br /><noindex><a href="/user/16669/" target="_blank" rel="nofollow">Сергей Че</a></noindex> написал:<br />limit_kind<br />=============<br /> &nbsp;limit_kind&gt;=0<br />=============<br /><B><br /></B><br /><B>Очень информативно! (нет!)</B><br />Если не можете дать чёткий ответ, лучше не писать. <br />
			<i>31.07.2026 18:43:27, Сергей Че.</i>]]></description>
			<link>http://forum.quik.ru/messages/forum10/message83044/topic8865/</link>
			<guid>http://forum.quik.ru/messages/forum10/message83044/topic8865/</guid>
			<pubDate>Fri, 31 Jul 2026 18:43:27 +0300</pubDate>
			<category>Программирование на языке Lua</category>
		</item>
		<item>
			<title>limit_kind в таблице depo_limit</title>
			<description><![CDATA[<b><a href="http://forum.quik.ru/messages/forum10/message83026/topic8865/">limit_kind в таблице depo_limit</a></b> в форуме <a href="http://forum.quik.ru/forum10/">Программирование на языке Lua</a>. <br />
			<br />====quote====<br /><a class="blog-p-user-name" id="bp_DLGEjmvg" href="/user/16669/" bx-tooltip-user-id="16669">Сергей Че</a> написал:<br />limit_kind<br />=============<br /> limit_kind&gt;=0 <br />
			<i>31.07.2026 08:50:47, nikolz.</i>]]></description>
			<link>http://forum.quik.ru/messages/forum10/message83026/topic8865/</link>
			<guid>http://forum.quik.ru/messages/forum10/message83026/topic8865/</guid>
			<pubDate>Fri, 31 Jul 2026 08:50:47 +0300</pubDate>
			<category>Программирование на языке Lua</category>
		</item>
		<item>
			<title>limit_kind в таблице depo_limit</title>
			<description><![CDATA[<b><a href="http://forum.quik.ru/messages/forum10/message83025/topic8865/">limit_kind в таблице depo_limit</a></b> в форуме <a href="http://forum.quik.ru/forum10/">Программирование на языке Lua</a>. <br />
			<br />====quote====<br /><a class="blog-p-user-name" id="bp_66uzK21T" href="/user/16979/" bx-tooltip-user-id="16979">Oleg Kuzembaev</a> написал:<br />Вы можете использовать функции getDepo или getDepoEx, передавая в них нужные параметры (client_code, firmid, sec_code и trdaccid), на выходе получите нужные поля инструмента вне зависимости от обслуживающего брокера.<br />=============<br /><br />Вы так и не ответили на вопрос, что же именно передавать в качестве параметров в функции, чтобы получить реальную позициию акции, фьючерса или оациона.<br /><br /><br />====quote====<br /><span class="bx-font" style="font-family:monospace">TABLE getDepoEx( STRING firmid, STRING client_code, STRING sec_code, STRING trdaccid, <B><U>NUMBER limit_kind</U></B> )</span><br /><p><span class="bx-font" style="font-family:monospace">TABLE getFuturesHolding( STRING firmid, STRING trdaccid, STRING sec_code, <B><U>NUMBER type</U></B> )</span></p>=============<br /><p></p> <br />
			<i>30.07.2026 20:30:07, Сергей Че.</i>]]></description>
			<link>http://forum.quik.ru/messages/forum10/message83025/topic8865/</link>
			<guid>http://forum.quik.ru/messages/forum10/message83025/topic8865/</guid>
			<pubDate>Thu, 30 Jul 2026 20:30:07 +0300</pubDate>
			<category>Программирование на языке Lua</category>
		</item>
		<item>
			<title>limit_kind в таблице depo_limit</title>
			<description><![CDATA[<b><a href="http://forum.quik.ru/messages/forum10/message83016/topic8865/">limit_kind в таблице depo_limit</a></b> в форуме <a href="http://forum.quik.ru/forum10/">Программирование на языке Lua</a>. <br />
			<a class="blog-p-user-name" id="bp_lw6tIkYi" href="/user/16669/" bx-tooltip-user-id="16669">Сергей Че</a>, здравствуйте.<br /><br />Вы можете использовать функции getDepo или getDepoEx, передавая в них нужные параметры (client_code, firmid, sec_code и trdaccid), на выходе получите нужные поля инструмента вне зависимости от обслуживающего брокера. <br />
			<i>30.07.2026 12:14:53, Oleg Kuzembaev.</i>]]></description>
			<link>http://forum.quik.ru/messages/forum10/message83016/topic8865/</link>
			<guid>http://forum.quik.ru/messages/forum10/message83016/topic8865/</guid>
			<pubDate>Thu, 30 Jul 2026 12:14:53 +0300</pubDate>
			<category>Программирование на языке Lua</category>
		</item>
		<item>
			<title>limit_kind в таблице depo_limit</title>
			<description><![CDATA[<b><a href="http://forum.quik.ru/messages/forum10/message82861/topic8865/">limit_kind в таблице depo_limit</a></b> в форуме <a href="http://forum.quik.ru/forum10/">Программирование на языке Lua</a>. <br />
			Ух ты, какая интересная тема!<br />Так что мне теперь передавать в качестве параметра, если я хочу узнать позицию инстумента (акции, фьючерса, опциона), так что чтобы это было универсально для любого инструмента и любого брокера и танцев с бубном? <span class="bx-font" style="font-family:monospace"><B>&quot;Tx</B></span><span class="bx-font" style="font-family:monospace"><B>&quot;?</B></span><br />Я и так в QLua не силён, а тут ещё такое! Разработчики Квика, зачем вы ломаете жизнь алго-трейдерам? <br />
			<i>17.07.2026 22:20:23, Сергей Че.</i>]]></description>
			<link>http://forum.quik.ru/messages/forum10/message82861/topic8865/</link>
			<guid>http://forum.quik.ru/messages/forum10/message82861/topic8865/</guid>
			<pubDate>Fri, 17 Jul 2026 22:20:23 +0300</pubDate>
			<category>Программирование на языке Lua</category>
		</item>
		<item>
			<title>limit_kind в таблице depo_limit</title>
			<description><![CDATA[<b><a href="http://forum.quik.ru/messages/forum10/message81115/topic8865/">limit_kind в таблице depo_limit</a></b> в форуме <a href="http://forum.quik.ru/forum10/">Программирование на языке Lua</a>. <br />
			<br />====quote====<br /><a class="blog-p-user-name" id="bp_bDlgxt0w" href="/user/17142/" bx-tooltip-user-id="17142">Йцукен</a> написал:<br /> <br />====quote====<br /><noindex><a href="/user/15542/" target="_blank" rel="nofollow">Anton Belonogov</a></noindex> написал:<br />В зависимости от установленной на сервере схемы позиции учитываются либо по срокам расчетов (T0, T1), либо по датам.<br />Это взаимоисключающие параметры, сервер транслирует на терминалы только один из них<br />=============<br /> @#ять <br />=============<br />Добрый день.<br /><br />Расшифруйте пожалуйста Ваше послание. Если просто надоело у нас общаться - также просто сообщите нам об этом, поможем. <br />
			<i>02.02.2026 05:31:09, Alexey Ivannikov.</i>]]></description>
			<link>http://forum.quik.ru/messages/forum10/message81115/topic8865/</link>
			<guid>http://forum.quik.ru/messages/forum10/message81115/topic8865/</guid>
			<pubDate>Mon, 02 Feb 2026 05:31:09 +0300</pubDate>
			<category>Программирование на языке Lua</category>
		</item>
		<item>
			<title>limit_kind в таблице depo_limit</title>
			<description><![CDATA[<b><a href="http://forum.quik.ru/messages/forum10/message81075/topic8865/">limit_kind в таблице depo_limit</a></b> в форуме <a href="http://forum.quik.ru/forum10/">Программирование на языке Lua</a>. <br />
			<br />====quote====<br /><a class="blog-p-user-name" id="bp_iZEDn3Y0" href="/user/15542/" bx-tooltip-user-id="15542">Anton Belonogov</a> написал:<br />В зависимости от установленной на сервере схемы позиции учитываются либо по срокам расчетов (T0, T1), либо по датам.<br />Это взаимоисключающие параметры, сервер транслирует на терминалы только один из них<br />=============<br />@#ять <img src="http://forum.quik.ru/upload/main/smiles/5/icon_evil.png" border="0" data-code=":evil:" data-definition="SD" alt=":evil:" style="width:16px;height:16px;" title="Со злостью" class="bx-smile" /> <br />
			<i>30.01.2026 11:19:10, Йцукен.</i>]]></description>
			<link>http://forum.quik.ru/messages/forum10/message81075/topic8865/</link>
			<guid>http://forum.quik.ru/messages/forum10/message81075/topic8865/</guid>
			<pubDate>Fri, 30 Jan 2026 11:19:10 +0300</pubDate>
			<category>Программирование на языке Lua</category>
		</item>
		<item>
			<title>limit_kind в таблице depo_limit</title>
			<description><![CDATA[<b><a href="http://forum.quik.ru/messages/forum10/message79787/topic8865/">limit_kind в таблице depo_limit</a></b> в форуме <a href="http://forum.quik.ru/forum10/">Программирование на языке Lua</a>. <br />
			приходится делать работу за разрабов - это конечно уродство, когда вот так вносятся правки без какой-либо поддержки и указаний как с этим работать. Как минимум - это неуважение к своим клиентам.<br /><br />Код тестирования:<br /><br />-- Глобальные переменные для определения схемы работы<br />IS_NEW_DATE_SCHEME = nil &nbsp;-- Флаг новой схемы с датами<br />CURRENT_TRADE_DATE = nil &nbsp;-- Текущая дата торгов<br />TEST_RESULTS = {} &nbsp; &nbsp; &nbsp; &nbsp; -- Таблица для хранения результатов тестирования<br /><br />-- Константы (должны быть настроены под конкретного брокера)<br />STOCK_ACCOUNT = &quot;NL001***&quot; &nbsp;-- счет для акций<br />CLIENT_CODE = &quot;10***&quot; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; -- код клиента<br />FIRM_ID = &quot;NC00***&quot; &nbsp; &nbsp; &nbsp; &nbsp;-- код фирмы<br /><br />-- Функция записи в лог-файл<br />function WriteToLog(message)<br /> &nbsp; &nbsp;local log_file = io.open(getScriptPath()..&quot;\\quik_scheme_test.txt&quot;, &quot;a&quot;)<br /> &nbsp; &nbsp;if log_file then<br /> &nbsp; &nbsp; &nbsp; &nbsp;local timestamp = os.date(&quot;%Y-%m-%d %H:%M:%S&quot;)<br /> &nbsp; &nbsp; &nbsp; &nbsp;log_file:write(timestamp .. &quot; - &quot; .. message .. &quot;\n&quot;)<br /> &nbsp; &nbsp; &nbsp; &nbsp;log_file:close()<br /> &nbsp; &nbsp;else<br /> &nbsp; &nbsp; &nbsp; &nbsp;message(&quot;Ошибка открытия файла для записи!&quot;)<br /> &nbsp; &nbsp;end<br />end<br /><br />-- Функция определения типа схемы (новая с датами или старая)<br />function detect_scheme_type()<br /> &nbsp; &nbsp;WriteToLog(&quot;=== Начало определения типа схемы ===&quot;)<br /> &nbsp; &nbsp;<br /> &nbsp; &nbsp;local num = getNumberOf(&#39;money_limits&#39;)<br /> &nbsp; &nbsp;WriteToLog(&quot;Найдено записей в money_limits: &quot; .. tostring(num))<br /> &nbsp; &nbsp;<br /> &nbsp; &nbsp;if num &gt; 0 then<br /> &nbsp; &nbsp; &nbsp; &nbsp;for i = 0, num - 1 do<br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;local limit = getItem(&#39;money_limits&#39;, i)<br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;WriteToLog(string.format(&quot;Запись %d: limit_kind = %s, firmid = %s, client_code = %s&quot;, <br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;i, tostring(limit.limit_kind), tostring(limit.firmid), tostring(limit.client_code)))<br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;if limit.limit_kind &gt; 365 then &nbsp;-- Если значение больше 365, это новая схема с датами<br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;IS_NEW_DATE_SCHEME = true<br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;CURRENT_TRADE_DATE = tonumber(os.date(&quot;%Y%m%d&quot;))<br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;WriteToLog(&quot;Обнаружена НОВАЯ схема с датами. limit_kind = &quot; .. tostring(limit.limit_kind))<br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;WriteToLog(&quot;Текущая дата: &quot; .. tostring(CURRENT_TRADE_DATE))<br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;return<br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;end<br /> &nbsp; &nbsp; &nbsp; &nbsp;end<br /> &nbsp; &nbsp;end<br /> &nbsp; &nbsp;<br /> &nbsp; &nbsp;IS_NEW_DATE_SCHEME = false<br /> &nbsp; &nbsp;WriteToLog(&quot;Обнаружена СТАРАЯ схема с T0, T1, T2&quot;)<br />end<br /><br />-- Функция получения даты для T0, T1, T2<br />function get_settlement_date(offset)<br /> &nbsp; &nbsp;if not IS_NEW_DATE_SCHEME then<br /> &nbsp; &nbsp; &nbsp; &nbsp;WriteToLog(&quot;get_settlement_date: старая схема, возвращаем offset = &quot; .. tostring(offset))<br /> &nbsp; &nbsp; &nbsp; &nbsp;return offset<br /> &nbsp; &nbsp;end<br /> &nbsp; &nbsp;<br /> &nbsp; &nbsp;local trade_date = CURRENT_TRADE_DATE<br /> &nbsp; &nbsp;if not trade_date then<br /> &nbsp; &nbsp; &nbsp; &nbsp;trade_date = tonumber(os.date(&quot;%Y%m%d&quot;))<br /> &nbsp; &nbsp;end<br /> &nbsp; &nbsp;<br /> &nbsp; &nbsp;local result_date = trade_date + offset<br /> &nbsp; &nbsp;WriteToLog(string.format(&quot;get_settlement_date: новая схема, offset=%d, результат=%d&quot;, offset, result_date))<br /> &nbsp; &nbsp;return result_date<br />end<br /><br />-- Функция поиска позиции с учетом схемы<br />function find_limit_position(limits_table, criteria)<br /> &nbsp; &nbsp;WriteToLog(&quot;Поиск в таблице: &quot; .. limits_table)<br /> &nbsp; &nbsp;WriteToLog(&quot;Критерии поиска: &quot; .. tostring(criteria.firmid) .. &quot;, &quot; .. tostring(criteria.client_code))<br /> &nbsp; &nbsp;<br /> &nbsp; &nbsp;local num = getNumberOf(limits_table)<br /> &nbsp; &nbsp;WriteToLog(&quot;Количество записей в таблице: &quot; .. tostring(num))<br /> &nbsp; &nbsp;<br /> &nbsp; &nbsp;if num &lt;= 0 then <br /> &nbsp; &nbsp; &nbsp; &nbsp;WriteToLog(&quot;Таблица пуста&quot;)<br /> &nbsp; &nbsp; &nbsp; &nbsp;return nil <br /> &nbsp; &nbsp;end<br /> &nbsp; &nbsp;<br /> &nbsp; &nbsp;if IS_NEW_DATE_SCHEME then<br /> &nbsp; &nbsp; &nbsp; &nbsp;WriteToLog(&quot;Поиск в НОВОЙ схеме (по максимальной дате)&quot;)<br /> &nbsp; &nbsp; &nbsp; &nbsp;local best_match = nil<br /> &nbsp; &nbsp; &nbsp; &nbsp;local max_date = 0<br /> &nbsp; &nbsp; &nbsp; &nbsp;<br /> &nbsp; &nbsp; &nbsp; &nbsp;for i = 0, num - 1 do<br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;local item = getItem(limits_table, i)<br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;local matches = true<br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;for key, value in pairs(criteria) do<br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;if key ~= &#39;limit_kind&#39; and item&#91;key&#93; ~= value then<br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;matches = false<br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;break<br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;end<br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;end<br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;if matches then<br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;WriteToLog(string.format(&quot;Найдена подходящая запись: limit_kind=%d, currentbal=%s&quot;, <br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;item.limit_kind, tostring(item.currentbal)))<br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;if item.limit_kind &gt; max_date then<br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;max_date = item.limit_kind<br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;best_match = item<br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;end<br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;end<br /> &nbsp; &nbsp; &nbsp; &nbsp;end<br /> &nbsp; &nbsp; &nbsp; &nbsp;<br /> &nbsp; &nbsp; &nbsp; &nbsp;if best_match then<br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;WriteToLog(&quot;Выбрана запись с максимальной датой: &quot; .. tostring(max_date))<br /> &nbsp; &nbsp; &nbsp; &nbsp;else<br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;WriteToLog(&quot;Подходящих записей не найдено&quot;)<br /> &nbsp; &nbsp; &nbsp; &nbsp;end<br /> &nbsp; &nbsp; &nbsp; &nbsp;<br /> &nbsp; &nbsp; &nbsp; &nbsp;return best_match<br /> &nbsp; &nbsp;else<br /> &nbsp; &nbsp; &nbsp; &nbsp;WriteToLog(&quot;Поиск в СТАРОЙ схеме (точное соответствие)&quot;)<br /> &nbsp; &nbsp; &nbsp; &nbsp;for i = 0, num - 1 do<br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;local item = getItem(limits_table, i)<br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;local matches = true<br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;for key, value in pairs(criteria) do<br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;if item&#91;key&#93; ~= value then<br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;matches = false<br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;break<br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;end<br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;end<br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;if matches then<br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;WriteToLog(&quot;Найдена точная запись: limit_kind=&quot; .. tostring(item.limit_kind))<br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;return item<br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;end<br /> &nbsp; &nbsp; &nbsp; &nbsp;end<br /> &nbsp; &nbsp;end<br /> &nbsp; &nbsp;<br /> &nbsp; &nbsp;WriteToLog(&quot;Запись не найдена&quot;)<br /> &nbsp; &nbsp;return nil<br />end<br /><br />-- Обновленная функция получения доступных средств<br />function GetFreeMoney()<br /> &nbsp; &nbsp;WriteToLog(&quot;=== Вызов GetFreeMoney() ===&quot;)<br /> &nbsp; &nbsp;WriteToLog(&quot;CLASS_CODE: &quot; .. tostring(CLASS_CODE))<br /> &nbsp; &nbsp;<br /> &nbsp; &nbsp;-- Определяем схему при первом вызове<br /> &nbsp; &nbsp;if IS_NEW_DATE_SCHEME == nil then<br /> &nbsp; &nbsp; &nbsp; &nbsp;detect_scheme_type()<br /> &nbsp; &nbsp;end<br /> &nbsp; &nbsp;<br /> &nbsp; &nbsp;if CLASS_CODE == &#39;SPBFUT&#39; or CLASS_CODE == &#39;SPBOPT&#39; then<br /> &nbsp; &nbsp; &nbsp; &nbsp;WriteToLog(&quot;Обработка срочного рынка&quot;)<br /> &nbsp; &nbsp; &nbsp; &nbsp;local num = getNumberOf(&#39;futures_client_limits&#39;)<br /> &nbsp; &nbsp; &nbsp; &nbsp;WriteToLog(&quot;Записей в futures_client_limits: &quot; .. tostring(num))<br /> &nbsp; &nbsp; &nbsp; &nbsp;<br /> &nbsp; &nbsp; &nbsp; &nbsp;if num &gt; 0 then<br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;for i = 0, num - 1 do<br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;local limit = getItem(&#39;futures_client_limits&#39;, i)<br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;if limit.firmid == FIRM_ID and limit.trdaccid == STOCK_ACCOUNT and limit.limit_type == 0 then<br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;WriteToLog(&quot;Найдены средства срочного рынка: &quot; .. tostring(limit.cbplplanned))<br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;return limit.cbplplanned<br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;end<br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;end<br /> &nbsp; &nbsp; &nbsp; &nbsp;end<br /> &nbsp; &nbsp;elseif CLASS_CODE == &#39;TQBR&#39; or CLASS_CODE == &#39;QJSIM&#39; or CLASS_CODE == &#39;CETS&#39; then<br /> &nbsp; &nbsp; &nbsp; &nbsp;WriteToLog(&quot;Обработка фондового рынка&quot;)<br /> &nbsp; &nbsp; &nbsp; &nbsp;local criteria = {<br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;currcode = &#39;SUR&#39;,<br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;firmid = FIRM_ID,<br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;client_code = CLIENT_CODE<br /> &nbsp; &nbsp; &nbsp; &nbsp;}<br /> &nbsp; &nbsp; &nbsp; &nbsp;<br /> &nbsp; &nbsp; &nbsp; &nbsp;if IS_NEW_DATE_SCHEME then<br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;WriteToLog(&quot;Поиск в НОВОЙ схеме&quot;)<br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;criteria.limit_kind = 0<br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;local limit = find_limit_position(&#39;money_limits&#39;, criteria)<br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;if limit then<br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;WriteToLog(&quot;Найдены средства: &quot; .. tostring(limit.currentbal))<br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;return limit.currentbal<br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;end<br /> &nbsp; &nbsp; &nbsp; &nbsp;else<br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;WriteToLog(&quot;Поиск в СТАРОЙ схеме&quot;)<br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;criteria.limit_kind = 0<br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;local limit = find_limit_position(&#39;money_limits&#39;, criteria)<br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;if limit then<br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;WriteToLog(&quot;Найдены средства: &quot; .. tostring(limit.currentbal))<br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;return limit.currentbal<br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;end<br /> &nbsp; &nbsp; &nbsp; &nbsp;end<br /> &nbsp; &nbsp;else<br /> &nbsp; &nbsp; &nbsp; &nbsp;WriteToLog(&quot;Неизвестный CLASS_CODE: &quot; .. tostring(CLASS_CODE))<br /> &nbsp; &nbsp;end<br /> &nbsp; &nbsp;<br /> &nbsp; &nbsp;WriteToLog(&quot;Средства не найдены, возвращаем 0&quot;)<br /> &nbsp; &nbsp;return 0<br />end<br /><br />-- Функция тестирования различных CLASS_CODE<br />function TestDifferentMarkets()<br /> &nbsp; &nbsp;WriteToLog(&quot;\n=== Тестирование различных рынков ===&quot;)<br /> &nbsp; &nbsp;<br /> &nbsp; &nbsp;-- Тестируем фондовый рынок<br /> &nbsp; &nbsp;CLASS_CODE = &#39;TQBR&#39;<br /> &nbsp; &nbsp;local stock_money = GetFreeMoney()<br /> &nbsp; &nbsp;table.insert(TEST_RESULTS, {market = &quot;Фондовый рынок (TQBR)&quot;, money = stock_money})<br /> &nbsp; &nbsp;<br /> &nbsp; &nbsp;-- Тестируем срочный рынок<br /> &nbsp; &nbsp;CLASS_CODE = &#39;SPBFUT&#39; <br /> &nbsp; &nbsp;local futures_money = GetFreeMoney()<br /> &nbsp; &nbsp;table.insert(TEST_RESULTS, {market = &quot;Срочный рынок (SPBFUT)&quot;, money = futures_money})<br /> &nbsp; &nbsp;<br /> &nbsp; &nbsp;-- Тестируем валютный рынок<br /> &nbsp; &nbsp;CLASS_CODE = &#39;CETS&#39;<br /> &nbsp; &nbsp;local currency_money = GetFreeMoney()<br /> &nbsp; &nbsp;table.insert(TEST_RESULTS, {market = &quot;Валютный рынок (CETS)&quot;, money = currency_money})<br />end<br /><br />-- Функция анализа таблиц лимитов<br />function AnalyzeLimitTables()<br /> &nbsp; &nbsp;WriteToLog(&quot;\n=== Анализ таблиц лимитов ===&quot;)<br /> &nbsp; &nbsp;<br /> &nbsp; &nbsp;-- Анализ money_limits<br /> &nbsp; &nbsp;local money_limits_count = getNumberOf(&#39;money_limits&#39;)<br /> &nbsp; &nbsp;WriteToLog(&quot;money_limits записей: &quot; .. tostring(money_limits_count))<br /> &nbsp; &nbsp;<br /> &nbsp; &nbsp;if money_limits_count &gt; 0 then<br /> &nbsp; &nbsp; &nbsp; &nbsp;for i = 0, math.min(money_limits_count-1, 10) do &nbsp;-- Ограничим вывод первыми 10 записями<br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;local limit = getItem(&#39;money_limits&#39;, i)<br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;WriteToLog(string.format(&quot;money_limits&#91;%d&#93;: firmid=%s, client_code=%s, limit_kind=%s, currentbal=%s&quot;, <br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;i, tostring(limit.firmid), tostring(limit.client_code), <br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;tostring(limit.limit_kind), tostring(limit.currentbal)))<br /> &nbsp; &nbsp; &nbsp; &nbsp;end<br /> &nbsp; &nbsp;end<br /> &nbsp; &nbsp;<br /> &nbsp; &nbsp;-- Анализ depo_limits<br /> &nbsp; &nbsp;local depo_limits_count = getNumberOf(&#39;depo_limits&#39;)<br /> &nbsp; &nbsp;WriteToLog(&quot;depo_limits записей: &quot; .. tostring(depo_limits_count))<br /> &nbsp; &nbsp;<br /> &nbsp; &nbsp;if depo_limits_count &gt; 0 then<br /> &nbsp; &nbsp; &nbsp; &nbsp;for i = 0, math.min(depo_limits_count-1, 5) do &nbsp;-- Ограничим вывод первыми 5 записями<br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;local limit = getItem(&#39;depo_limits&#39;, i)<br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;WriteToLog(string.format(&quot;depo_limits&#91;%d&#93;: firmid=%s, client_code=%s, sec_code=%s, limit_kind=%s, currentbal=%s&quot;, <br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;i, tostring(limit.firmid), tostring(limit.client_code), <br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;tostring(limit.sec_code), tostring(limit.limit_kind), tostring(limit.currentbal)))<br /> &nbsp; &nbsp; &nbsp; &nbsp;end<br /> &nbsp; &nbsp;end<br />end<br /><br />-- Основная функция<br />function main()<br /> &nbsp; &nbsp;WriteToLog(&quot;====== ЗАПУСК ТЕСТИРОВАНИЯ СХЕМЫ QUIK ======&quot;)<br /> &nbsp; &nbsp;WriteToLog(&quot;Версия скрипта: 1.0&quot;)<br /> &nbsp; &nbsp;WriteToLog(&quot;Дата тестирования: &quot; .. os.date(&quot;%Y-%m-%d %H:%M:%S&quot;))<br /> &nbsp; &nbsp;<br /> &nbsp; &nbsp;-- Инициализация<br /> &nbsp; &nbsp;detect_scheme_type()<br /> &nbsp; &nbsp;<br /> &nbsp; &nbsp;-- Анализ таблиц<br /> &nbsp; &nbsp;AnalyzeLimitTables()<br /> &nbsp; &nbsp;<br /> &nbsp; &nbsp;-- Тестирование различных рынков<br /> &nbsp; &nbsp;TestDifferentMarkets()<br /> &nbsp; &nbsp;<br /> &nbsp; &nbsp;-- Вывод результатов<br /> &nbsp; &nbsp;WriteToLog(&quot;\n=== ИТОГОВЫЕ РЕЗУЛЬТАТЫ ===&quot;)<br /> &nbsp; &nbsp;WriteToLog(&quot;Тип схемы: &quot; .. (IS_NEW_DATE_SCHEME and &quot;НОВАЯ (по датам)&quot; or &quot;СТАРАЯ (T0,T1,T2)&quot;))<br /> &nbsp; &nbsp;<br /> &nbsp; &nbsp;for _, result in ipairs(TEST_RESULTS) do<br /> &nbsp; &nbsp; &nbsp; &nbsp;WriteToLog(string.format(&quot;%s: %s&quot;, result.market, tostring(result.money)))<br /> &nbsp; &nbsp;end<br /> &nbsp; &nbsp;<br /> &nbsp; &nbsp;WriteToLog(&quot;\n=== РЕКОМЕНДАЦИИ ===&quot;)<br /> &nbsp; &nbsp;if IS_NEW_DATE_SCHEME then<br /> &nbsp; &nbsp; &nbsp; &nbsp;WriteToLog(&quot;1. Используйте функции поиска по максимальной дате&quot;)<br /> &nbsp; &nbsp; &nbsp; &nbsp;WriteToLog(&quot;2. Обновите все скрипты для работы с новой схемой&quot;)<br /> &nbsp; &nbsp; &nbsp; &nbsp;WriteToLog(&quot;3. Тестируйте на QUIK Junior для адаптации&quot;)<br /> &nbsp; &nbsp;else<br /> &nbsp; &nbsp; &nbsp; &nbsp;WriteToLog(&quot;1. Брокер использует классическую схему&quot;)<br /> &nbsp; &nbsp; &nbsp; &nbsp;WriteToLog(&quot;2. Готовьтесь к возможному переходу на новую схему&quot;)<br /> &nbsp; &nbsp; &nbsp; &nbsp;WriteToLog(&quot;3. Протестируйте скрипты на QUIK Junior&quot;)<br /> &nbsp; &nbsp;end<br /> &nbsp; &nbsp;<br /> &nbsp; &nbsp;WriteToLog(&quot;====== ТЕСТИРОВАНИЕ ЗАВЕРШЕНО ======\n&quot;)<br /> &nbsp; &nbsp;<br /> &nbsp; &nbsp;message(&quot;Тестирование завершено. Результаты в файле quik_scheme_test.txt&quot;)<br />end<br /><br />-- Очистка файла при каждом запуске<br />local init_file = io.open(getScriptPath()..&quot;\\quik_scheme_test.txt&quot;, &quot;w&quot;)<br />if init_file then<br /> &nbsp; &nbsp;init_file:write(&quot;&quot;)<br /> &nbsp; &nbsp;init_file:close()<br />end<br /><br />-- Запуск основной функции<br />main() <br />
			<i>13.10.2025 19:39:34, profnight.</i>]]></description>
			<link>http://forum.quik.ru/messages/forum10/message79787/topic8865/</link>
			<guid>http://forum.quik.ru/messages/forum10/message79787/topic8865/</guid>
			<pubDate>Mon, 13 Oct 2025 19:39:34 +0300</pubDate>
			<category>Программирование на языке Lua</category>
		</item>
		<item>
			<title>limit_kind в таблице depo_limit</title>
			<description><![CDATA[<b><a href="http://forum.quik.ru/messages/forum10/message79784/topic8865/">limit_kind в таблице depo_limit</a></b> в форуме <a href="http://forum.quik.ru/forum10/">Программирование на языке Lua</a>. <br />
			<br />====quote====<br /><a class="blog-p-user-name" id="bp_eGULJOOv" href="/user/12743/" bx-tooltip-user-id="12743">Андрей</a> написал:<br /> <br />====quote====<br />Андрей, если не сложно, поделитесь скриптом, а то уже кучу времени убил на правки и высказал кучу матов в адрес разрабов, а толку пока нет. <br />Спасибо!<br /><br />=============<br /> Скрипт написал, тестирую, но тут опять незадача...Почему в демократии QUIK запрещен short акций? Всех! &nbsp;<br />=============<br /> <br />
			<i>13.10.2025 17:21:50, profnight.</i>]]></description>
			<link>http://forum.quik.ru/messages/forum10/message79784/topic8865/</link>
			<guid>http://forum.quik.ru/messages/forum10/message79784/topic8865/</guid>
			<pubDate>Mon, 13 Oct 2025 17:21:50 +0300</pubDate>
			<category>Программирование на языке Lua</category>
		</item>
		<item>
			<title>limit_kind в таблице depo_limit</title>
			<description><![CDATA[<b><a href="http://forum.quik.ru/messages/forum10/message78870/topic8865/">limit_kind в таблице depo_limit</a></b> в форуме <a href="http://forum.quik.ru/forum10/">Программирование на языке Lua</a>. <br />
			<a class="blog-p-user-name" id="bp_q33OtQBf" href="/user/12743/" bx-tooltip-user-id="12743">Андрей</a>, добрый день.<br /><br />На сервере QUIK-Junior доступно осуществление операций шорт по некоторым акциям, в том числе SBER - см. таблицу &quot;Купить/Продать&quot; (открывается двойным нажатием по строке в таблице &quot;Клиентский портфель&quot;), поле &quot;Продажа&quot;.<br /><br />Если при попытке продать какой-либо инструмент из этого списка Вы получаете ошибку, просим прислать ее скриншот. <br />
			<i>16.06.2025 06:50:30, Anton Belonogov.</i>]]></description>
			<link>http://forum.quik.ru/messages/forum10/message78870/topic8865/</link>
			<guid>http://forum.quik.ru/messages/forum10/message78870/topic8865/</guid>
			<pubDate>Mon, 16 Jun 2025 06:50:30 +0300</pubDate>
			<category>Программирование на языке Lua</category>
		</item>
		<item>
			<title>limit_kind в таблице depo_limit</title>
			<description><![CDATA[<b><a href="http://forum.quik.ru/messages/forum10/message78869/topic8865/">limit_kind в таблице depo_limit</a></b> в форуме <a href="http://forum.quik.ru/forum10/">Программирование на языке Lua</a>. <br />
			<a class="blog-p-user-name" id="bp_hA4rX4W1" href="/user/13952/" bx-tooltip-user-id="13952">TGB</a>, добрый день.<br /><br /> <br />====quote====<br />Пожалуйста, объясните какие проблемы возникают у брокера и пользователя, если дополнительно к тому как было (limit_kind - &quot;Режим торгов&quot;) транслировалось бы поле (возможно пустое) &quot;Дата предстоящих расчетов&quot;?<br />=============<br />Повторим, в разрезе позиций на сервере эти параметры - взаимоисключающие, для позиции может быть установлен только один из них.<br />Такова особенность архитектуры системы QUIK, более развернутый комментарий мы не можем предоставить. <br />
			<i>16.06.2025 06:49:58, Anton Belonogov.</i>]]></description>
			<link>http://forum.quik.ru/messages/forum10/message78869/topic8865/</link>
			<guid>http://forum.quik.ru/messages/forum10/message78869/topic8865/</guid>
			<pubDate>Mon, 16 Jun 2025 06:49:58 +0300</pubDate>
			<category>Программирование на языке Lua</category>
		</item>
		<item>
			<title>limit_kind в таблице depo_limit</title>
			<description><![CDATA[<b><a href="http://forum.quik.ru/messages/forum10/message78867/topic8865/">limit_kind в таблице depo_limit</a></b> в форуме <a href="http://forum.quik.ru/forum10/">Программирование на языке Lua</a>. <br />
			* в демо версии &nbsp; <br />
			<i>11.06.2025 22:07:31, Андрей.</i>]]></description>
			<link>http://forum.quik.ru/messages/forum10/message78867/topic8865/</link>
			<guid>http://forum.quik.ru/messages/forum10/message78867/topic8865/</guid>
			<pubDate>Wed, 11 Jun 2025 22:07:31 +0300</pubDate>
			<category>Программирование на языке Lua</category>
		</item>
		<item>
			<title>limit_kind в таблице depo_limit</title>
			<description><![CDATA[<b><a href="http://forum.quik.ru/messages/forum10/message78866/topic8865/">limit_kind в таблице depo_limit</a></b> в форуме <a href="http://forum.quik.ru/forum10/">Программирование на языке Lua</a>. <br />
			<br />====quote====<br /><br />Рекомендуем протестировать Ваши скрипты на сервере QUIK-Junior - получить доступ можно &nbsp;<noindex><a href="https://arqatech.com/ru/support/demo/" target="_blank" rel="nofollow">по ссылке</a></noindex> .<br />=============<br />Скрипт написал, тестирую, но тут опять незадача...Почему в демократии QUIK запрещен short акций? Всех! &nbsp; <br />
			<i>11.06.2025 22:06:48, Андрей.</i>]]></description>
			<link>http://forum.quik.ru/messages/forum10/message78866/topic8865/</link>
			<guid>http://forum.quik.ru/messages/forum10/message78866/topic8865/</guid>
			<pubDate>Wed, 11 Jun 2025 22:06:48 +0300</pubDate>
			<category>Программирование на языке Lua</category>
		</item>
		<item>
			<title>limit_kind в таблице depo_limit</title>
			<description><![CDATA[<b><a href="http://forum.quik.ru/messages/forum10/message78859/topic8865/">limit_kind в таблице depo_limit</a></b> в форуме <a href="http://forum.quik.ru/forum10/">Программирование на языке Lua</a>. <br />
			<br />====quote====<br /><a class="blog-p-user-name" id="bp_sw24NS74" href="/user/15542/" bx-tooltip-user-id="15542">Anton Belonogov</a> написал:<br />Это взаимоисключающие параметры, сервер транслирует на терминалы только один из них, поэтому смысла в дополнительном параметре для QLua нет.<br />=============<br /> &nbsp; Не согласен. Разве &nbsp;"Дата предстоящих расчетов" рассчитывается без учета "Режима торгов"?<br />Пожалуйста, объясните какие проблемы возникают у брокера и пользователя, если дополнительно к тому как было (limit_kind - "Режим торгов") транслировалось бы поле (возможно пустое) "Дата предстоящих расчетов"? Может быть разработчик не стал создавать новое поле с целью большой экономии памяти <img src="http://forum.quik.ru/upload/main/smiles/5/icon_smile.png" border="0" data-code=":smile:" data-definition="SD" alt=":smile:" style="width:16px;height:16px;" title="С улыбкой" class="bx-smile" /> ? <br />
			<i>11.06.2025 07:14:07, TGB.</i>]]></description>
			<link>http://forum.quik.ru/messages/forum10/message78859/topic8865/</link>
			<guid>http://forum.quik.ru/messages/forum10/message78859/topic8865/</guid>
			<pubDate>Wed, 11 Jun 2025 07:14:07 +0300</pubDate>
			<category>Программирование на языке Lua</category>
		</item>
		<item>
			<title>limit_kind в таблице depo_limit</title>
			<description><![CDATA[<b><a href="http://forum.quik.ru/messages/forum10/message78856/topic8865/">limit_kind в таблице depo_limit</a></b> в форуме <a href="http://forum.quik.ru/forum10/">Программирование на языке Lua</a>. <br />
			<a class="blog-p-user-name" id="bp_NkWkwPa8" href="/user/12743/" bx-tooltip-user-id="12743">Андрей</a>, добрый день.<br /><br /><br />====quote====<br /><a class="blog-p-user-name" id="bp_5flYmnI1" href="/user/12743/" bx-tooltip-user-id="12743">Андрей</a> написал:<br />как узнать какую схему использует какой брокер?<br />=============<br />Это можно узнать по limit_kind на позициях: если включена схема ведения позиций по календарным датам, limit_kind будет иметь вид YYYYMMDD, в противном случае, при использовании старой схемы - 0, 1, 2, 365.<br /><br /><br />====quote====<br /><a class="blog-p-user-name" id="bp_KGkPJrZA" href="/user/12743/" bx-tooltip-user-id="12743">Андрей</a> написал:<br />У меня 3 брокера и если они будут использовать разные схемы мне писать обработку для каждого брокера?<br />=============<br />Верно.<br /><br />Мы не можем предусмотреть все сценарии использования QLua, и у нас нет примеров для каждого возможного алгоритма.<br />По этой причине на Учебном сервере QUIK-Junior было включено ведение позиций в календарных датах, чтобы пользователи могли протестировать работу в новом режиме и подготовиться к аналогичным изменениям, если они произойдут на сервере брокера.<br /><br />Рекомендуем протестировать Ваши скрипты на сервере QUIK-Junior - получить доступ можно <noindex><a href="https://arqatech.com/ru/support/demo/" target="_blank" rel="nofollow">по ссылке</a></noindex>. <br />
			<i>10.06.2025 05:45:22, Anton Belonogov.</i>]]></description>
			<link>http://forum.quik.ru/messages/forum10/message78856/topic8865/</link>
			<guid>http://forum.quik.ru/messages/forum10/message78856/topic8865/</guid>
			<pubDate>Tue, 10 Jun 2025 05:45:22 +0300</pubDate>
			<category>Программирование на языке Lua</category>
		</item>
		<item>
			<title>limit_kind в таблице depo_limit</title>
			<description><![CDATA[<b><a href="http://forum.quik.ru/messages/forum10/message78855/topic8865/">limit_kind в таблице depo_limit</a></b> в форуме <a href="http://forum.quik.ru/forum10/">Программирование на языке Lua</a>. <br />
			Было бы прекрасно, если бы вы привели пример кода, как посмотреть открытые позиции по каждому инструменту на дату Т0, Т1, Т2 с учетом того, что брокеры могут использовать различные схемы. &nbsp; <br />
			<i>09.06.2025 23:34:18, Андрей.</i>]]></description>
			<link>http://forum.quik.ru/messages/forum10/message78855/topic8865/</link>
			<guid>http://forum.quik.ru/messages/forum10/message78855/topic8865/</guid>
			<pubDate>Mon, 09 Jun 2025 23:34:18 +0300</pubDate>
			<category>Программирование на языке Lua</category>
		</item>
		<item>
			<title>limit_kind в таблице depo_limit</title>
			<description><![CDATA[<b><a href="http://forum.quik.ru/messages/forum10/message78854/topic8865/">limit_kind в таблице depo_limit</a></b> в форуме <a href="http://forum.quik.ru/forum10/">Программирование на языке Lua</a>. <br />
			И как узнать какую схему использует какой брокер? Есть признак хотя бы??? <br />
			<i>09.06.2025 23:21:03, Андрей.</i>]]></description>
			<link>http://forum.quik.ru/messages/forum10/message78854/topic8865/</link>
			<guid>http://forum.quik.ru/messages/forum10/message78854/topic8865/</guid>
			<pubDate>Mon, 09 Jun 2025 23:21:03 +0300</pubDate>
			<category>Программирование на языке Lua</category>
		</item>
		<item>
			<title>limit_kind в таблице depo_limit</title>
			<description><![CDATA[<b><a href="http://forum.quik.ru/messages/forum10/message78853/topic8865/">limit_kind в таблице depo_limit</a></b> в форуме <a href="http://forum.quik.ru/forum10/">Программирование на языке Lua</a>. <br />
			<br />====quote====<br /><a class="blog-p-user-name" id="bp_bZvH80Ab" href="/user/15542/" bx-tooltip-user-id="15542">Anton Belonogov</a> написал:<br /><noindex><a href="/user/13952/" target="_blank" rel="nofollow">TGB</a></noindex>, добрый день.<br /><br />В зависимости от установленной на сервере схемы позиции учитываются либо по срокам расчетов (T0, T1), либо по датам.<br />Это взаимоисключающие параметры, сервер транслирует на терминалы только один из них, поэтому смысла в дополнительном параметре для QLua нет.<br />=============<br />А как писать код, чтобы он работал на разных брокерах? У меня 3 брокера и если они будут использовать разные схемы мне писать обработку для каждого брокера???<br />За что вы так не любите своих пользователей??? &nbsp; <br />
			<i>09.06.2025 23:20:00, Андрей.</i>]]></description>
			<link>http://forum.quik.ru/messages/forum10/message78853/topic8865/</link>
			<guid>http://forum.quik.ru/messages/forum10/message78853/topic8865/</guid>
			<pubDate>Mon, 09 Jun 2025 23:20:00 +0300</pubDate>
			<category>Программирование на языке Lua</category>
		</item>
		<item>
			<title>limit_kind в таблице depo_limit</title>
			<description><![CDATA[<b><a href="http://forum.quik.ru/messages/forum10/message78842/topic8865/">limit_kind в таблице depo_limit</a></b> в форуме <a href="http://forum.quik.ru/forum10/">Программирование на языке Lua</a>. <br />
			<a class="blog-p-user-name" id="bp_a9Bz6r8F" href="/user/13952/" bx-tooltip-user-id="13952">TGB</a>, добрый день.<br /><br />В зависимости от установленной на сервере схемы позиции учитываются либо по срокам расчетов (T0, T1), либо по датам.<br />Это взаимоисключающие параметры, сервер транслирует на терминалы только один из них, поэтому смысла в дополнительном параметре для QLua нет. <br />
			<i>09.06.2025 11:22:50, Anton Belonogov.</i>]]></description>
			<link>http://forum.quik.ru/messages/forum10/message78842/topic8865/</link>
			<guid>http://forum.quik.ru/messages/forum10/message78842/topic8865/</guid>
			<pubDate>Mon, 09 Jun 2025 11:22:50 +0300</pubDate>
			<category>Программирование на языке Lua</category>
		</item>
		<item>
			<title>limit_kind в таблице depo_limit</title>
			<description><![CDATA[<b><a href="http://forum.quik.ru/messages/forum10/message78831/topic8865/">limit_kind в таблице depo_limit</a></b> в форуме <a href="http://forum.quik.ru/forum10/">Программирование на языке Lua</a>. <br />
			<br />====quote====<br /><a class="blog-p-user-name" id="bp_3CqXHXUC" href="/user/13952/" bx-tooltip-user-id="13952">TGB</a> написал:<br />"Дату предстоящих торгов"<br />=============<br /> &nbsp; Читать: "Дату предстоящих расчетов" <br />
			<i>06.06.2025 08:24:51, TGB.</i>]]></description>
			<link>http://forum.quik.ru/messages/forum10/message78831/topic8865/</link>
			<guid>http://forum.quik.ru/messages/forum10/message78831/topic8865/</guid>
			<pubDate>Fri, 06 Jun 2025 08:24:51 +0300</pubDate>
			<category>Программирование на языке Lua</category>
		</item>
		<item>
			<title>limit_kind в таблице depo_limit</title>
			<description><![CDATA[<b><a href="http://forum.quik.ru/messages/forum10/message78830/topic8865/">limit_kind в таблице depo_limit</a></b> в форуме <a href="http://forum.quik.ru/forum10/">Программирование на языке Lua</a>. <br />
			<br />====quote====<br /><a class="blog-p-user-name" id="bp_JoEWrZWh" href="/user/15542/" bx-tooltip-user-id="15542">Anton Belonogov</a> написал:<br />limit_kind - это параметр позиции на сервере QUIK, а не параметр инструмента в Торговой системе.Торговые режимы остаются прежними, изменяется только ведение позиций на сервере, что позволяет для каждой позиции видеть даты предстоящих расчетов.<br />=============<br /> &nbsp;Почему бы не оставить в покое limit_kind (как было)? В чем была проблема завести новое поле "Дату предстоящих торгов"? <br />
			<i>06.06.2025 08:18:52, TGB.</i>]]></description>
			<link>http://forum.quik.ru/messages/forum10/message78830/topic8865/</link>
			<guid>http://forum.quik.ru/messages/forum10/message78830/topic8865/</guid>
			<pubDate>Fri, 06 Jun 2025 08:18:52 +0300</pubDate>
			<category>Программирование на языке Lua</category>
		</item>
		<item>
			<title>limit_kind в таблице depo_limit</title>
			<description><![CDATA[<b><a href="http://forum.quik.ru/messages/forum10/message78010/topic8865/">limit_kind в таблице depo_limit</a></b> в форуме <a href="http://forum.quik.ru/forum10/">Программирование на языке Lua</a>. <br />
			<a class="blog-p-user-name" id="bp_4IuxQovs" href="/user/3132/" bx-tooltip-user-id="3132">Nikolay</a>, добрый день.<br /><br /><br />====quote====<br />limit_kind - это режим торгов инструмента, он задан в его спецификации и не изменится в течении торговой сессии.<br />=============<br />limit_kind - это параметр позиции на сервере QUIK, а не параметр инструмента в Торговой системе.<br /><br />Торговые режимы остаются прежними, изменяется только ведение позиций на сервере, что позволяет для каждой позиции видеть даты предстоящих расчетов. <br />
			<i>04.03.2025 19:13:18, Anton Belonogov.</i>]]></description>
			<link>http://forum.quik.ru/messages/forum10/message78010/topic8865/</link>
			<guid>http://forum.quik.ru/messages/forum10/message78010/topic8865/</guid>
			<pubDate>Tue, 04 Mar 2025 19:13:18 +0300</pubDate>
			<category>Программирование на языке Lua</category>
		</item>
		<item>
			<title>limit_kind в таблице depo_limit</title>
			<description><![CDATA[<b><a href="http://forum.quik.ru/messages/forum10/message77892/topic8865/">limit_kind в таблице depo_limit</a></b> в форуме <a href="http://forum.quik.ru/forum10/">Программирование на языке Lua</a>. <br />
			<br />====quote====<br /><a class="blog-p-user-name" id="bp_HdvtSsKD" href="/user/3132/" bx-tooltip-user-id="3132">Nikolay</a> написал:<br />limit_kind - это режим торгов инструмента<br />=============<br /> &nbsp; Присоединяюсь: Дата расчета это не режим торгов. <br />
			<i>25.02.2025 09:28:15, TGB.</i>]]></description>
			<link>http://forum.quik.ru/messages/forum10/message77892/topic8865/</link>
			<guid>http://forum.quik.ru/messages/forum10/message77892/topic8865/</guid>
			<pubDate>Tue, 25 Feb 2025 09:28:15 +0300</pubDate>
			<category>Программирование на языке Lua</category>
		</item>
		<item>
			<title>limit_kind в таблице depo_limit</title>
			<description><![CDATA[<b><a href="http://forum.quik.ru/messages/forum10/message77889/topic8865/">limit_kind в таблице depo_limit</a></b> в форуме <a href="http://forum.quik.ru/forum10/">Программирование на языке Lua</a>. <br />
			Речь о поведении данных в таблице money_limits поле limit_kind. Вы предложили реализацию через перебор данных и поиск максимального. Такой подход возможен, да. Но возникает вопрос - почему вносимые изменения потребовали использования такого подхода.<br /><br />limit_kind - это режим торгов инструмента, он задан в его спецификации и не изменится в течении торговой сессии. Наоборот, это достаточно постоянный параметр. То что дата расчётов в связи с выходными может быть дальше, не означает, что необходимо теперь переходить на хранение даты. То что в течении торговой сессии произошли с сделки с инструментом, не означает, что его режим торгов изменится. Он как был Т+1, так и остался. Просто позиция будет той же завтра, если нет сделок, не более. Сейчас же происходит замечательная вещь - нет сделок, получаем режим торгов Т+0 (текущая дата), совершили сделки, получаем Т+1 (следующая дата). Т.е. можно было бы добавить дату расчётов в таблицу, чтобы знать когда произойдут взаиморасчёты, но базовый фильтр limit_kind почему был изменён - совершенно не ясно. Это не дата расчётов. С этим можно было жить как раньше, если бы он не изменялся в течении торгов, но и это не так. Теперь действительно необходимо постоянно сканировать на поиск максимального значения. <br />
			<i>25.02.2025 08:38:44, Nikolay.</i>]]></description>
			<link>http://forum.quik.ru/messages/forum10/message77889/topic8865/</link>
			<guid>http://forum.quik.ru/messages/forum10/message77889/topic8865/</guid>
			<pubDate>Tue, 25 Feb 2025 08:38:44 +0300</pubDate>
			<category>Программирование на языке Lua</category>
		</item>
		<item>
			<title>limit_kind в таблице depo_limit</title>
			<description><![CDATA[<b><a href="http://forum.quik.ru/messages/forum10/message77888/topic8865/">limit_kind в таблице depo_limit</a></b> в форуме <a href="http://forum.quik.ru/forum10/">Программирование на языке Lua</a>. <br />
			<a class="blog-p-user-name" id="bp_JkD9s3b7" href="/user/3132/" bx-tooltip-user-id="3132">Nikolay</a>, добрый день.<br /><br />Речь идет об использовании функций, которые мы приводили выше, или о запуске какого-то другого кода? <br />
			<i>25.02.2025 06:15:30, Anton Belonogov.</i>]]></description>
			<link>http://forum.quik.ru/messages/forum10/message77888/topic8865/</link>
			<guid>http://forum.quik.ru/messages/forum10/message77888/topic8865/</guid>
			<pubDate>Tue, 25 Feb 2025 06:15:30 +0300</pubDate>
			<category>Программирование на языке Lua</category>
		</item>
	</channel>
</rss>
