<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Forex Software — Definition of 'rising']]></title>
	<link rel="self" href="https://forexsb.com/forum/feed/atom/topic/2878/" />
	<updated>2011-12-23T17:18:26Z</updated>
	<generator>PunBB</generator>
	<id>https://forexsb.com/forum/topic/2878/definition-of-rising/</id>
		<entry>
			<title type="html"><![CDATA[Re: Definition of 'rising']]></title>
			<link rel="alternate" href="https://forexsb.com/forum/post/11967/#p11967" />
			<content type="html"><![CDATA[<div class="codebox"><pre><code>protected bool OscillatorLogic(int iFirstBar, int iPrvs, double[] adIndValue, double dLevelLong, double dLevelShort, ref IndicatorComp indCompLong, ref IndicatorComp indCompShort, IndicatorLogic indLogic)
        {
            double dSigma = Sigma();
 
            switch (indLogic)
            {
                case IndicatorLogic.The_indicator_rises:
                    for (int iBar = iFirstBar; iBar &lt; Bars; iBar++)
                    {
                        int  iCurrBar  = iBar - iPrvs;
                        int  iBaseBar  = iCurrBar - 1;
                        bool bIsHigher = adIndValue[iCurrBar] &gt; adIndValue[iBaseBar];
 
                        if (!isDescreteValues)  // Aroon oscillator uses bIsDescreteValues = true
                        {
                            bool bNoChange = true;
                            while (Math.Abs(adIndValue[iCurrBar] - adIndValue[iBaseBar]) &lt; dSigma &amp;&amp; bNoChange &amp;&amp; iBaseBar &gt; iFirstBar)
                            {
                                bNoChange = (bIsHigher == (adIndValue[iBaseBar + 1] &gt; adIndValue[iBaseBar]));
                                iBaseBar--;
                            }
                        }
 
                        indCompLong.Value[iBar]  = adIndValue[iBaseBar] &lt; adIndValue[iCurrBar] - dSigma ? 1 : 0;
                        indCompShort.Value[iBar] = adIndValue[iBaseBar] &gt; adIndValue[iCurrBar] + dSigma ? 1 : 0;
                    }
                    break;
 
                case IndicatorLogic.The_indicator_falls:
                    for (int iBar = iFirstBar; iBar &lt; Bars; iBar++)
                    {
                        int  iCurrBar  = iBar - iPrvs;
                        int  iBaseBar  = iCurrBar - 1;
                        bool bIsHigher = adIndValue[iCurrBar] &gt; adIndValue[iBaseBar];
 
                        if (!isDescreteValues)  // Aroon oscillator uses bIsDescreteValues = true
                        {
                            bool bNoChange = true;
                            while (Math.Abs(adIndValue[iCurrBar] - adIndValue[iBaseBar]) &lt; dSigma &amp;&amp; bNoChange &amp;&amp; iBaseBar &gt; iFirstBar)
                            {
                                bNoChange = (bIsHigher == (adIndValue[iBaseBar + 1] &gt; adIndValue[iBaseBar]));
                                iBaseBar--;
                            }
                        }
 
                        indCompLong.Value[iBar]  = adIndValue[iBaseBar] &gt; adIndValue[iCurrBar] + dSigma ? 1 : 0;
                        indCompShort.Value[iBar] = adIndValue[iBaseBar] &lt; adIndValue[iCurrBar] - dSigma ? 1 : 0;
                    }
                    break;</code></pre></div><p>I&#039;ve experienced that FSB&#039;s MACD and MT&#039;s MACD are not matching indis, before you made your test did you make sure you were comparing apples to apples?</p>]]></content>
			<author>
				<name><![CDATA[footon]]></name>
				<uri>https://forexsb.com/forum/user/1242/</uri>
			</author>
			<updated>2011-12-23T17:18:26Z</updated>
			<id>https://forexsb.com/forum/post/11967/#p11967</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Definition of 'rising']]></title>
			<link rel="alternate" href="https://forexsb.com/forum/post/11965/#p11965" />
			<content type="html"><![CDATA[<p>Hello,</p><p>what does the term rising in the description of the opening logic of some indicators exactly mean?</p><p>I&#039;m trying to verify the backtesting results of FSB by backtesting with the same data converted as fxt-files (and therefore tick data) with the mt4 backtester. </p><p>I backtested the following simple strategy:</p><p>entry: bar opening + macd histogram (exponential, close, simple, 26, 12, 9) rising <br />exit: with bar closing + macd histogram falling</p><p>Now I try to implement this with MQL Editor and defined rising/falling as a positive/negative difference to the last MACD histogram value.<br />example mql4 code: <br />last_macd=iMACD(Symbol(), 0, 12, 26, 9, PRICE_CLOSE, MODE_MAIN, 1);</p><p>The results differ very much from the results in FSB concerning entry and exits of the trades. So I need to know how you define rising and falling.</p><p>Thanks.</p>]]></content>
			<author>
				<name><![CDATA[Peter83]]></name>
				<uri>https://forexsb.com/forum/user/5248/</uri>
			</author>
			<updated>2011-12-23T16:56:15Z</updated>
			<id>https://forexsb.com/forum/post/11965/#p11965</id>
		</entry>
</feed>
