<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
	<channel>
		<title>Форум QUIK [тема: Шёл рыцарь и нашёл себе 2 проблемы]</title>
		<link>http://forum.quik.ru</link>
		<description>Новое в теме Шёл рыцарь и нашёл себе 2 проблемы форума  на сайте Форум QUIK [forum.quik.ru]</description>
		<language>ru</language>
		<docs>http://backend.userland.com/rss2</docs>
		<pubDate>Sat, 04 Apr 2026 16:11:23 +0300</pubDate>
		<item>
			<title>Шёл рыцарь и нашёл себе 2 проблемы</title>
			<description><![CDATA[<b><a href="http://forum.quik.ru/messages/forum10/message81348/topic9439/">Шёл рыцарь и нашёл себе 2 проблемы</a></b> в форуме <a href="http://forum.quik.ru/forum10/">Программирование на языке Lua</a>. <br />
			Здравствуйте. <br /><br />Попробуйте добавить переменную для хранения последней известной цены закрытия источника и при отсутствии новых цены вернуть эту переменную или 0. <br />
			<i>13.02.2026 07:18:17, Oleg Kuzembaev.</i>]]></description>
			<link>http://forum.quik.ru/messages/forum10/message81348/topic9439/</link>
			<guid>http://forum.quik.ru/messages/forum10/message81348/topic9439/</guid>
			<pubDate>Fri, 13 Feb 2026 07:18:17 +0300</pubDate>
			<category>Программирование на языке Lua</category>
		</item>
		<item>
			<title>Шёл рыцарь и нашёл себе 2 проблемы</title>
			<description><![CDATA[<b><a href="http://forum.quik.ru/messages/forum10/message81287/topic9439/">Шёл рыцарь и нашёл себе 2 проблемы</a></b> в форуме <a href="http://forum.quik.ru/forum10/">Программирование на языке Lua</a>. <br />
			<br />====quote====<br /><a class="blog-p-user-name" id="bp_2OYqQI1p" href="/user/16979/" bx-tooltip-user-id="16979">Oleg Kuzembaev</a> написал:<br /> <br />====quote====<br />2) можно ли получить список идентификаторов графиков и индикаторов в системе? Если нет то можно пожелание зарегистрировать.<br />=============<br /> Здравствуйте. Примеры расчета идентификаторов можно получить по ссылке: &nbsp;<noindex><a href="https://arqatech.com/upload/iblock/398/INDICATORS.zip" target="_blank" rel="nofollow">https://arqatech.com/upload/iblock/398/INDICATORS.zip</a></noindex> <br />=============<br />Сразу в Quik 12.8.3.4 не заработало. Нашел решение <noindex><a href="https://forum.quik.ru/forum10/topic7486/?ysclid=mlhuqhd69z79243221" target="_blank" rel="nofollow">MA.lua:240: attempt to call a nil value (global &#39;unpack&#39;)</a></noindex>. Исправил unpack() на table.unpack и все заработало.<br />НО! 1-ая проблема &quot;В тоже время &#39;перекрестие&#39; что на всплывающей легенде, что на шкале даёт значения без дробной части ....&quot; так и остается ... <br />
			<i>11.02.2026 13:06:08, dimka.</i>]]></description>
			<link>http://forum.quik.ru/messages/forum10/message81287/topic9439/</link>
			<guid>http://forum.quik.ru/messages/forum10/message81287/topic9439/</guid>
			<pubDate>Wed, 11 Feb 2026 13:06:08 +0300</pubDate>
			<category>Программирование на языке Lua</category>
		</item>
		<item>
			<title>Шёл рыцарь и нашёл себе 2 проблемы</title>
			<description><![CDATA[<b><a href="http://forum.quik.ru/messages/forum10/message81250/topic9439/">Шёл рыцарь и нашёл себе 2 проблемы</a></b> в форуме <a href="http://forum.quik.ru/forum10/">Программирование на языке Lua</a>. <br />
			<br />====quote====<br />2) можно ли получить список идентификаторов графиков и индикаторов в системе? Если нет то можно пожелание зарегистрировать.<br />=============<br />Здравствуйте. Примеры расчета идентификаторов можно получить по ссылке: <noindex><a href="https://arqatech.com/upload/iblock/398/INDICATORS.zip" target="_blank" rel="nofollow">https://arqatech.com/upload/iblock/398/INDICATORS.zip</a></noindex> <br />
			<i>10.02.2026 10:57:56, Oleg Kuzembaev.</i>]]></description>
			<link>http://forum.quik.ru/messages/forum10/message81250/topic9439/</link>
			<guid>http://forum.quik.ru/messages/forum10/message81250/topic9439/</guid>
			<pubDate>Tue, 10 Feb 2026 10:57:56 +0300</pubDate>
			<category>Программирование на языке Lua</category>
		</item>
		<item>
			<title>Шёл рыцарь и нашёл себе 2 проблемы</title>
			<description><![CDATA[<b><a href="http://forum.quik.ru/messages/forum10/message81230/topic9439/">Шёл рыцарь и нашёл себе 2 проблемы</a></b> в форуме <a href="http://forum.quik.ru/forum10/">Программирование на языке Lua</a>. <br />
			Извините, странно работает сегодня сайт у меня. Возможно так понятней:<br /><br />local function round(num, idp)<br /> &nbsp; <br /> &nbsp; -- Если num некорректное, вернуть как есть<br /> &nbsp; if not num or type(num) ~= "number" then return num end<br /> <br /> &nbsp; -- Если idp не указан, использовать 0 (округление до целого числа)<br /> &nbsp; idp = idp or 0<br /> &nbsp; local mult = 10^idp<br /><br /> &nbsp; -- Универсальное Округление для любого числа<br /> &nbsp; local rounded = num &gt;= 0 and math.floor(num * mult + 0.5) / mult or num &lt; 0 and math.ceil(num * mult - 0.5) / mult or 0<br /> &nbsp; <br /> &nbsp; -- Если число целое, убрать .0<br /> &nbsp; if rounded == math.floor(rounded) then<br /> &nbsp; &nbsp; &nbsp; return math.floor(rounded)<br /> &nbsp; end<br /><br /> &nbsp; return rounded<br />end <br />
			<i>09.02.2026 19:13:15, VPM.</i>]]></description>
			<link>http://forum.quik.ru/messages/forum10/message81230/topic9439/</link>
			<guid>http://forum.quik.ru/messages/forum10/message81230/topic9439/</guid>
			<pubDate>Mon, 09 Feb 2026 19:13:15 +0300</pubDate>
			<category>Программирование на языке Lua</category>
		</item>
		<item>
			<title>Шёл рыцарь и нашёл себе 2 проблемы</title>
			<description><![CDATA[<b><a href="http://forum.quik.ru/messages/forum10/message81219/topic9439/">Шёл рыцарь и нашёл себе 2 проблемы</a></b> в форуме <a href="http://forum.quik.ru/forum10/">Программирование на языке Lua</a>. <br />
			<a class="blog-p-user-name" id="bp_eaP4NmoY" href="/user/230/" bx-tooltip-user-id="230">dimka</a>, &nbsp;По пробуйте, выводить значения индикатора, используя этот подход. [CODE][local function round(num, idp)<br /> &nbsp; &nbsp;<br /> &nbsp; &nbsp;-- Если num некорректное, вернуть как есть<br /> &nbsp; &nbsp;if not num or type(num) ~= "number" then return num end<br /> &nbsp; <br /> &nbsp; &nbsp;-- Если idp не указан, использовать 0 (округление до целого числа)<br /> &nbsp; &nbsp;idp = idp or 0 <br /> &nbsp; &nbsp;local mult = 10^idp<br /><br /> &nbsp; &nbsp;-- Универсальное Округление для любого числа <br /> &nbsp; &nbsp;local rounded = num &gt;= 0 and math.floor(num * mult + 0.5) / mult or num &lt; 0 and math.ceil(num * mult - 0.5) / mult or 0<br /> &nbsp; &nbsp;<br /> &nbsp; &nbsp;-- Если число целое, убрать .0<br /> &nbsp; &nbsp;if rounded == math.floor(rounded) then<br /> &nbsp; &nbsp; &nbsp; &nbsp;return math.floor(rounded)<br /> &nbsp; &nbsp;end<br /><br /> &nbsp; &nbsp;return rounded<br />end/CODE] <br />
			<i>09.02.2026 11:21:37, VPM.</i>]]></description>
			<link>http://forum.quik.ru/messages/forum10/message81219/topic9439/</link>
			<guid>http://forum.quik.ru/messages/forum10/message81219/topic9439/</guid>
			<pubDate>Mon, 09 Feb 2026 11:21:37 +0300</pubDate>
			<category>Программирование на языке Lua</category>
		</item>
		<item>
			<title>Шёл рыцарь и нашёл себе 2 проблемы</title>
			<description><![CDATA[<b><a href="http://forum.quik.ru/messages/forum10/message81076/topic9439/">Шёл рыцарь и нашёл себе 2 проблемы</a></b> в форуме <a href="http://forum.quik.ru/forum10/">Программирование на языке Lua</a>. <br />
			1)<br />Открываем график цены и объёма например Сбера ... у графика Сбера в пункте &#39;Идентификатор&#39; выставляем abcdДобавляем в новой области индикатор AAA2 ... смысл которого просто повторить график цены.<br /><br />
====code====
<pre>Settings=
{
 Name = "AAA2",
 Name1 = "abcd",
 val_r = 0,
 line = 
 {
 {
 Name = "MA",
 Color = #ff0000,
 Type = TYPE_LINE,
 Width = 2
 }
 }
}


 function Init()
&nbsp;&nbsp;&nbsp;return 1
 end

function OnCalculate(index)
&nbsp;&nbsp;&nbsp;local q1 = 0
&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;t1, n1, l1 = getCandlesByIndex(Settings.Name1, 0, index-1, 1)
&nbsp;&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp;q1 = Settings.val_r
&nbsp;&nbsp;&nbsp;if t1&#91;0&#93;.close &#62; 0 then
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;q1 = t1&#91;0&#93;.close
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Settings.val_r = q1
&nbsp;&nbsp;&nbsp;end
 
&nbsp;&nbsp;&nbsp;return q1
end


</pre>
=============
<br /><br />Получаем картинку:<br /><br /><br /><img src="https://s5.iimage.su/s/30/gDlVxkSxW1ZJIvR6INJX6fjEYuXLbrBulzIwJQUe.png" alt="Пользователь добавил изображение" border="0" /><br /><br />Видим что индикатор пишет посл. значение с дробной частью(например 306.70). В тоже время &#39;перекрестие&#39; что на всплывающей легенде, что на шкале даёт значения без дробной части то бишь 302. Как сию оказию решить?<br /><br />2) можно ли получить список идентификаторов графиков и индикаторов в системе? Если нет то можно пожелание зарегистрировать. <br />
			<i>30.01.2026 11:36:28, dimka.</i>]]></description>
			<link>http://forum.quik.ru/messages/forum10/message81076/topic9439/</link>
			<guid>http://forum.quik.ru/messages/forum10/message81076/topic9439/</guid>
			<pubDate>Fri, 30 Jan 2026 11:36:28 +0300</pubDate>
			<category>Программирование на языке Lua</category>
		</item>
	</channel>
</rss>
