<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[QUIK -> DDE &mdash; Данные по бумагам в портфеле скриптом lua]]></title>
	<link rel="self" href="https://quik2dde.ru/extern.php?action=feed&amp;tid=452&amp;type=atom" />
	<updated>2024-07-26T06:19:17Z</updated>
	<generator>PunBB</generator>
	<id>https://quik2dde.ru/viewtopic.php?id=452</id>
		<entry>
			<title type="html"><![CDATA[Данные по бумагам в портфеле скриптом lua]]></title>
			<link rel="alternate" href="https://quik2dde.ru/viewtopic.php?pid=4349#p4349" />
			<content type="html"><![CDATA[<p>Пытаюсь получить данные по бумагам в портфеле скриптом. Выдает то ошибки, то nill<br />неделю ковыряюсь, не понимаю в чем ошибка(( <br />в портфеле одна акция Роснефти, нужно что бы при запуске скрипта вывел месседж что в портфеле 1 акция Роснефти. </p><div class="codebox"><pre><code>  sec_code = &quot;SIBN&quot;
  Firm_ID = &quot;MC00025000XX&quot;
  Kod_klienta = &quot;4XXXN&quot;
 ACCOUNT = &quot;L01-00000F00&quot;
 limit_kind = &quot;1&quot;
  res = getDepo(Kod_klienta, Firm_ID, sec_code, ACCOUNT)
local lots = (&quot;depo_current_balance&quot;) 
message(&quot;Текущий остаток=&quot; ..lots)</code></pre></div><p>или </p><div class="codebox"><pre><code>sec_code = &quot;SIBN&quot;
Firm_ID = &quot;MC00025000XX&quot;
Kod_klienta = &quot;4XXXN&quot;
ACCOUNT = &quot;L01-00000F00&quot;

function LB()
  n = getNumberOf(&quot;depo_limits&quot;)
  value = 0
  res = nil
  for y = 0, n-1 do
    trade = getItem(&quot;depo_limits&quot;, y)
    if (trade[&quot;client_code&quot;] == Kod_klienta) and
      (trade[&quot;firmid&quot;] == Firm_ID) and
      (trade[&quot;sec_code&quot;] == sec_code) and
      (trade[&quot;trdaccid&quot;] == ACCOUNT) and
      (trade[&quot;limit_kind&quot;] == 2) then
        res = trade[&quot;currentbal&quot;]
        break
      end
  end
  return res
end

message(tostring(LB()), 0)</code></pre></div><p>Выдают nill</p>]]></content>
			<author>
				<name><![CDATA[Alexey89]]></name>
				<uri>https://quik2dde.ru/profile.php?id=3408</uri>
			</author>
			<updated>2024-07-26T06:19:17Z</updated>
			<id>https://quik2dde.ru/viewtopic.php?pid=4349#p4349</id>
		</entry>
</feed>
