<?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>Wed, 08 Apr 2026 00:20:01 +0300</pubDate>
		<item>
			<title>Трейлинг Стоп</title>
			<description><![CDATA[<b><a href="http://forum.quik.ru/messages/forum10/message12951/topic1420/">Трейлинг Стоп</a></b> в форуме <a href="http://forum.quik.ru/forum10/">Программирование на языке Lua</a>. <br />
			<br />====quote====<br /><a class="blog-p-user-name" id="bp_x5KHvzVr" href="/user/1648/" bx-tooltip-user-id="1648">Андрей Мурга</a> написал:<br />Мне не нужо програму,мне нужно <br /><br />=============<br />задавайте &nbsp;вопрос &nbsp; точнее &quot;<B>Есть пример </B><span class="bx-font" style="color:#ff0000"><B>кода</B></span><B> на луа?&quot; &nbsp;<img src="http://forum.quik.ru/upload/main/smiles/5/icon_confuse.png" border="0" data-code=":what:" data-definition="SD" alt=":what:" style="width:16px;height:16px;" title="Озадаченно" class="bx-smile" /> . </B>Есть сайт, по &nbsp;разработке скриптов на &nbsp;LUA, &nbsp;может помогут в вашем вопросе &nbsp;<B><noindex><a href="http://quikluacsharp.ru/quik-qlua/prostoj-ma-robot-qlua-s-vystavleniem-tejk-profit-i-stop-limit/" target="_blank" rel="nofollow">ссылка</a></noindex> &nbsp;<img src="http://forum.quik.ru/upload/main/smiles/5/icon_idea.png" border="0" data-code=":idea:" data-definition="SD" alt=":idea:" style="width:16px;height:16px;" title="Идея" class="bx-smile" /> <br /></B> <br />
			<i>19.02.2016 11:35:02, question.</i>]]></description>
			<link>http://forum.quik.ru/messages/forum10/message12951/topic1420/</link>
			<guid>http://forum.quik.ru/messages/forum10/message12951/topic1420/</guid>
			<pubDate>Fri, 19 Feb 2016 11:35:02 +0300</pubDate>
			<category>Программирование на языке Lua</category>
		</item>
		<item>
			<title>Трейлинг Стоп</title>
			<description><![CDATA[<b><a href="http://forum.quik.ru/messages/forum10/message12949/topic1420/">Трейлинг Стоп</a></b> в форуме <a href="http://forum.quik.ru/forum10/">Программирование на языке Lua</a>. <br />
			Мне не нужо програму,мне нужно код <br />
			<i>19.02.2016 10:55:13, Андрей Мурга.</i>]]></description>
			<link>http://forum.quik.ru/messages/forum10/message12949/topic1420/</link>
			<guid>http://forum.quik.ru/messages/forum10/message12949/topic1420/</guid>
			<pubDate>Fri, 19 Feb 2016 10:55:13 +0300</pubDate>
			<category>Программирование на языке Lua</category>
		</item>
		<item>
			<title>Трейлинг Стоп</title>
			<description><![CDATA[<b><a href="http://forum.quik.ru/messages/forum10/message12947/topic1420/">Трейлинг Стоп</a></b> в форуме <a href="http://forum.quik.ru/forum10/">Программирование на языке Lua</a>. <br />
			<br />====quote====<br /><a class="blog-p-user-name" id="bp_OyxM0PMl" href="/user/1648/" bx-tooltip-user-id="1648">Андрей Мурга</a> написал:<br />Есть пример на луа?<br />=============<br />Есть недорогая программа <B> </B>с гибкими настройками трейлинг-стопа, стоп по индикаторам, стоп в безубыток, пул стоп-заявок<B>, </B>стоп по прибыли/убытку<B> &nbsp;</B><B> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 									 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;									 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;	<noindex><a href="http://www.mycreditcard.ru/acceleration-lua.html" target="_blank" rel="nofollow">Acceleration</a></noindex> &nbsp;<noindex><a href="http://www.mycreditcard.ru/component/attachments/download/45.html" target="_blank" rel="nofollow">скачать демо</a></noindex>.<br /></B> <br />
			<i>19.02.2016 10:50:00, question.</i>]]></description>
			<link>http://forum.quik.ru/messages/forum10/message12947/topic1420/</link>
			<guid>http://forum.quik.ru/messages/forum10/message12947/topic1420/</guid>
			<pubDate>Fri, 19 Feb 2016 10:50:00 +0300</pubDate>
			<category>Программирование на языке Lua</category>
		</item>
		<item>
			<title>Трейлинг Стоп</title>
			<description><![CDATA[<b><a href="http://forum.quik.ru/messages/forum10/message12943/topic1420/">Трейлинг Стоп</a></b> в форуме <a href="http://forum.quik.ru/forum10/">Программирование на языке Lua</a>. <br />
			Зачем нам таблица стопов и зделок? <br />
			<i>19.02.2016 10:40:37, Андрей Мурга.</i>]]></description>
			<link>http://forum.quik.ru/messages/forum10/message12943/topic1420/</link>
			<guid>http://forum.quik.ru/messages/forum10/message12943/topic1420/</guid>
			<pubDate>Fri, 19 Feb 2016 10:40:37 +0300</pubDate>
			<category>Программирование на языке Lua</category>
		</item>
		<item>
			<title>Трейлинг Стоп</title>
			<description><![CDATA[<b><a href="http://forum.quik.ru/messages/forum10/message12936/topic1420/">Трейлинг Стоп</a></b> в форуме <a href="http://forum.quik.ru/forum10/">Программирование на языке Lua</a>. <br />
			трейл стоп по сути вещь простая, и проще написать с нуля, чем разбираться в чужом огороде.<br />запрашиваем таблицу стопов, запрашиваем таблицу сделок. если цена существующей сделки отличается от текущей цены контракта на определенное значение - заменяем стоп <br />
			<i>19.02.2016 10:14:02, Валентин.</i>]]></description>
			<link>http://forum.quik.ru/messages/forum10/message12936/topic1420/</link>
			<guid>http://forum.quik.ru/messages/forum10/message12936/topic1420/</guid>
			<pubDate>Fri, 19 Feb 2016 10:14:02 +0300</pubDate>
			<category>Программирование на языке Lua</category>
		</item>
		<item>
			<title>Трейлинг Стоп</title>
			<description><![CDATA[<b><a href="http://forum.quik.ru/messages/forum10/message12935/topic1420/">Трейлинг Стоп</a></b> в форуме <a href="http://forum.quik.ru/forum10/">Программирование на языке Lua</a>. <br />
			я правильно понял. stop_level и есть трейлинг он будет подтягиваит за индикатором,можно ли зделать что подтягивал за ценной и при достижениее б/у остановлявся на том уровне? <br />
			<i>19.02.2016 10:13:12, Андрей Мурга.</i>]]></description>
			<link>http://forum.quik.ru/messages/forum10/message12935/topic1420/</link>
			<guid>http://forum.quik.ru/messages/forum10/message12935/topic1420/</guid>
			<pubDate>Fri, 19 Feb 2016 10:13:12 +0300</pubDate>
			<category>Программирование на языке Lua</category>
		</item>
		<item>
			<title>Трейлинг Стоп</title>
			<description><![CDATA[<b><a href="http://forum.quik.ru/messages/forum10/message12934/topic1420/">Трейлинг Стоп</a></b> в форуме <a href="http://forum.quik.ru/forum10/">Программирование на языке Lua</a>. <br />
			Я нашел один но трудно розобраться<br />if string.find(package.path,'C:\\Program Files (x86)\\Lua\\5.1\\lua\\?.lua')==nil then<br /> &nbsp; package.path=package.path..';C:\\Program Files (x86)\\Lua\\5.1\\lua\\?.lua;'<br />end<br />if string.find(package.path,'C:\\Program Files\\Lua\\5.1\\lua\\?.lua')==nil then<br /> &nbsp; package.path=package.path..';C:\\Program Files\\Lua\\5.1\\lua\\?.lua;'<br />end <br /><br />require&quot;QL&quot;<br />require&quot;iuplua&quot;<br />log=&quot;auto_stop.log&quot;<br /><br />--Блок пользовательских переменных. Забиваем в визуальный интерфейс, который помнит ранее введённые данные.<br />account=&quot;game997&quot;<br />cl_code=&quot;game997&quot;<br />sec=&quot;MSICHS&quot;<br />stop_level=5 --расстояние в шагах цены от индикатора, на котором срабатывает стоп.<br />slippage=10 --проскальзывание при исполнении ордера в шагах цены. <br />chart=&quot;auto_stop&quot;<br /><br />table_mask={}<br />table_mask.client_code=cl_code<br />table_mask.seccode=sec<br />is_run = true<br /><br />function OnStop(s)<br /> &nbsp;is_run = false<br /> &nbsp;toLog(log,'OnStop. Script finished manually')<br /> &nbsp;message (&quot;auto_stop finished manually&quot;, 2)<br />end<br /><br />function main()<br />	log=getScriptPath()..'\\'..log<br />	toLog(log,&quot;Start main&quot;)<br />	class=getSecurityInfo(&quot;&quot;,sec).class_code<br />	--Получаем размер лота<br />	lotsize=getParamEx(class,sec,&quot;lotsize&quot;).param_value<br />	--Получаем цену последней сделки<br />	last=getParamEx(class,sec,&quot;last&quot;).param_value<br />	step=getParamEx(class,sec,'SEC_PRICE_STEP').param_value<br />	stop_level=stop_level*step<br />	if string.find(FUT_OPT_CLASSES,class)~=nil then acc=account else acc=cl_code end<br /> &nbsp;while is_run do<br />	--получаем значение индикатора. Одинаково для Moving Average и Parabolic SAR<br />	n = getNumCandles (chart)<br />	if n==0 or n==nil then<br />		toLog(log,'Can`t get data fr om chart '..chart)<br />		message('Не можем получить данные с графика '..chart,1)<br />		is_run=false<br />		break<br />	end<br />	t,n,s = getCandlesByIndex(chart,0,n-1,1)<br />	indicator=t[0].close<br /><br />	sell_out_trigger=toPrice(sec, indicator-stop_level) --цена, при которой спускаем курок на продажу лонга<br />	buy_out_trigger=toPrice(sec, indicator+stop_level) --цена, при которой спускаем курок на откуп шорта<br />	<br />	--Получаем текущий баланс по торгуемому инструменту<br /><br />	balance=getPosition(sec,acc)<br />	close_order_size=math.abs(balance/lotsize) --считаем размер ордера-закрывашки<br />	toLog(log,balance)<br /><br />	--ЗАКРЫТИЕ ПОЗИЦИЙ<br /><br />	if balance&gt;0 and last &lt; sell_out_trigger then <br />		toLog (log, 'Sell out signal. Balance='..balance..' Last='..last..' SellTrigerPrice='..sell_out_trigger)<br />		comment=&quot;sell_out!&quot; --комментарий: продаём!<br />		sell_out=sell_out_trigger-slippage<br />		_,reply=sendLimit(class,sec,&quot;S&quot;,sell_out,close_order_size,account,cl_code,comment)<br />		toLog(log, reply)<br />	end <br />	<br />	if balance&lt;0 and last &gt; buy_out_trigger then <br />		toLog (log, 'Buy out signal. Balance='..balance..' Last='..last..' SellTrigerPrice='..buy_out_trigger)<br />		comment=&quot;buy_out!&quot; --комментарий: продаём!<br />		buy_out=buy_out_trigger+slippage<br />		_,reply=sendLim it(class,sec,&quot;B&quot;,buy_out,close_order_size,account,cl_code,comment)<br />		toLog(log, reply)<br />	end <br />	sleep(1000)<br />	--killAllOrders(table_mask) --рекомендуется после срабатывания стопа принудительно почистить все заявки в стакане по этому инструменту чтобы вдруг не осталось лишних, в том числе &quot;забытых&quot; по неосторожности. Бывает, что оставшиеся в стакане заявки блокируют средства и не дают продать по стопу. killAllOrders даст гарантию что на следующем круге цикла мы точно выйдем из позиции.<br /> &nbsp;end<br /> &nbsp;toLog(log,&quot;Main ended&quot;)<br />end <br />
			<i>19.02.2016 10:09:27, Андрей Мурга.</i>]]></description>
			<link>http://forum.quik.ru/messages/forum10/message12934/topic1420/</link>
			<guid>http://forum.quik.ru/messages/forum10/message12934/topic1420/</guid>
			<pubDate>Fri, 19 Feb 2016 10:09:27 +0300</pubDate>
			<category>Программирование на языке Lua</category>
		</item>
		<item>
			<title>Трейлинг Стоп</title>
			<description><![CDATA[<b><a href="http://forum.quik.ru/messages/forum10/message12933/topic1420/">Трейлинг Стоп</a></b> в форуме <a href="http://forum.quik.ru/forum10/">Программирование на языке Lua</a>. <br />
			наверняка где то есть, у меня пока в процессе <br />
			<i>19.02.2016 10:03:46, Валентин.</i>]]></description>
			<link>http://forum.quik.ru/messages/forum10/message12933/topic1420/</link>
			<guid>http://forum.quik.ru/messages/forum10/message12933/topic1420/</guid>
			<pubDate>Fri, 19 Feb 2016 10:03:46 +0300</pubDate>
			<category>Программирование на языке Lua</category>
		</item>
		<item>
			<title>Трейлинг Стоп</title>
			<description><![CDATA[<b><a href="http://forum.quik.ru/messages/forum10/message12931/topic1420/">Трейлинг Стоп</a></b> в форуме <a href="http://forum.quik.ru/forum10/">Программирование на языке Lua</a>. <br />
			Есть пример на луа? <br />
			<i>19.02.2016 09:59:09, Андрей Мурга.</i>]]></description>
			<link>http://forum.quik.ru/messages/forum10/message12931/topic1420/</link>
			<guid>http://forum.quik.ru/messages/forum10/message12931/topic1420/</guid>
			<pubDate>Fri, 19 Feb 2016 09:59:09 +0300</pubDate>
			<category>Программирование на языке Lua</category>
		</item>
		<item>
			<title>Трейлинг Стоп</title>
			<description><![CDATA[<b><a href="http://forum.quik.ru/messages/forum10/message12920/topic1420/">Трейлинг Стоп</a></b> в форуме <a href="http://forum.quik.ru/forum10/">Программирование на языке Lua</a>. <br />
			возможно.<br />с помощью qpile или qlua <br />
			<i>19.02.2016 05:22:16, Валентин.</i>]]></description>
			<link>http://forum.quik.ru/messages/forum10/message12920/topic1420/</link>
			<guid>http://forum.quik.ru/messages/forum10/message12920/topic1420/</guid>
			<pubDate>Fri, 19 Feb 2016 05:22:16 +0300</pubDate>
			<category>Программирование на языке Lua</category>
		</item>
		<item>
			<title>Трейлинг Стоп</title>
			<description><![CDATA[<b><a href="http://forum.quik.ru/messages/forum10/message12903/topic1420/">Трейлинг Стоп</a></b> в форуме <a href="http://forum.quik.ru/forum10/">Программирование на языке Lua</a>. <br />
			Возможно ли переносить позицию в безубыток (тоесть трейлинг стоп), после достижения профита в 100п по РТС? <br />
			<i>18.02.2016 21:30:14, Андрей Мурга.</i>]]></description>
			<link>http://forum.quik.ru/messages/forum10/message12903/topic1420/</link>
			<guid>http://forum.quik.ru/messages/forum10/message12903/topic1420/</guid>
			<pubDate>Thu, 18 Feb 2016 21:30:14 +0300</pubDate>
			<category>Программирование на языке Lua</category>
		</item>
	</channel>
</rss>
