<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[QUIK -> DDE &mdash; как отменить стоп-заявки на forts]]></title>
	<link rel="self" href="https://quik2dde.ru/extern.php?action=feed&amp;tid=49&amp;type=atom" />
	<updated>2013-04-23T09:31:00Z</updated>
	<generator>PunBB</generator>
	<id>https://quik2dde.ru/viewtopic.php?id=49</id>
		<entry>
			<title type="html"><![CDATA[Re: как отменить стоп-заявки на forts]]></title>
			<link rel="alternate" href="https://quik2dde.ru/viewtopic.php?pid=296#p296" />
			<content type="html"><![CDATA[<p>ясно, спасибо большое.</p>]]></content>
			<author>
				<name><![CDATA[burunduk]]></name>
				<uri>https://quik2dde.ru/profile.php?id=115</uri>
			</author>
			<updated>2013-04-23T09:31:00Z</updated>
			<id>https://quik2dde.ru/viewtopic.php?pid=296#p296</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: как отменить стоп-заявки на forts]]></title>
			<link rel="alternate" href="https://quik2dde.ru/viewtopic.php?pid=295#p295" />
			<content type="html"><![CDATA[<p>function killAllStopOrders(table_mask)<br />&nbsp; &nbsp; -- данная функция отправит транзакции на отмену АКТИВНЫХ стоп-заявок соответствующим фильтру указанному как входящий параметр table_mask<br />&nbsp; &nbsp; -- список всех возможных параметров&nbsp; : ACCOUNT,CLASSCODE,SECCODE,OPERATION,CLIENT_CODE,COMMENT<br />&nbsp; &nbsp; -- если вызвать функцию с параметром nil - снимутся ВСЕ активные заявки<br />&nbsp; &nbsp; local i,key,val,result_num=0,0,0,0<br />&nbsp; &nbsp; local tokill=true<br />&nbsp; &nbsp; local row={}<br />&nbsp; &nbsp; local result_str=&quot;&quot;<br />&nbsp; &nbsp; for i=0,getNumberOf(&quot;stop_orders&quot;),1 do<br />&nbsp; &nbsp; &nbsp; &nbsp; row=getItem(&quot;stop_orders&quot;,i)<br />&nbsp; &nbsp; &nbsp; &nbsp; tokill=false<br />&nbsp; &nbsp; &nbsp; &nbsp; --toLog(log,&quot;Row &quot;..i..&quot; onum=&quot;..row.ordernum)<br />&nbsp; &nbsp; &nbsp; &nbsp; if stoporderflags2table(row.flags).active then<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; tokill=true<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; --toLog(log,&quot;acitve&quot;)<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if table_mask~=nil then<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; for key,val in pairs(table_mask) do<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; --toLog(log,&quot;check key=&quot;..key..&quot; val=&quot;..val)<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; --toLog(log,&quot;strlowe=&quot;..string.lower(key)..&quot; row=&quot;..row[string.lower(key)]..&quot; tbl=&quot;..val)<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if row[string.lower(key)]~=val then<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; tokill=false<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; --toLog(log,&quot;false cond. t=&quot;..table_mask.key..&quot; row=&quot;..row[string.lower(key)])<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; break<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; end<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; end<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; end<br />&nbsp; &nbsp; &nbsp; &nbsp; end<br />&nbsp; &nbsp; &nbsp; &nbsp; if tokill then<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; --toLog(log,&quot;kill onum&quot;..row.ordernum)<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; res,ms=killStopOrder(tostring(row.ordernum),row.seccode,row.class_code)<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; result_num=result_num+1<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; --toLog(log,ms)<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if res then<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; result_str=result_str..row.ordernum..&quot;,&quot;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; else<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; result_str=result_str..&quot;!&quot;..row.ordernum..&quot;,&quot;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; end<br />&nbsp; &nbsp; &nbsp; &nbsp; end<br />&nbsp; &nbsp; end<br />&nbsp; &nbsp; return true,&quot;QL.killAllStopOrders(): Sended &quot;..result_num..&quot; transactions. Ordernums:&quot;..result_str<br />end</p><p>Фукнция из библиотеки QL. [url=http://forum.qlua.org/topic5.html]Ссылка[/url]</p>]]></content>
			<author>
				<name><![CDATA[patch_ua]]></name>
				<uri>https://quik2dde.ru/profile.php?id=93</uri>
			</author>
			<updated>2013-04-23T08:23:42Z</updated>
			<id>https://quik2dde.ru/viewtopic.php?pid=295#p295</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: как отменить стоп-заявки на forts]]></title>
			<link rel="alternate" href="https://quik2dde.ru/viewtopic.php?pid=294#p294" />
			<content type="html"><![CDATA[<div class="codebox"><pre><code>function KillAllStops(ClassCode,SecCode)

    local ord = &quot;stop_orders&quot;
    for i=0,getNumberOf(ord) do
        local t=getItem(ord, i)
        if t ~= nil and type(t) == &quot;table&quot; then
            if( t.seccode == SecCode and orderflags2table(t.flags).active == 1) then
                local transaction={
                    [&quot;TRANS_ID&quot;]=tostring(math.random(2000000000)),
                    [&quot;ACTION&quot;]=&quot;KILL_STOP_ORDER&quot;,
                    [&quot;CLASSCODE&quot;]=ClassCode,
                    [&quot;SECCODE&quot;]=SecCode,
                    [&quot;STOP_ORDER_KEY&quot;]=tostring(t.ordernum),
                }
                local res=sendTransaction(transaction)
                if res~=&quot;&quot; then
                    return nil, &quot;qlib.KillAllStops():&quot;..res
                else
                    return trans_id, res
                end    
            end
        end
    end    
   
end</code></pre></div>]]></content>
			<author>
				<name><![CDATA[sam]]></name>
				<uri>https://quik2dde.ru/profile.php?id=90</uri>
			</author>
			<updated>2013-04-23T07:02:25Z</updated>
			<id>https://quik2dde.ru/viewtopic.php?pid=294#p294</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[как отменить стоп-заявки на forts]]></title>
			<link rel="alternate" href="https://quik2dde.ru/viewtopic.php?pid=293#p293" />
			<content type="html"><![CDATA[<p>Как отменить все стоп-заявки на forts? Я написал функцию, где ACTION равно KILL_ALL_STOP_ORDERS, но она почему-то неработает, вообще никакой реакции.</p>]]></content>
			<author>
				<name><![CDATA[burunduk]]></name>
				<uri>https://quik2dde.ru/profile.php?id=115</uri>
			</author>
			<updated>2013-04-22T15:35:58Z</updated>
			<id>https://quik2dde.ru/viewtopic.php?pid=293#p293</id>
		</entry>
</feed>
