<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[QUIK -> DDE &mdash; getNumCandle Problem]]></title>
	<link rel="self" href="https://quik2dde.ru/extern.php?action=feed&amp;tid=164&amp;type=atom" />
	<updated>2015-08-11T19:05:22Z</updated>
	<generator>PunBB</generator>
	<id>https://quik2dde.ru/viewtopic.php?id=164</id>
		<entry>
			<title type="html"><![CDATA[Re: getNumCandle Problem]]></title>
			<link rel="alternate" href="https://quik2dde.ru/viewtopic.php?pid=1565#p1565" />
			<content type="html"><![CDATA[<div class="codebox"><pre><code>        get_bar(index)
        return MA_value</code></pre></div><p>Тут я просто поторопился, я в get_bar запрашивал значение которое будет возвращено только следующей строкой MA_value, т.е. по факту ошибка не в коде, а идентификатор присвоил своему индикатору, а не индикатору price.</p>]]></content>
			<author>
				<name><![CDATA[delphiec]]></name>
				<uri>https://quik2dde.ru/profile.php?id=280</uri>
			</author>
			<updated>2015-08-11T19:05:22Z</updated>
			<id>https://quik2dde.ru/viewtopic.php?pid=1565#p1565</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: getNumCandle Problem]]></title>
			<link rel="alternate" href="https://quik2dde.ru/viewtopic.php?pid=1564#p1564" />
			<content type="html"><![CDATA[<p>-</p>]]></content>
			<author>
				<name><![CDATA[sam063rus]]></name>
				<uri>https://quik2dde.ru/profile.php?id=228</uri>
			</author>
			<updated>2015-08-11T19:01:57Z</updated>
			<id>https://quik2dde.ru/viewtopic.php?pid=1564#p1564</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: getNumCandle Problem]]></title>
			<link rel="alternate" href="https://quik2dde.ru/viewtopic.php?pid=1562#p1562" />
			<content type="html"><![CDATA[<p>sam063rus Про табличные функции вы зря так, всё правильно считается через table.getn(), логическую ошибку допустил в другом месте.</p><p>P.S. С пониманием этих элементарных вещей всё норм)))</p>]]></content>
			<author>
				<name><![CDATA[delphiec]]></name>
				<uri>https://quik2dde.ru/profile.php?id=280</uri>
			</author>
			<updated>2015-08-11T18:56:59Z</updated>
			<id>https://quik2dde.ru/viewtopic.php?pid=1562#p1562</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: getNumCandle Problem]]></title>
			<link rel="alternate" href="https://quik2dde.ru/viewtopic.php?pid=1561#p1561" />
			<content type="html"><![CDATA[<p>Всё, нашел ошибку, помимо идентификатора, была одна логическая ошибка, тему можно закрывать, всем спасибо)))</p>]]></content>
			<author>
				<name><![CDATA[delphiec]]></name>
				<uri>https://quik2dde.ru/profile.php?id=280</uri>
			</author>
			<updated>2015-08-11T18:55:08Z</updated>
			<id>https://quik2dde.ru/viewtopic.php?pid=1561#p1561</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: getNumCandle Problem]]></title>
			<link rel="alternate" href="https://quik2dde.ru/viewtopic.php?pid=1559#p1559" />
			<content type="html"><![CDATA[<p>-</p>]]></content>
			<author>
				<name><![CDATA[sam063rus]]></name>
				<uri>https://quik2dde.ru/profile.php?id=228</uri>
			</author>
			<updated>2015-08-11T18:17:57Z</updated>
			<id>https://quik2dde.ru/viewtopic.php?pid=1559#p1559</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: getNumCandle Problem]]></title>
			<link rel="alternate" href="https://quik2dde.ru/viewtopic.php?pid=1558#p1558" />
			<content type="html"><![CDATA[<p>Странно, но добавление идентификатора не помогло.</p>]]></content>
			<author>
				<name><![CDATA[delphiec]]></name>
				<uri>https://quik2dde.ru/profile.php?id=280</uri>
			</author>
			<updated>2015-08-11T18:05:44Z</updated>
			<id>https://quik2dde.ru/viewtopic.php?pid=1558#p1558</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: getNumCandle Problem]]></title>
			<link rel="alternate" href="https://quik2dde.ru/viewtopic.php?pid=1557#p1557" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>delphiec пишет:</cite><blockquote><p>Я так понимаю идет речь о поле идентификатор на скриншоте<br />Можно его как-то задавать автоматически при подключении своего индикатора?</p></blockquote></div><p>Да, именно про него.<br />Программно изменять и назначать, увы, нельзя. Но было помнится пожелание на форуме квика.</p>]]></content>
			<author>
				<name><![CDATA[korovin]]></name>
				<uri>https://quik2dde.ru/profile.php?id=140</uri>
			</author>
			<updated>2015-08-11T17:22:29Z</updated>
			<id>https://quik2dde.ru/viewtopic.php?pid=1557#p1557</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: getNumCandle Problem]]></title>
			<link rel="alternate" href="https://quik2dde.ru/viewtopic.php?pid=1556#p1556" />
			<content type="html"><![CDATA[<p>Я так понимаю идет речь о поле идентификатор на скриншоте<br />[url]https://cloud.mail.ru/public/mZ7kNwF56DaC/img-2015-08-12-00-01-44.png[/url]</p><p>Можно его как-то задавать автоматически при подключении своего индикатора?</p>]]></content>
			<author>
				<name><![CDATA[delphiec]]></name>
				<uri>https://quik2dde.ru/profile.php?id=280</uri>
			</author>
			<updated>2015-08-11T16:02:41Z</updated>
			<id>https://quik2dde.ru/viewtopic.php?pid=1556#p1556</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: getNumCandle Problem]]></title>
			<link rel="alternate" href="https://quik2dde.ru/viewtopic.php?pid=1555#p1555" />
			<content type="html"><![CDATA[<p>Идентификатор графика для функции getCandlesByIndex задаётся в настройках графика на вкладке &quot;Дополнительно&quot;.</p>]]></content>
			<author>
				<name><![CDATA[CyberTrader]]></name>
				<uri>https://quik2dde.ru/profile.php?id=248</uri>
			</author>
			<updated>2015-08-11T15:21:50Z</updated>
			<id>https://quik2dde.ru/viewtopic.php?pid=1555#p1555</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: getNumCandle Problem]]></title>
			<link rel="alternate" href="https://quik2dde.ru/viewtopic.php?pid=1554#p1554" />
			<content type="html"><![CDATA[<p>в луа 5.1 (в квике именно такой) нет функции table.getn<br />в вашем случае так:<br />ltable = t[0].close</p>]]></content>
			<author>
				<name><![CDATA[kalikazandr]]></name>
				<uri>https://quik2dde.ru/profile.php?id=208</uri>
			</author>
			<updated>2015-08-11T15:06:49Z</updated>
			<id>https://quik2dde.ru/viewtopic.php?pid=1554#p1554</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[getNumCandle Problem]]></title>
			<link rel="alternate" href="https://quik2dde.ru/viewtopic.php?pid=1553#p1553" />
			<content type="html"><![CDATA[<p>Народ подскажите в чем может быть проблема?<br />В строке ltable=table.getn(t)&nbsp; <br />ltable = 0</p><p>Пробовал разные варианты и всегда пустая таблица.</p><br /><div class="codebox"><pre><code>Settings= { 
            Name = &quot;IndicatorName&quot;, 
            period = 5, 
            line = { 
                        { 
                        Name = &quot;IndicatorMA&quot;, 
                        Color = RGB(0, 0, 255), 
                        Type = TYPE_LINE, 
                        Width = 2 
                        } 
                   }
          } 
          

function Init() 
    ---------------------------------------
    require &quot;DelphianTransactor&quot;
    internal.sqlConnect(&quot;sqlite-3&quot;,&quot;synDicator3.sqlite&quot;)
    ---------------------------------------
    MA_value=0
    
    return 1 
end 

function OnDestroy()
    internal.sqlDisconnect()
end

function get_bar(index)
    t={}
    n = getNumCandles (Settings.Name)
    t,_,_=getCandlesByIndex(Settings.Name,0,n-1,1)
    ltable=table.getn(t)
    message(tostring(ltable,1),1)
end

function OnCalculate(index) 
    if index &lt; Settings.period then 
        return nil 
    else 
        local sum = 0 
        for i = index-Settings.period+1, index do
            sum = sum +C(i) 
        end 
        MA_value=sum/Settings.period
        get_bar(index)
        return MA_value
    end
end</code></pre></div>]]></content>
			<author>
				<name><![CDATA[delphiec]]></name>
				<uri>https://quik2dde.ru/profile.php?id=280</uri>
			</author>
			<updated>2015-08-11T14:49:01Z</updated>
			<id>https://quik2dde.ru/viewtopic.php?pid=1553#p1553</id>
		</entry>
</feed>
