<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[QUIK -> DDE &mdash; Fisher]]></title>
		<link>https://quik2dde.ru/viewtopic.php?id=94</link>
		<atom:link href="https://quik2dde.ru/extern.php?action=feed&amp;tid=94&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[Недавние сообщения в теме «Fisher».]]></description>
		<lastBuildDate>Mon, 06 Jul 2020 10:08:18 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: Fisher]]></title>
			<link>https://quik2dde.ru/viewtopic.php?pid=2788#p2788</link>
			<description><![CDATA[<p>Скопировал указанные коды в файлы os.lua и tech.lua и разместил их в C:\QuikFinam\Include. Код Fisher.lua поместил в папку LuaIndicators. Не работает. В чем мой косяк? Выдает ошибку &quot;C:\QuikFinam\Include\os.lua:36: attempt to perform arithmetic on field &#039;?&#039; (a nil value)&quot;</p>]]></description>
			<author><![CDATA[null@example.com (ASSV)]]></author>
			<pubDate>Mon, 06 Jul 2020 10:08:18 +0000</pubDate>
			<guid>https://quik2dde.ru/viewtopic.php?pid=2788#p2788</guid>
		</item>
		<item>
			<title><![CDATA[Re: Fisher]]></title>
			<link>https://quik2dde.ru/viewtopic.php?pid=572#p572</link>
			<description><![CDATA[<p>Фишер - это осцилятор, в основу которого заложено предположение о гаусовом распределении цены. Можно погуглить картинки, можно опять же в квике и посмотреть что там рисуется, думаю все понятно будет. В файле tech из необходимого в данном случае лежит только это</p><div class="codebox"><pre><code>function dValue(index, v_type) 
    v_type = v_type or &quot;C&quot; 
    if v_type == &quot;O&quot; then 
        return O(index) 
    elseif v_type ==&quot;H&quot; then 
        return H(index) 
    elseif v_type ==&quot;L&quot; then 
        return L(index) 
    elseif v_type == &quot;C&quot; then 
        return C(index) 
    elseif v_type == &quot;V&quot; then 
        return V(index) 
    elseif v_type == &quot;M&quot; then 
        return (H(index) + L(index))/2 
    elseif v_type == &quot;T&quot; then 
        return (H(index) + L(i)+C(index))/3 
    elseif v_type == &quot;W&quot; then 
        return (H(index) + L(index)+2*C(index))/4 
    elseif v_type == &quot;F&quot; then 
        return (H(index) + L(index)+2*O(index))/4 
    else 
        return C(i)
    end 
    return 0 
end </code></pre></div><p>А в os.lua как раз нужно затолкать первый кусок кода с функцией FISHER и прочими.<br />Тогда все должно работать.</p>]]></description>
			<author><![CDATA[null@example.com (jestpounder)]]></author>
			<pubDate>Thu, 03 Apr 2014 17:56:49 +0000</pubDate>
			<guid>https://quik2dde.ru/viewtopic.php?pid=572#p572</guid>
		</item>
		<item>
			<title><![CDATA[Re: Fisher]]></title>
			<link>https://quik2dde.ru/viewtopic.php?pid=571#p571</link>
			<description><![CDATA[<p>Большое вам спасибо за предоставленный код!<br />А можно кратенько про сами индикаторы, примеры картинок?</p><p>И еще. Вот эти файлы tech.lua и os.lua - что в них?</p>]]></description>
			<author><![CDATA[null@example.com (admin)]]></author>
			<pubDate>Thu, 03 Apr 2014 15:42:31 +0000</pubDate>
			<guid>https://quik2dde.ru/viewtopic.php?pid=571#p571</guid>
		</item>
		<item>
			<title><![CDATA[Fisher]]></title>
			<link>https://quik2dde.ru/viewtopic.php?pid=568#p568</link>
			<description><![CDATA[<p>Фишер, например</p><div class="codebox"><pre><code>dofile(getWorkingFolder() .. &quot;\\Include\\tech.lua&quot;) 

function FISHER() 
    local cache_fisher={} 
    local cache_value={}
    return function(ind, p, v_t)
      local dv = dValue 
      local period = p 
      local v_type = v_t  
      local index = ind
      local price=dv(index,v_type);
      local MaxH = price;
      local MinL = price;
      local k =0
      local pr=0
      local mx = high
      local mn = low
      local value = 0
      local result = 0
      
      if index == 1 then 
            cache_fisher = {} 
            cache_value = {} 
      end 
      if index &lt; period then 
            cache_fisher[index] = 0 
            cache_value[index] = 0 
            return nil 
      end 
      
      MaxH = mx(index-period,index,v_type) 
      MinL = mn(index-period,index,v_type) 
      local res=MaxH-MinL
      
      if (res) then 
        value=0.33*2.0*((price-MinL)/res-0.5)+0.67*cache_value[index-1];
      else 
        value=0
      end

      if(value&gt;(0.9999)) then value= (0.9999) end
      if(value&lt;(-0.9999)) then value= (-0.9999) end
         
      result = 0.5*math.log((1+value)/(1-value))+0.5*cache_fisher[index-1]
      
      cache_value[index]=value   
      cache_fisher[index]= result
      return result

    end 
end 

function high(_start, _end, v_type) 
    local H=dValue(_start, v_type)  
    for i = _start+1, _end do 
        if(dValue(i, v_type)&gt;H) then
            H=dValue(i, v_type) 
        end
    end 
    return H
end 


function low(_start, _end, v_type) 
    local L=dValue(_start, v_type) 
    for i = _start+1, _end do 
        if(dValue(i, v_type)&lt;L) then
            L=dValue(i, v_type) 
        end
    end 
    return L
end </code></pre></div><div class="codebox"><pre><code>dofile(getWorkingFolder() .. &quot;\\Include\\os.lua&quot;) 

Settings = 
{
    Name = &quot;Fisher&quot;,
    period = 27,
    value_type = &quot;M&quot;, 
    line=   { 
                {
                 Name = &quot;Fisher&quot;,
                 Color = RGB(180, 200, 240),
                 Type = TYPE_HISTOGRAM,
                 Width = 2 
                }
            } 
} 

function Init() 
    myFisher = FISHER()
    return 1
end

function OnCalculate(index)  
    local Fish = myFisher(index, Settings.period,Settings.value_type)      
    return Fish
end</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (jestpounder)]]></author>
			<pubDate>Wed, 02 Apr 2014 10:26:39 +0000</pubDate>
			<guid>https://quik2dde.ru/viewtopic.php?pid=568#p568</guid>
		</item>
	</channel>
</rss>
