<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
	<channel>
		<title>Форум QUIK [тема: гибкий цикл]</title>
		<link>http://forum.quik.ru</link>
		<description>Новое в теме гибкий цикл форума  на сайте Форум QUIK [forum.quik.ru]</description>
		<language>ru</language>
		<docs>http://backend.userland.com/rss2</docs>
		<pubDate>Sun, 03 May 2026 10:30:13 +0300</pubDate>
		<item>
			<title>гибкий цикл</title>
			<description><![CDATA[<b><a href="http://forum.quik.ru/messages/forum10/message30907/topic3647/">гибкий цикл</a></b> в форуме <a href="http://forum.quik.ru/forum10/">Программирование на языке Lua</a>. <br />
			Спасибо!<br />Очень полезный ответ! <br />
			<i>06.05.2018 01:36:01, Let_it_go.</i>]]></description>
			<link>http://forum.quik.ru/messages/forum10/message30907/topic3647/</link>
			<guid>http://forum.quik.ru/messages/forum10/message30907/topic3647/</guid>
			<pubDate>Sun, 06 May 2018 01:36:01 +0300</pubDate>
			<category>Программирование на языке Lua</category>
		</item>
		<item>
			<title>гибкий цикл</title>
			<description><![CDATA[<b><a href="http://forum.quik.ru/messages/forum10/message30906/topic3647/">гибкий цикл</a></b> в форуме <a href="http://forum.quik.ru/forum10/">Программирование на языке Lua</a>. <br />
			после чая увидел пару ошибок (i-локальная в цикле)<br />исправляю на<br /><br />iterations=20; <br />k=0; <br />finish=100; <br />flag=true;<br />while flag do <br /> start=k; <br /> step=(finish-start)/iterations; <br /> &nbsp;for i=start,finish,step do <br /> &nbsp; if i==finish then<br /> &nbsp; &nbsp;flag=false;<br /> &nbsp; end;<br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;--делаем расчёт. <br /> &nbsp; if profit&gt;0 then <br /> &nbsp; &nbsp;k=i-1; --возвращаемся на step назад <br /> &nbsp; &nbsp;iterations=100; --(шаг становится более мелким) <br /> &nbsp; &nbsp;break; <br /> &nbsp; end;<br /> &nbsp;end; <br />end <br />
			<i>06.05.2018 01:31:31, Игорь Б.</i>]]></description>
			<link>http://forum.quik.ru/messages/forum10/message30906/topic3647/</link>
			<guid>http://forum.quik.ru/messages/forum10/message30906/topic3647/</guid>
			<pubDate>Sun, 06 May 2018 01:31:31 +0300</pubDate>
			<category>Программирование на языке Lua</category>
		</item>
		<item>
			<title>гибкий цикл</title>
			<description><![CDATA[<b><a href="http://forum.quik.ru/messages/forum10/message30905/topic3647/">гибкий цикл</a></b> в форуме <a href="http://forum.quik.ru/forum10/">Программирование на языке Lua</a>. <br />
			iterations=20<br />k=0<br />finish=100<br /><br />for j=1,1000000 do<br /> &nbsp; &nbsp; &nbsp;start=k<br /> &nbsp; &nbsp; &nbsp;step=(finish-start)/iterations<br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;for i=start,finish,step do<br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;--делаем расчёт.<br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if profit&gt;0 then<br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;k=i-1 --возвращаемся на step назад<br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;iterations=100 --(шаг становится более мелким)<br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;break<br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; end<br /> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;end<br /> &nbsp; &nbsp;if i==finish then break<br />end<br />Не проверял. Но, возможно, как направление мысли. <br />
			<i>05.05.2018 23:49:00, Игорь Б.</i>]]></description>
			<link>http://forum.quik.ru/messages/forum10/message30905/topic3647/</link>
			<guid>http://forum.quik.ru/messages/forum10/message30905/topic3647/</guid>
			<pubDate>Sat, 05 May 2018 23:49:00 +0300</pubDate>
			<category>Программирование на языке Lua</category>
		</item>
		<item>
			<title>гибкий цикл</title>
			<description><![CDATA[<b><a href="http://forum.quik.ru/messages/forum10/message30904/topic3647/">гибкий цикл</a></b> в форуме <a href="http://forum.quik.ru/forum10/">Программирование на языке Lua</a>. <br />
			Господа, помогите пожалуйста советом. Хочу написать гибкий цикл, в котором можно возвращаться на шаг назад, и перебирать данные с разным шагом.<br />Постарался описать это здесь:<br />
====code====
<pre>iterations=20
start=0
finish=100
step=(finish-start)/iterations
for i=start,finish,step do
--делаем расчёт.
&nbsp;&nbsp;&nbsp;if profit&#62;0 then
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;--возвращаемся на step назад
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;--iterations=100 (шаг становится более мелким)
&nbsp;&nbsp;&nbsp;end
end</pre>
=============
то есть если я при переборе большого массива данных (слепки стакана) наткнулся на прибыльный участок, то я хочу проанализировать его тщательно, с более мелким шагом. <br />А потом, когда снова пошли убыточные участки, хочу вернуться на прежний шаг - обычный. &nbsp; <br />
			<i>05.05.2018 22:15:55, Let_it_go.</i>]]></description>
			<link>http://forum.quik.ru/messages/forum10/message30904/topic3647/</link>
			<guid>http://forum.quik.ru/messages/forum10/message30904/topic3647/</guid>
			<pubDate>Sat, 05 May 2018 22:15:55 +0300</pubDate>
			<category>Программирование на языке Lua</category>
		</item>
	</channel>
</rss>
