<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
	<channel>
		<title>Форум QUIK [тема: Данные по бумагам в портфеле скриптом lua]</title>
		<link>http://forum.quik.ru</link>
		<description>Новое в теме Данные по бумагам в портфеле скриптом lua форума  на сайте Форум QUIK [forum.quik.ru]</description>
		<language>ru</language>
		<docs>http://backend.userland.com/rss2</docs>
		<pubDate>Fri, 17 Apr 2026 11:30:53 +0300</pubDate>
		<item>
			<title>Данные по бумагам в портфеле скриптом lua</title>
			<description><![CDATA[<b><a href="http://forum.quik.ru/messages/forum10/message76737/topic8714/">Данные по бумагам в портфеле скриптом lua</a></b> <i>Данные по бумагам в портфеле скриптом lua</i> в форуме <a href="http://forum.quik.ru/forum10/">Программирование на языке Lua</a>. <br />
			&nbsp;Описание:<br />Функция предназначена для получения значений параметров таблицы «Купить/Продать». Функция возвращает таблицу Lua с параметрами из таблицы QUIK «Купить/Продать», означающими возможность купить либо продать указанный инструмент «sec_code» класса «class_code», указанным клиентом «client_code» фирмы «firmid», по указанной цене «price». Если цена равна «0», то используются лучшие значения спроса/предложения. Таблица параметров<br /><br /> Формат вызова:<br />TABLE getBuySellInfo (STRING firm_id, STRING client_code, STRING class_code, STRING sec_code, NUMBER price)<br /><br /> Дополнительные таблицы:<br />Таблица параметров<br />Параметр	Тип	Описание<br />is_margin_sec	STRING	Признак маржинальности инструмента. Возможные значения:<br />«0» – не маржинальная;<br />«1» – маржинальная;<br /><br />is_asset_sec	STRING	Принадлежность инструмента к списку бумаг, принимаемых в обеспечение. Возможные значения:<br />«0» – не принимается в обеспечение;<br />«1» – принимается в обеспечение;<br />
====code====
<pre>-- Запрашиваем данные
result = getBuySellInfo(firm_id, client_code, class_code, sec_code, 0)

-- Выводим таблицу результата
message(
&nbsp;&nbsp;&nbsp;&nbsp;"is_margin_sec = " .. tostring(result.is_margin_sec) .. "; &#92;n" ..
&nbsp;&nbsp;&nbsp;&nbsp;"is_asset_sec = " .. tostring(result.is_asset_sec) .. "; &#92;n" ..
&nbsp;&nbsp;&nbsp;&nbsp;"balance = " .. tostring(result.balance) .. "; &#92;n" ..
&nbsp;&nbsp;&nbsp;&nbsp;"can_buy = " .. tostring(result.can_buy) .. "; &#92;n" ..
&nbsp;&nbsp;&nbsp;&nbsp;"can_sell = " .. tostring(result.can_sell) .. "; &#92;n" ..
&nbsp;&nbsp;&nbsp;&nbsp;"position_valuation = " .. tostring(result.position_valuation) .. "; &#92;n" ..
&nbsp;&nbsp;&nbsp;&nbsp;"value = " .. tostring(result.value) .. "; &#92;n" ..
&nbsp;&nbsp;&nbsp;&nbsp;"open_value = " .. tostring(result.open_value) .. "; &#92;n" ..
&nbsp;&nbsp;&nbsp;&nbsp;"lim_long = " .. tostring(result.lim_long) .. "; &#92;n" ..
&nbsp;&nbsp;&nbsp;&nbsp;"long_coef = " .. tostring(result.long_coef) .. "; &#92;n" ..
&nbsp;&nbsp;&nbsp;&nbsp;"lim_short = " .. tostring(result.lim_short) .. "; &#92;n" ..
&nbsp;&nbsp;&nbsp;&nbsp;"short_coef = " .. tostring(result.short_coef) .. "; &#92;n" ..
&nbsp;&nbsp;&nbsp;&nbsp;"value_coef = " .. tostring(result.value_coef) .. "; &#92;n" ..
&nbsp;&nbsp;&nbsp;&nbsp;"open_value_coef = " .. tostring(result.open_value_coef) .. "; &#92;n" ..
&nbsp;&nbsp;&nbsp;&nbsp;"share = " .. tostring(result.share) .. "; &#92;n" ..
&nbsp;&nbsp;&nbsp;&nbsp;"short_wa_price = " .. tostring(result.short_wa_price) .. "; &#92;n" ..
&nbsp;&nbsp;&nbsp;&nbsp;"long_wa_price = " .. tostring(result.long_wa_price) .. "; &#92;n" ..
&nbsp;&nbsp;&nbsp;&nbsp;"profit_loss = " .. tostring(result.profit_loss) .. "; &#92;n" ..
&nbsp;&nbsp;&nbsp;&nbsp;"spread_hc = " .. tostring(result.spread_hc) .. "; &#92;n" ..
&nbsp;&nbsp;&nbsp;&nbsp;"can_buy_own = " .. tostring(result.can_buy_own) .. "; &#92;n" ..
&nbsp;&nbsp;&nbsp;&nbsp;"can_sell_own = " .. tostring(result.can_sell_own) .. "; &#92;n"
)
</pre>
============= <br />
			<i>01.10.2024 11:05:44, Serge123.</i>]]></description>
			<link>http://forum.quik.ru/messages/forum10/message76737/topic8714/</link>
			<guid>http://forum.quik.ru/messages/forum10/message76737/topic8714/</guid>
			<pubDate>Tue, 01 Oct 2024 11:05:44 +0300</pubDate>
			<category>Программирование на языке Lua</category>
		</item>
		<item>
			<title>Данные по бумагам в портфеле скриптом lua</title>
			<description><![CDATA[<b><a href="http://forum.quik.ru/messages/forum10/message76731/topic8714/">Данные по бумагам в портфеле скриптом lua</a></b> <i>Данные по бумагам в портфеле скриптом lua</i> в форуме <a href="http://forum.quik.ru/forum10/">Программирование на языке Lua</a>. <br />
			function poz(class_code, sec_code)<br />--ищим открытые позиции по заданным тикерам<br />	for i=0,getNumberOf(&quot;DEPO_LIMITS&quot;)-1 do<br />	local limit = getItem(&quot;DEPO_LIMITS&quot;, i)<br />		if limit~=nil and limit.sec_code == sec_code and limit.client_code == clientcode and limit.limit_kind==365 ---Tx<br />		then<br />		 &nbsp; balance = tonumber(math.floor(limit.currentbal))<br />		 &nbsp; prc_p = limit.wa_position_price<br />		end<br />	end<br />	return balance, prc_p<br />end<br /><br />--массаж<br />message(balance..&quot; &nbsp; &quot;.. prc_p) <br />
			<i>30.09.2024 20:38:42, prugramzer.</i>]]></description>
			<link>http://forum.quik.ru/messages/forum10/message76731/topic8714/</link>
			<guid>http://forum.quik.ru/messages/forum10/message76731/topic8714/</guid>
			<pubDate>Mon, 30 Sep 2024 20:38:42 +0300</pubDate>
			<category>Программирование на языке Lua</category>
		</item>
		<item>
			<title>Данные по бумагам в портфеле скриптом lua</title>
			<description><![CDATA[<b><a href="http://forum.quik.ru/messages/forum10/message76228/topic8714/">Данные по бумагам в портфеле скриптом lua</a></b> <i>Данные по бумагам в портфеле скриптом lua</i> в форуме <a href="http://forum.quik.ru/forum10/">Программирование на языке Lua</a>. <br />
			Пытаюсь получить данные по бумагам в портфеле скриптом. Выдает то ошибки, то nill<br />неделю ковыряюсь, не понимаю в чем ошибка(( <br />в портфеле одна акция Роснефти, нужно что бы при запуске скрипта вывел месседж что в портфеле 1 акция Роснефти. <br /><br /> &nbsp;sec_code = &quot;SIBN&quot;<br /> &nbsp;Firm_ID = &quot;MC00025000XX&quot;<br /> &nbsp;Kod_klienta = &quot;4XXXN&quot;<br /> ACCOUNT = &quot;L01-00000F00&quot;<br /> limit_kind = &quot;1&quot;<br /> &nbsp;res = getDepo(Kod_klienta, Firm_ID, sec_code, ACCOUNT)<br />local lots = (&quot;depo_current_balance&quot;) <br />message(&quot;Текущий остаток=&quot; ..lots)<br /><br /><br />или <br /><br /><br />sec_code = &quot;SIBN&quot;<br />Firm_ID = &quot;MC00025000XX&quot;<br />Kod_klienta = &quot;4XXXN&quot;<br />ACCOUNT = &quot;L01-00000F00&quot;<br /><br />function LB()<br />n = getNumberOf(&quot;depo_limits&quot;)<br />value = 0<br />res = nil<br />for y = 0, n-1 do<br />trade = getItem(&quot;depo_limits&quot;, y)<br />if (trade&#91;&quot;client_code&quot;&#93; == Kod_klienta) and<br />(trade&#91;&quot;firmid&quot;&#93; == Firm_ID) and<br />(trade&#91;&quot;sec_code&quot;&#93; == sec_code) and<br />(trade&#91;&quot;trdaccid&quot;&#93; == ACCOUNT) and<br />(trade&#91;&quot;limit_kind&quot;&#93; == 2) then<br />res = trade&#91;&quot;currentbal&quot;&#93;<br />break<br />end<br />end<br />return res<br />end<br /><br />message(tostring(LB()), 0)<br /><br /><br />Выдают nill <br />
			<i>26.07.2024 09:10:36, Alexey89.</i>]]></description>
			<link>http://forum.quik.ru/messages/forum10/message76228/topic8714/</link>
			<guid>http://forum.quik.ru/messages/forum10/message76228/topic8714/</guid>
			<pubDate>Fri, 26 Jul 2024 09:10:36 +0300</pubDate>
			<category>Программирование на языке Lua</category>
		</item>
	</channel>
</rss>
