<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
	<channel>
		<title>Форум QUIK [тема: Получить актуальный статус take profit  заявки из таблицы stop_orders с помощью bit флагов]</title>
		<link>http://forum.quik.ru</link>
		<description>Новое в теме Получить актуальный статус take profit  заявки из таблицы stop_orders с помощью bit флагов форума  на сайте Форум QUIK [forum.quik.ru]</description>
		<language>ru</language>
		<docs>http://backend.userland.com/rss2</docs>
		<pubDate>Fri, 17 Apr 2026 20:21:10 +0300</pubDate>
		<item>
			<title>Получить актуальный статус take profit  заявки из таблицы stop_orders с помощью bit флагов</title>
			<description><![CDATA[<b><a href="http://forum.quik.ru/messages/forum10/message54988/topic6414/">Получить актуальный статус take profit  заявки из таблицы stop_orders с помощью bit флагов</a></b> в форуме <a href="http://forum.quik.ru/forum10/">Программирование на языке Lua</a>. <br />
			<a class="blog-p-user-name" id="bp_4mpsw6cN" href="/user/13144/" bx-tooltip-user-id="13144">Duke2</a>, добрый день!<br /><br />Попробуйте скорректировать условие вот так:
====code====
<pre>stop_order = getItem("stop_orders",i)
if (bit.band(stop_order.flags,0x4) == 0) and (stop_order.sec_code == SecCode) and (bit.band(stop_order.flags,0x1) ~= 0) and (bit.band(stop_order.flags,0x8000) ~= 0) then msg = "&#60;ваш текст&#62;"
</pre>
=============
Проверили у себя, такой код работает. <br />
			<i>20.04.2021 13:21:51, Roman Azarov.</i>]]></description>
			<link>http://forum.quik.ru/messages/forum10/message54988/topic6414/</link>
			<guid>http://forum.quik.ru/messages/forum10/message54988/topic6414/</guid>
			<pubDate>Tue, 20 Apr 2021 13:21:51 +0300</pubDate>
			<category>Программирование на языке Lua</category>
		</item>
		<item>
			<title>Получить актуальный статус take profit  заявки из таблицы stop_orders с помощью bit флагов</title>
			<description><![CDATA[<b><a href="http://forum.quik.ru/messages/forum10/message54729/topic6414/">Получить актуальный статус take profit  заявки из таблицы stop_orders с помощью bit флагов</a></b> в форуме <a href="http://forum.quik.ru/forum10/">Программирование на языке Lua</a>. <br />
			Всем добрый день. Прошу помощи по след вопросу.<br />Пытаюсь отловить момент (получить сообщение) когда идет расчет &nbsp;take profit по соответсвующей заявке &nbsp;(в данном случае на покупку) из таблицы stop_orders. Пытаюсь вернуть сообщение с помощью след кода:
====code====
<pre>elseif
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; bit.band(getItem("stop_orders",i).flags,4)== 0 and getItem("stop_orders",i).sec_code == SecCode and bit.band(getItem("stop_orders",i).flags,1) ~=0 and bit.band(getItem("stop_orders",i).flags,8000) ~=0 then
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; message("идет расчет min/max - Заявку не выставляем")
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; sleep (5000)
&nbsp;&nbsp;&nbsp;&nbsp;end</pre>
=============
<p>Задаю 4 условия.Соответсвенно, (как я это понимаю), в первом условии проверяю направление заявки, во втором &nbsp;-инструмент, в третьем - &nbsp;активность(?) заявки, в четвертом- соответсвенно идет или не идет расчет Take profit. Где-то тут косяк (возможно если идет расчет, то заявка уже не считается активной и проч). Подскажите плиз где косяк? как получить message когда идет расчет take-profit? Заранее благодарю</p> <br />
			<i>12.04.2021 17:51:43, Duke2.</i>]]></description>
			<link>http://forum.quik.ru/messages/forum10/message54729/topic6414/</link>
			<guid>http://forum.quik.ru/messages/forum10/message54729/topic6414/</guid>
			<pubDate>Mon, 12 Apr 2021 17:51:43 +0300</pubDate>
			<category>Программирование на языке Lua</category>
		</item>
	</channel>
</rss>
