<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Cubesteak Central</title>
	<atom:link href="http://www.cubesteak.net/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.cubesteak.net</link>
	<description>Forex Trading with MetaTrader 4</description>
	<lastBuildDate>Thu, 16 Nov 2006 12:23:36 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>nPipLines</title>
		<link>http://www.cubesteak.net/2006/11/npiplines/</link>
		<comments>http://www.cubesteak.net/2006/11/npiplines/#comments</comments>
		<pubDate>Thu, 16 Nov 2006 12:10:33 +0000</pubDate>
		<dc:creator>cubesteak</dc:creator>
				<category><![CDATA[MT4 Indicators]]></category>

		<guid isPermaLink="false">http://www.cubesteak.net/2006/11/npiplines/</guid>
		<description><![CDATA[Someone on the MT E and I Yahoo group requested an indicator that drew horizontal lines on the screen every 25 pips.  I figured I could bang that out in no time and started to make this indicator.  I called it nPipLines because the number of pips between lines is configurable.
Anyway, this was [...]]]></description>
			<content:encoded><![CDATA[<p>Someone on the <a target="_blank" title="MTE_and_I" href="http://finance.groups.yahoo.com/group/MetaTrader_Experts_and_Indicators/">MT E and I Yahoo group</a> requested an indicator that drew horizontal lines on the screen every 25 pips.  I figured I could bang that out in no time and started to make this indicator.  I called it <strong>nPipLines</strong> because the number of pips between lines is configurable.</p>
<p>Anyway, this was a lot more complicated than I originally figured.  There&#8217;s a lot of math to slice and dice the current price to make sure that the lines are actually straddled around your current position.</p>
<p>The indicator has several configurable options, including number of lines to draw, the pip gap between the lines, the line size, style and color, as well as if you&#8217;d like the lines to continuously update as price goes up and down.  This continuous option seems a bit silly to me, as it does a lot of work each tick for really no reason, but some folks may want it to work that way.  By default, this is set to false.</p>
<p>Here&#8217;s a snapshot:</p>
<p><img alt="npiplines.gif" title="npiplines.gif" src="http://www.cubesteak.net/images/npiplines.gif" /></p>
<p>Get this indicator:</p>
<p><img border="0" align="left" alt="MetaQuotes 4 Language File" title="MetaQuotes 4 Language File" src="http://www.cubesteak.net/images/MQ4.gif" /><a title="nPipLines.mq4" href="http://www.cubesteak.net/downloads/nPipLines.mq4">nPipLines.mq4<br />
</a><a title="nPipLines.zip" href="http://www.cubesteak.net/downloads/nPipLines.zip">nPipLines.zip</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.cubesteak.net/2006/11/npiplines/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Elder&#8217;s Safe Zone</title>
		<link>http://www.cubesteak.net/2006/11/elders-safe-zone/</link>
		<comments>http://www.cubesteak.net/2006/11/elders-safe-zone/#comments</comments>
		<pubDate>Wed, 01 Nov 2006 10:30:51 +0000</pubDate>
		<dc:creator>cubesteak</dc:creator>
				<category><![CDATA[MT4 Indicators]]></category>

		<guid isPermaLink="false">http://www.cubesteak.net/2006/11/elders-safe-zone/</guid>
		<description><![CDATA[I found a reference to Elder&#8217;s Safe Zone, which is a trailing stop methodology attributed to Alex Elder, the author of The Legendary Approach to Trading for a Living.  Since I&#8217;ve read his book, I was intrigued.
The reference that I found had the code for an indicator from MT3, so I recoded it for MT4.  [...]]]></description>
			<content:encoded><![CDATA[<p>I found a <a target="_blank" title="StrategyBuilderLink" href="http://www.strategybuilderfx.com/showpost.php?p=123371&#038;postcount=1">reference</a> to Elder&#8217;s Safe Zone, which is a trailing stop methodology attributed to Alex Elder, the author of <em>The Legendary Approach to Trading for a Living</em>.  Since I&#8217;ve read his book, I was intrigued.</p>
<p>The reference that I found had the code for an indicator from MT3, so I recoded it for MT4.  I don&#8217;t know how useful it is yet, but I thought I would post and update it if necessary.</p>
<p>Here&#8217;s a snapshot:</p>
<p><img alt="eldersafezone.gif" title="eldersafezone.gif" src="http://www.cubesteak.net/images/eldersafezone.gif" /></p>
<p>Get this indicator:</p>
<p><img border="0" align="left" title="MetaQuotes 4 Language File" alt="MetaQuotes 4 Language File" src="http://www.cubesteak.net/images/MQ4.gif" /><a title="3FoldTradingHoursSeparateWindow.mq4" href="http://www.cubesteak.net/downloads/3FoldTradingHoursSeparateWindow.mq4"> </a><a title="EldersSafeZone.mq4" href="http://www.cubesteak.net/downloads/EldersSafeZone.mq4">EldersSafeZone.mq4</a><br />
<a title="EldersSafeZone.zip" href="http://www.cubesteak.net/downloads/EldersSafeZone.zip">EldersSafeZone.zip</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.cubesteak.net/2006/11/elders-safe-zone/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
		<item>
		<title>Moving Average of Volume Bonanza</title>
		<link>http://www.cubesteak.net/2006/10/moving-average-of-volume-bonanza/</link>
		<comments>http://www.cubesteak.net/2006/10/moving-average-of-volume-bonanza/#comments</comments>
		<pubDate>Wed, 01 Nov 2006 00:11:44 +0000</pubDate>
		<dc:creator>cubesteak</dc:creator>
				<category><![CDATA[MT4 Indicators]]></category>

		<guid isPermaLink="false">http://www.cubesteak.net/2006/10/moving-average-of-volume-bonanza/</guid>
		<description><![CDATA[Ever want to have a MA of volume?
Some indicators out there would provide such a thing, but didn&#8217;t go as far as I would have liked.  So, I put hacked up someone else&#8217;s MA of Volume indicator and added a JMA option, as well as a dynamically changing level that is based upon a configurable [...]]]></description>
			<content:encoded><![CDATA[<p>Ever want to have a MA of volume?</p>
<p>Some indicators out there would provide such a thing, but didn&#8217;t go as far as I would have liked.  So, I put hacked up someone else&#8217;s MA of Volume indicator and added a JMA option, as well as a dynamically changing level that is based upon a configurable number of days average.</p>
<p>Ever want to quickly see if the MA of volume is high or low based on the last 120 days?  30 days?  Now you can!</p>
<p>Here&#8217;s a snapshot:</p>
<p><img alt="mavolume.gif" title="mavolume.gif" src="http://www.cubesteak.net/images/mavolume.gif" /></p>
<p>Get this indicator:</p>
<p><img border="0" align="left" alt="MetaQuotes 4 Language File" title="MetaQuotes 4 Language File" src="http://www.cubesteak.net/images/MQ4.gif" /><a title="3FoldTradingHoursSeparateWindow.mq4" href="http://www.cubesteak.net/downloads/3FoldTradingHoursSeparateWindow.mq4"> </a><a title="MAVolumeWithJMA.mq4" href="http://www.cubesteak.net/downloads/MAVolumeWithJMA.mq4">MAVolumeWithJMA.mq4</a><br />
<a title="MAVolumeWithJMA.zip" href="http://www.cubesteak.net/downloads/MAVolumeWithJMA.zip">MAVolumeWithJMA.zip</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.cubesteak.net/2006/10/moving-average-of-volume-bonanza/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>3 Fold Trading Hours in a Separate Window</title>
		<link>http://www.cubesteak.net/2006/10/3-fold-trading-hours-in-a-separate-window/</link>
		<comments>http://www.cubesteak.net/2006/10/3-fold-trading-hours-in-a-separate-window/#comments</comments>
		<pubDate>Tue, 31 Oct 2006 06:27:04 +0000</pubDate>
		<dc:creator>cubesteak</dc:creator>
				<category><![CDATA[MT4 Indicators]]></category>

		<guid isPermaLink="false">http://www.cubesteak.net/2006/10/3-fold-trading-hours-in-a-separate-window/</guid>
		<description><![CDATA[In a previous post, I made a little time filter indicator that simply was a visual reminder if you should be trading or not based upon three configurable times.  It simply used a comment in the chart window to convey the information.
In that post, I made the offer to whip up a version that [...]]]></description>
			<content:encoded><![CDATA[<p>In a previous post, I made a little time filter indicator that simply was a visual reminder if you should be trading or not based upon three configurable times.  It simply used a comment in the chart window to convey the information.</p>
<p>In that post, I made the offer to whip up a version that had its own indicator window, if anyone thought it would be useful.  Someone (Barry) did, so now we have three flavors of 3 Fold Trading Hours.</p>
<p><strong><a title="Orignial" href="http://www.cubesteak.net/2006/08/3-fold-trading-hours/">Original</a>:    </strong>Visual reminder via a chart comment<br />
<strong>New:            </strong>Visual reminder via a new indicator window (available below)<br />
<strong><a title="EA Time Filter" href="http://www.cubesteak.net/2006/08/3-fold-trading-hours-filter-for-ea/">Also</a>:          </strong> Time filter for an Expert Adviser to actually stop trading from happening</p>
<p>This new indicator also displays a bit more information as well, like listing out the filter times, and if they are used or not.  The time filter logic is taken from the EA version, so that you can now filter by hours and minutes, not just hours, as with the original.</p>
<p>Here&#8217;s a snapshot:</p>
<p><img title="3fthours.gif" alt="3fthours.gif" src="http://www.cubesteak.net/images/3fthours.gif" /></p>
<p>Get this indicator:</p>
<p><img border="0" align="left" title="MetaQuotes 4 Language File" alt="MetaQuotes 4 Language File" src="http://www.cubesteak.net/images/MQ4.gif" /><a title="3FoldTradingHoursSeparateWindow.mq4" href="http://www.cubesteak.net/downloads/3FoldTradingHoursSeparateWindow.mq4"> 3FoldTradingHoursSeparateWindow.mq4</a><br />
<a title="Zip" target="_blank" href="http://www.cubesteak.net/downloads/3FoldTradingHoursSeparateWindow.zip">3FoldTradingHoursSeparateWindow.zip</a><br />
<a title="3FoldTradingHoursSeparateWindow.zip" href="http://www.cubesteak.net/downloads/3FoldTradingHoursSeparateWindow.zip" /></p>
]]></content:encoded>
			<wfw:commentRss>http://www.cubesteak.net/2006/10/3-fold-trading-hours-in-a-separate-window/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Adding a Magic Number to an EA</title>
		<link>http://www.cubesteak.net/2006/10/adding-a-magic-number-to-an-ea/</link>
		<comments>http://www.cubesteak.net/2006/10/adding-a-magic-number-to-an-ea/#comments</comments>
		<pubDate>Fri, 27 Oct 2006 07:04:43 +0000</pubDate>
		<dc:creator>cubesteak</dc:creator>
				<category><![CDATA[MT4]]></category>
		<category><![CDATA[MT4 Tips]]></category>

		<guid isPermaLink="false">http://www.cubesteak.net/2006/10/adding-a-magic-number-to-an-ea/</guid>
		<description><![CDATA[Someone asked me if there was a manual on how to add a Magic Number to an EA.  Since I haven’t seen one, I put together the following basic steps
and thought that others may find it useful too.  These steps can also be used to verify that an EA properly uses a Magic [...]]]></description>
			<content:encoded><![CDATA[<p class="MsoNormal"><span style="font-size: 10pt; font-family: Arial; color: black">Someone asked me if there was a manual on how to add a Magic Number to an EA.  <span />Since I haven’t seen one, I put together the following basic steps<br />
and thought that others may find it useful too.  These steps can also be used to verify that an EA properly uses a Magic Number, as some don’t!  </span></p>
<p class="MsoNormal"><span style="font-size: 10pt; font-family: Arial; color: black">First off, to the completely uninitiated, a Magic Number is simply an arbitrary number that can be added to an EA that is used to uniquely identify trades that are made from that EA with an eye towards differentiating them from trades made by any other EA.  Without a Magic Number, a EA that closes all orders will not only close orders that it has made, but it will also close any orders made by a different EA, and it will even close orders that were made manually, as it has no way of telling which orders came from which EA.</span></p>
<p class="MsoNormal"><span style="font-size: 10pt; font-family: Arial; color: black">This obviously is not an optimal situation.  The Magic Number lets you differentiate these orders programatically so that you can run multiple EA&#8217;s on multiple charts from within the same MT4 instance and still be able to trade manually as well.<br />
</span></p>
<p class="MsoNormal"><span style="font-size: 10pt; font-family: Arial; color: black">Anyway, now on to the steps:</span></p>
<p class="MsoNormal"><span style="font-size: 10pt; font-family: Arial; color: black">1) On a global level in the EA add:</span></p>
<p class="MsoNormal"><span style="font-size: 10pt; font-family: Arial" /><span style="font-size: 10pt">int MagicNumber = 233423;  // where 233423 is any old number that is unique from any of your other running EA’s<br />
</span><span style="font-size: 10pt; font-family: Arial" /></p>
<p class="MsoNormal"><span style="font-size: 10pt; font-family: Arial">The easiest way to describe declaring on the &#8220;global level&#8221; of the EA is a variable that is declared outside of the</span><span style="font-size: 10pt"> Start, Init </span><span style="font-size: 10pt; font-family: Arial">and</span><span style="font-size: 10pt"> Deinit </span><span style="font-size: 10pt; font-family: Arial">functions</span><span style="font-size: 10pt">.  </span><span style="font-size: 10pt; font-family: Arial">The easiest way to ensure that you are on the global level of the EA is to put the</span><span style="font-size: 10pt"> MagicNumber </span><span style="font-size: 10pt; font-family: Arial">declaration immediately after the top comments and any</span><span style="font-size: 10pt"> #property, #include </span><span style="font-size: 10pt; font-family: Arial">or</span><span style="font-size: 10pt"> #import </span><span style="font-size: 10pt; font-family: Arial">statements and BEFORE the</span><span style="font-size: 10pt"> Init, Deinit </span><span style="font-size: 10pt; font-family: Arial">and</span><span style="font-size: 10pt"> Start </span><span style="font-size: 10pt; font-family: Arial">functions.</span><span style="font-size: 10pt"><br />
</span></p>
<p class="MsoNormal"><span style="font-size: 10pt; font-family: Arial">2) Next, make sure that the </span><span style="font-size: 10pt">OrderSend </span><span style="font-size: 10pt; font-family: Arial">function uses this magic number.  </span><span style="font-size: 10pt">OrderSend </span><span style="font-size: 10pt; font-family: Arial">uses the following form:</span><span style="font-size: 10pt" /></p>
<p class="MsoNormal"><span style="font-size: 10pt">int OrderSend( string symbol, int cmd, double volume, double price, int slippage, double stoploss, double takeprofit, string comment=NULL, int magic=0, datetime expiration=0, color arrow_color=CLR_NONE)</span></p>
<p class="MsoNormal"><span style="font-size: 10pt; font-family: Arial">So, you want to make sure that it is called with the </span><span style="font-size: 10pt">MagicNumber </span><span style="font-size: 10pt; font-family: Arial">in it, e.g:</span></p>
<p class="MsoNormal"><span style="font-size: 10pt">OrderSend(Symbol(),OP_BUY,1.0,Ask,2,10,20,&#8221;My Buy&#8221;,MagicNumber,0,Lime)</span></p>
<p class="MsoNormal"><span style="font-size: 10pt; font-family: Arial">3) Then, search the EA for each instance of </span><span style="font-size: 10pt">OrderClose, OrderModify </span><span style="font-size: 10pt; font-family: Arial">or</span><span style="font-size: 10pt"> OrderDelete.  </span><span style="font-size: 10pt; font-family: Arial">Usually these are sandwiched by at least one IF statement.  Add to that IF statement the following condition:  </span><span style="font-size: 10pt">(OrderMagicNumber() == MagicNumber)</span></p>
<p class="MsoNormal"><span style="font-size: 10pt; font-family: Arial">So, something like this:</span></p>
<p class="MsoNormal"><span style="font-size: 10pt">if (OrderSymbol == Symbol())<br />
{<br />
OrderClose(blah blah&#8230;);<br />
} </span></p>
<p class="MsoNormal"><span style="font-size: 10pt; font-family: Arial">Becomes:</span></p>
<p class="MsoNormal"><span style="font-size: 10pt">if (OrderSymbol == Symbol() &#038;&#038;<br />
OrderMagicNumber() == MagicNumber)<br />
{<br />
OrderClose(blah blah blah);<br />
}</span></p>
<p class="MsoNormal"><span style="font-size: 10pt; font-family: Arial">Voila!  Your EA now uses a magic number and should be able to trade with other EAs.</span></p>
<p class="MsoNormal"><span style="font-size: 10pt; font-family: Arial">Please note that any money management that an EA uses, like lot optimization based on available margin or equity, etc. will also &#8220;interfere&#8221; with each other.  This is either desirable or undesirable based upon how you want to trade with the specific EA&#8217;s. </span></p>
<p class="MsoNormal"><span style="font-size: 10pt; font-family: Arial">Hope that helps!</span></p>
]]></content:encoded>
			<wfw:commentRss>http://www.cubesteak.net/2006/10/adding-a-magic-number-to-an-ea/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>The FINAL word on EX4 decompilation&#8230;</title>
		<link>http://www.cubesteak.net/2006/10/the-final-word-on-ex4-decompilation/</link>
		<comments>http://www.cubesteak.net/2006/10/the-final-word-on-ex4-decompilation/#comments</comments>
		<pubDate>Sat, 21 Oct 2006 01:44:38 +0000</pubDate>
		<dc:creator>cubesteak</dc:creator>
				<category><![CDATA[MT4]]></category>

		<guid isPermaLink="false">http://www.cubesteak.net/2006/10/the-final-word-on-ex4-decompilation/</guid>
		<description><![CDATA[OK, the FINAL (I hope) word on decompiling EX4 files in the U.S.
If you want to refute this, please feel free (I would welcome the re-education), but don&#8217;t bother to unless you provide a URL or quote that explains a specific statute or law.
OK, here goes:
A copyright doesn&#8217;t forbid decompiling.  That&#8217;s why most software [...]]]></description>
			<content:encoded><![CDATA[<p>OK, the FINAL (I hope) word on decompiling EX4 files in the U.S.</p>
<p>If you want to refute this, please feel free (I would welcome the re-education), but don&#8217;t bother to unless you provide a URL or quote that explains a specific statute or law.</p>
<p>OK, here goes:</p>
<p>A copyright doesn&#8217;t forbid decompiling.  That&#8217;s why most software companies have a EULA (end user lic. agreement) that specifically cover things like reverse engineering, decompilation, etc as well as exactly HOW you can use the software.</p>
<p>This is a simple issue &#8211; if you decompile something, you aren&#8217;t breaking the law (unless you signed a EULA, in which case you are technically in breach of license and can be sued).  IF you choose to publish it, sell it, or do anything else with it that falls outside of &#8220;fair use&#8221; laws, then you are in breach of copyright.  This isn&#8217;t so different than the whole thing that is going on with music&#8230;  Saying you can&#8217;t decompile a .ex4 file is like saying you can&#8217;t rip a song from a CD to an MP3.  That&#8217;s not illegal (yet).</p>
<p>In fact, I personally believe that it would be difficult to enforce a copyright for most EA&#8217;s.  Why? Several reasons actually.</p>
<p>To quote <a title="Copyright on Wikipedia" target="_blank" href="http://en.wikipedia.org/wiki/Copyright">wikipedia</a>:</p>
<p>&#8220;Copyright law covers only the particular form or manner in which ideas or information have been manifested, the &#8220;form of material expression&#8221;. It is not designed or intended to cover the actual idea, concepts, facts, styles, or techniques which may be embodied in or represented by the copyright work.&#8221;</p>
<p>Most styles of trading have been done and are available in one form or another on many forums, so the &#8220;system&#8221; can&#8217;t be copyrighted.  MQL4 is a small enough language where just about EVERY way of doing anything with it is also in the public domain at this point, so most likely the &#8220;code&#8221; itself can&#8217;t be copyrighted.  That leaves the exact copying of the code in its entirety.  WHICH, frankly goes on and is encouraged left and right in most forums and is even done in this group.  Everybody puts the &#8220;copyright&#8221; statement in their code, yet then we post it to groups such as this or to online forums, freely encouraging people to copy it again and breach the copyright we just claimed.  How can one breach be distinguished from the &#8220;normal&#8221; breaches that are encouraged every day?  While ignorance of the law is no excuse, there is certainly plenty of precedence to say that the &#8220;copyright&#8221; statement in an EA isn&#8217;t really a &#8220;proper&#8221; copyright at all.  I think what we really mean is more of an Open Source license.  Regardless, this just covers source code.  We haven&#8217;t even talked about a decompile.  So, that&#8217;s Strike One.</p>
<p>Beyond this, an actual decompile wouldn&#8217;t decompile comments, and therefor the resulting code wouldn&#8217;t even contain the copyright message people are saying would cover it!  Strike two.</p>
<p>To make matters worse, decompiled code looks nothing like the original code, so you can&#8217;t even compare the two and say that it is the same program. You would be saying &#8220;that&#8217;s my method or my setup or my system&#8221;.  Well, as stated before, you can&#8217;t do that.  A perfect example of this fact is Linux and Unix.  Linux &#8220;copies&#8221; Unix is almost every fashion, but since it doesn&#8217;t actually use any of the CODE from the original Unix license (now owned by SCO) it is completely legal.</p>
<p>So, Strike Three, you are out. <img src='http://www.cubesteak.net/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </p>
<p>Technically the only things that a copyright COULD cover would be published source code with the copyright notice in it (which is tenuous unless you take further steps), and a compiled EX4 file, which is considered a valid &#8220;form of material expression&#8221;.</p>
<p>Neither of these things cover a decompile.  Seems wrong, doesn&#8217;t it?  Not really, its just that a copyright isn&#8217;t really whats needed for a software program &#8211; a software license is.</p>
<p>That said &#8211; Your best bet to protect your work is two fold.  Register the the source code copyright officially and if you publish it, note that it is a registered copyright with the US government.  Heed the following advice from <a title="Copyright on Wikipedia" target="_blank" href="http://en.wikipedia.org/wiki/Copyright">Wikipedia</a>:</p>
<p>&#8220;While copyright in the United States automatically attaches upon the creation of an original work of authorship, registration with the Copyright Office puts a copyright holder in a better position if litigation arises over the copyright. A copyright holder desiring to register his or her copyright should do the following:</p>
<p>1. Obtain and complete appropriate form.<br />
2. Prepare clear renditon of material being submitted for copyright<br />
3. Send both documents to U.S. Copyright Office in Washington, D.C.&#8221;</p>
<p>And secondly, (and more importantly) if you want to distribute or sell your EA, your best protection is an End User License Agreement that specifically outlines the rights of the buyer, which would of course forbid copying, decompiling, reselling, etc.</p>
<p>As a side note on the EULA, I personally would never agree to a EULA on an EA, as the liability just isn&#8217;t worth it.</p>
<p>Hopefully that (more) than closes the topic. <img src='http://www.cubesteak.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.cubesteak.net/2006/10/the-final-word-on-ex4-decompilation/feed/</wfw:commentRss>
		<slash:comments>15</slash:comments>
		</item>
		<item>
		<title>3 Fold Trading Hours Filter for EA</title>
		<link>http://www.cubesteak.net/2006/08/3-fold-trading-hours-filter-for-ea/</link>
		<comments>http://www.cubesteak.net/2006/08/3-fold-trading-hours-filter-for-ea/#comments</comments>
		<pubDate>Sat, 26 Aug 2006 04:46:31 +0000</pubDate>
		<dc:creator>cubesteak</dc:creator>
				<category><![CDATA[MT4 Includes]]></category>

		<guid isPermaLink="false">http://www.cubesteak.net/2006/08/3-fold-trading-hours-filter-for-ea/</guid>
		<description><![CDATA[In a previous post, I made available a small indicator that simply mentioned if you should be trading or not based on three different configurable timeframes.
In the process of changing the logic for use in an EA, I also improved on the previous indicator.  You can now use hours and minutes, not just hours [...]]]></description>
			<content:encoded><![CDATA[<p>In a <a title="3 Fold Trading Hours Indicator" href="http://www.cubesteak.net/2006/08/3-fold-trading-hours/">previous post</a>, I made available a small indicator that simply mentioned if you should be trading or not based on three different configurable timeframes.</p>
<p>In the process of changing the logic for use in an EA, I also improved on the previous indicator.  You can now use hours and minutes, not just hours for the configured time frames.</p>
<p>The file below is not a new indicator, but is intended to be included in an EA.  Its is the 3 Fold Trading Hours logic turned into a boolean function.  Simply wrap all your EA logic in the call to HourlyFilter();  It returns true when the time is within your specified hours, and false when it&#8217;s not.</p>
<p>Pseudo code for placement in the Start() function is:</p>
<p><code>if HourlyFilter()<br />
{<br />
PerformEALogic();<br />
}<br />
else return (0);</code></p>
<p>UPDATE: There was an error in the source, which has now been fixed.  Filter 3 was being checked twice, and Filter 2 was being ignored.  Sorry for any inconvenience.</p>
<p><img border="0" align="left" alt="MetaQuotes 4 Language File" title="MetaQuotes 4 Language File" src="http://www.cubesteak.net/images/MQ4.gif" /><a title="3FoldTradingFilterforEA.mq4" href="http://www.cubesteak.net/downloads/3FoldTradingFilterforEA.mq4"> 3FoldTradingFilterforEA.mq4</a><br />
<a title="3FoldTradingFilterforEA.zip" href="http://www.cubesteak.net/downloads/3FoldTradingFilterforEA.zip">3FoldTradingFilterforEA.zip</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.cubesteak.net/2006/08/3-fold-trading-hours-filter-for-ea/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>More Array Functions for MT4</title>
		<link>http://www.cubesteak.net/2006/08/more-array-functions-for-mt4/</link>
		<comments>http://www.cubesteak.net/2006/08/more-array-functions-for-mt4/#comments</comments>
		<pubDate>Wed, 23 Aug 2006 08:59:43 +0000</pubDate>
		<dc:creator>cubesteak</dc:creator>
				<category><![CDATA[MT4 Includes]]></category>

		<guid isPermaLink="false">http://www.cubesteak.net/2006/08/more-array-functions-for-mt4/</guid>
		<description><![CDATA[One of the things that has bugged me, is the inability to search a multi-dimensional array in MT4.
So, I made a function to do so. In this case, we really want the function to give us two things:

If the value exists in the array&#8217;s second dimension
If it does exist, the actual coordinates of where

Ideally, you [...]]]></description>
			<content:encoded><![CDATA[<p>One of the things that has bugged me, is the inability to search a multi-dimensional array in MT4.</p>
<p>So, I made a function to do so. In this case, we really want the function to give us two things:</p>
<ol>
<li>If the value exists in the array&#8217;s second dimension</li>
<li>If it does exist, the actual coordinates of where</li>
</ol>
<p>Ideally, you could do this with as little &#8220;usage hassle&#8221; as possible. So, the function that I&#8217;ve written does the following:</p>
<ol>
<li>It uses a 2 bucket single-dimension array to hold the coordinates of our search value. This array should be declared prior to calling the search function. The search function updates the value of the array because the array is &#8220;passed by reference&#8221;.</li>
<li>The function itself of a boolean type, so a return of &#8220;true&#8221; means it was found, and &#8220;false&#8221; means it wasn&#8217;t.</li>
</ol>
<p>Here is the function spec:</p>
<p><code>SearchSecondDim (ReturnArray, ArrayToSearch, ValueToSearch, SearchDirection)</code></p>
<p><strong>Return Values</strong>:</p>
<p><em><strong>True or False</strong></em><br />
<em>With ReturnArray passed by reference so that after function is run:<br />
ReturnArray [0] = ArrayToSearch first dimension location<br />
ReturnArray [1] = ArrayToSearch second dimension location<br />
if ReturnArray [0] or ReturnArray [1] = -1 value was not found.</em></p>
<p>NOTE: ReturnArray[2] need to be declared prior to using this function!</p>
<p><strong>Example 1: </strong></p>
<p><code>double MySearchArray[10][5];<br />
ArrayInitialize(MySearchArray,0);<br />
MySearchArray [7][5] = 7;<br />
double foo[2];<br />
bool FoundIt = SearchSeconDim (foo,MySearchArray,7,MODE_ASCEND);</code></p>
<p>This will set foo[0]==7 and foo[1]==5. Also, FoundIt will be &#8220;true&#8221;.</p>
<p><strong>Example 2</strong>:</p>
<p><code>double MySearchArray[10][5];<br />
ArrayInitialize(MySearchArray,0);<br />
MySearchArray [7][5] = 7;<br />
double foo[2];<br />
bool FoundIt = SearchSeconDim (foo,MySearchArray,10,MODE_ASCEND);</code></p>
<p>This will set foo[0]==-1 and foo[1]==-1 since the value isn&#8217;t anywhere in the array&#8217;s second dimension. Also, FoundIt will be &#8220;false&#8221;.</p>
<p><strong><font size="+1">Some Extra Goodies</font></strong>!</p>
<p>Also included in this file, is the single dimension array <a title="SearchArray" href="http://www.cubesteak.net/2006/08/a-better-way-to-search-arrays-in-mt4/">search function</a> that I posted earlier (see that post for more details) and 2 simple array &#8220;printing&#8221; functions. These printing functions output to the &#8220;Experts&#8221; tab of MT4&#8217;s terminal window.</p>
<p><strong>Printing a 1 dimensional array:</strong></p>
<p><code>PrintSingleArray(double ArrayToPrint[])</code></p>
<p><strong>Return Values:</strong></p>
<p><em><strong>None / Void. </strong></em><br />
A single comma separated line is printed to the Experts output window.</p>
<p><strong>Printing a 2 dimensional array:</strong></p>
<p><code>PrintDblArray(double ArrayToPrint[][])</code></p>
<p><strong>Return Values:</strong></p>
<p><em><strong>None / Void. </strong></em><br />
Each comma separated &#8220;row&#8221; is printed on a new line in the Experts output window.</p>
<p>ENJOY!</p>
<p><img title="MetaQuotes 4 Language File" alt="MetaQuotes 4 Language File" src="http://www.cubesteak.net/images/MQ4.gif" align="left" border="0" /><a title="CSArrayFunctions.mq4" href="http://www.cubesteak.net/downloads/CSArrayFunctions.mq4"> CSArrayFunctions.mq4</a><br />
<a title="CSArrayFunctions.zip" href="http://www.cubesteak.net/downloads/CSArrayFunctions.zip">CSArrayFunctions.zip</a><a /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.cubesteak.net/2006/08/more-array-functions-for-mt4/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>3 Fold Trading Hours</title>
		<link>http://www.cubesteak.net/2006/08/3-fold-trading-hours/</link>
		<comments>http://www.cubesteak.net/2006/08/3-fold-trading-hours/#comments</comments>
		<pubDate>Wed, 23 Aug 2006 08:17:12 +0000</pubDate>
		<dc:creator>cubesteak</dc:creator>
				<category><![CDATA[MT4 Indicators]]></category>

		<guid isPermaLink="false">http://www.cubesteak.net/2006/08/3-fold-trading-hours/</guid>
		<description><![CDATA[A forex-tsd buddy was working on a project that needed to filter trading by 3 separate timeframes.  Answering his question prompted me to make this little indicator that displays a comment telling you if it is currently within your preset trading hours.
The hours to trade can be set either in the code directly, or through [...]]]></description>
			<content:encoded><![CDATA[<p>A <a title="Forex-TSD" href="http://www.forex-tsd.com/setup-questions/3388-can-anyone-figure-out-why-will-not-work-right.html" target="_blank">forex-tsd</a> buddy was working on a project that needed to filter trading by 3 separate timeframes.  Answering his question prompted me to make this little indicator that displays a comment telling you if it is currently within your preset trading hours.</p>
<p>The hours to trade can be set either in the code directly, or through the indicator settings window.  Of course, all hours are in relation to your broker&#8217;s server.</p>
<p>Current limitation: it only works on whole hours, no minutes.</p>
<p>Possible future: I can make it work with objects, rather than a comment, giving more flexibility on placement and opening up the possibility of putting it in a separate indicator window.  Let me know if that would be usefull! </p>
<p><img title="MetaQuotes 4 Language File" alt="MetaQuotes 4 Language File" src="http://www.cubesteak.net/images/MQ4.gif" align="left" border="0" /><a title="3FoldTradingHours.mq4" href="http://www.cubesteak.net/downloads/3FoldTradingHours.mq4"> 3FoldTradingHours.mq4</a><br />
<a title="3FoldTradingHours.zip" href="http://www.cubesteak.net/downloads/3FoldTradingHours.zip">3FoldTradingHours.zip</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.cubesteak.net/2006/08/3-fold-trading-hours/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>A &#8220;Better&#8221; Way to Search Arrays in MT4</title>
		<link>http://www.cubesteak.net/2006/08/a-better-way-to-search-arrays-in-mt4/</link>
		<comments>http://www.cubesteak.net/2006/08/a-better-way-to-search-arrays-in-mt4/#comments</comments>
		<pubDate>Tue, 22 Aug 2006 00:00:02 +0000</pubDate>
		<dc:creator>cubesteak</dc:creator>
				<category><![CDATA[MT4 Includes]]></category>

		<guid isPermaLink="false">http://www.cubesteak.net/2006/08/a-better-way-to-search-arrays-in-mt4/</guid>
		<description><![CDATA[MT4 provides the function ArrayBSearch to search arrays. It seems a bit &#8220;non-standard&#8221; to me, in that according to the documentation, it &#8220;returns the index of the first occurrence of a value in the first dimension of array if possible, or the nearest one, if the occurrence is not found.&#8221;
It wasn&#8217;t readily apparent to me [...]]]></description>
			<content:encoded><![CDATA[<p>MT4 provides the function <a target="_blank" title="ArrayBSearch at MQL4.com" href="http://docs.mql4.com/array/ArrayBsearch">ArrayBSearch</a> to search arrays. It seems a bit &#8220;non-standard&#8221; to me, in that according to the documentation, it &#8220;returns the index of the first occurrence of a value in the first dimension of array if possible, or the nearest one, if the occurrence is not found.&#8221;</p>
<p>It wasn&#8217;t readily apparent to me what the heck that meant, so I did a little experimenting. I did the following:</p>
<p><code>double foo[10] = {1,2,3,4,5,6,7,8,9,10};<br />
ArraySort(foo);<br />
int index = ArrayBsearch(foo,4);<br />
Print ("found: "+index);<br />
index = ArrayBsearch(foo,11);<br />
Print ("not found: "+index);</code></p>
<p>And got:</p>
<p><code>found: 3<br />
not found: 9</code></p>
<p>And then did this:</p>
<p><code>double foo[10] = {1,2,3,4,5,6,7,8,9,10};<br />
ArraySort(foo);<br />
int index = ArrayBsearch(foo,4);<br />
Print ("found: "+index);<br />
index = ArrayBsearch(foo,-1);<br />
Print ("not found: "+index);</code></p>
<p>And got:</p>
<p><code>found: 3<br />
not found: 0</code></p>
<p>So, it seems that this means that ArrayBsearch returns either the first or the last index position if your number isn&#8217;t found in the array. To me, that&#8217;s kind of dumb, as it means you still have no idea if the first or last index position actually contains the item you are searching for! It could mean it found your value, or it could mean it DIDN&#8217;T find your value. Not really the sort of information I&#8217;m looking for in a &#8220;search&#8221; function.</p>
<p>If you do a Google search for &#8220;array bsearch&#8221;, you&#8217;ll find several examples of these kinds of searches. They pretty much boil down to the following:</p>
<blockquote><p>bsearch returns a pointer to an occurrence of key in the array pointed to by base. If key is not found, the function returns NULL.</p></blockquote>
<p>So, I created this little function as a more &#8220;sane&#8221; array search for MT4. Since we don&#8217;t have access to pointers, I just used a &#8220;-1&#8243; return instead. I hope you like it!</p>
<p><img border="0" align="left" alt="MetaQuotes 4 Language File" title="MetaQuotes 4 Language File" src="http://www.cubesteak.net/images/MQ4.gif" /><a title="ArraySearch.mq4" href="http://www.cubesteak.net/downloads/ArraySearch.mq4"> ArraySearch.mq4</a><br />
<a title="ArraySearch.zip" href="http://www.cubesteak.net/downloads/ArraySearch.zip">ArraySearch.zip</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.cubesteak.net/2006/08/a-better-way-to-search-arrays-in-mt4/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
