<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[Forex Software — Math.Min ,max question]]></title>
		<link>https://forexsb.com/forum/topic/4070/mathmin-max-question/</link>
		<atom:link href="https://forexsb.com/forum/feed/rss/topic/4070/" rel="self" type="application/rss+xml" />
		<description><![CDATA[The most recent posts in Math.Min ,max question.]]></description>
		<lastBuildDate>Wed, 13 Mar 2013 21:02:16 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: Math.Min ,max question]]></title>
			<link>https://forexsb.com/forum/post/18786/#p18786</link>
			<description><![CDATA[<p>Seems to be right. Although I would use the main for loop like in my previous post:<br /></p><div class="codebox"><pre><code>for (int iBar = iFirstBar; iBar &lt; Bars; iBar++)</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (footon)]]></author>
			<pubDate>Wed, 13 Mar 2013 21:02:16 +0000</pubDate>
			<guid>https://forexsb.com/forum/post/18786/#p18786</guid>
		</item>
		<item>
			<title><![CDATA[Re: Math.Min ,max question]]></title>
			<link>https://forexsb.com/forum/post/18785/#p18785</link>
			<description><![CDATA[<p>thanks fotoon </p><p>So i can write the code for buy setup as follow <br /></p><div class="codebox"><pre><code>public override void Calculate(SlotTypes slotType)
        {
            // Reading the parameters
            int iFirstBar = 16;

            double[] adUp = new double[Bars];
            double[] adDn = new double[Bars];

            for (int iBar = 16; iBar &lt; Bars - 1; iBar++)
            {
                // Long trade
                //1. Today’s low is lower than the previous 15 lows.
                double dMin = double.MaxValue;
                for (int i = 1; i &lt; 16; i++)
                {
                    if (Low[iBar - i] &lt; dMin) dMin = Low[iBar - i];
                }

                if (Low[iBar - 1] &lt; dMin)
                    adUp[iBar] = 1;</code></pre></div><p>&nbsp; </p><p>Is that right !!!!!</p>]]></description>
			<author><![CDATA[null@example.com (ahmedalhoseny)]]></author>
			<pubDate>Wed, 13 Mar 2013 20:53:31 +0000</pubDate>
			<guid>https://forexsb.com/forum/post/18785/#p18785</guid>
		</item>
		<item>
			<title><![CDATA[Re: Math.Min ,max question]]></title>
			<link>https://forexsb.com/forum/post/18783/#p18783</link>
			<description><![CDATA[<p>You have to loop through all 15 bars to find the low. </p><p>I&#039;d do something like this, based on Donchian Channel indi:<br /></p><div class="codebox"><pre><code>for (int iBar = iFirstBar; iBar &lt; Bars; iBar++)
            {
                
                double dMin = double.MaxValue;
                for (int i = 1; i &lt; 16; i++)
                {
                    
                    if (Low[iBar - i]  &lt; dMin) dMin = Low[iBar - i];
                
                }
                
                 if (Low[iBar-1] &lt; dMin)
                    long[iBar]=1;
             }</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (footon)]]></author>
			<pubDate>Wed, 13 Mar 2013 20:28:06 +0000</pubDate>
			<guid>https://forexsb.com/forum/post/18783/#p18783</guid>
		</item>
		<item>
			<title><![CDATA[Math.Min ,max question]]></title>
			<link>https://forexsb.com/forum/post/18782/#p18782</link>
			<description><![CDATA[<p>if Today’s low is lower than the previous 15 lows then buy </p><p>what is the mistake <br /></p><div class="codebox"><pre><code>public override void Calculate(SlotTypes slotType)
        {
            // Reading the parameters
            int iFirstBar = 16;

            double[] adUp = new double[Bars];
        double[] adDn = new double[Bars];

            for (int iBar = 16; iBar &lt; Bars - 1; iBar++)
            {
                // Long trade
                                //1. Today’s low is lower than the previous 15 lows.
                if (Low[iBar - 15] &lt; Math.Min(Low[iBar - 1], Low[iBar - 15]))
                adUp[iBar] = 1;</code></pre></div><br /><p>Thanks in advance</p>]]></description>
			<author><![CDATA[null@example.com (ahmedalhoseny)]]></author>
			<pubDate>Wed, 13 Mar 2013 19:56:35 +0000</pubDate>
			<guid>https://forexsb.com/forum/post/18782/#p18782</guid>
		</item>
	</channel>
</rss>
