<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://forum.equis.com/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Basic Coding Techniques</title><link>http://forum.equis.com/forums/3053/ShowForum.aspx</link><description>Basic MetaStock Coding Techniques 
&lt;br&gt;
Group Manager: &lt;a href="http://www.wabbit.com.au"&gt;Wabbit&lt;/a&gt;</description><dc:language>en-US</dc:language><generator>CommunityServer 2.0 (Debug Build: 60217.2664)</generator><item><title>Equis Formula Primer</title><link>http://forum.equis.com/forums/thread/29693.aspx</link><pubDate>Tue, 12 May 2009 04:07:49 GMT</pubDate><guid isPermaLink="false">2fa994ca-da92-4cc0-8578-1c713492f1d7:29693</guid><dc:creator>wabbit</dc:creator><slash:comments>0</slash:comments><comments>http://forum.equis.com/forums/thread/29693.aspx</comments><wfw:commentRss>http://forum.equis.com/forums/commentrss.aspx?SectionID=3053&amp;PostID=29693</wfw:commentRss><description>The Equis Formula Primer is the first stop for new users of MetaStock to learn how to write codes in the MetaStock Formula Language.&amp;nbsp; It will guide the reader through a series of exercises that explain what the MetaStock Formula Language is and how it works.&amp;nbsp; It gradually increases the user's knowledge to a point where they can create their own custom indicators, expert advisors, system tests and explorations.&lt;br&gt;&lt;br&gt;You can download it &lt;b&gt;free &lt;/b&gt;of charge, either from the Files section of the forum, or directly from: &lt;a href="http://forum.equis.com/files/19673/download.aspx" target="_blank" title="http://forum.equis.com/files/19673/download.aspx"&gt;http://forum.equis.com/files/19673/download.aspx&lt;/a&gt;&lt;br&gt;&lt;br&gt;I strongly recommend every MetaStock user completes these exercises; a little time spent now doing some basic homework will make coding trading ideas in the future so much easier.&lt;br&gt;&lt;br&gt;&lt;br&gt;wabbit &lt;img src="/emoticons/emotion-2.gif" alt="Big Smile [:D]" /&gt;&lt;br&gt;&lt;br&gt;</description></item><item><title>RSI trend and AFL script</title><link>http://forum.equis.com/forums/thread/31154.aspx</link><pubDate>Sun, 08 Nov 2009 23:36:40 GMT</pubDate><guid isPermaLink="false">2fa994ca-da92-4cc0-8578-1c713492f1d7:31154</guid><dc:creator>LuckyLucas</dc:creator><slash:comments>7</slash:comments><comments>http://forum.equis.com/forums/thread/31154.aspx</comments><wfw:commentRss>http://forum.equis.com/forums/commentrss.aspx?SectionID=3053&amp;PostID=31154</wfw:commentRss><description>Hi All,&lt;br&gt;&lt;br&gt;I am just wondering if anyone are familiar with AFL language and willing to help me with this code.&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;p class="MsoBodyText"&gt;
    &lt;font color="#008080"&gt;&lt;b&gt;
    Amibroker formula&lt;/b&gt;&lt;/font&gt;&amp;nbsp;&lt;/p&gt;
    &lt;p class="MsoNormal"&gt;
    &lt;span&gt;
    Aup=&lt;/span&gt;&lt;span&gt;40&lt;/span&gt;&lt;span&gt;;&lt;/span&gt;&lt;span&gt;//40&lt;/span&gt;&lt;/p&gt;
    &lt;p class="MsoNormal"&gt;
    &lt;span&gt;
    Adown=&lt;/span&gt;&lt;span&gt;60&lt;/span&gt;&lt;span&gt;;&lt;/span&gt;&lt;span&gt;//60&lt;/span&gt;&lt;/p&gt;
    &lt;p class="MsoNormal"&gt;
    &lt;span&gt;
    up=&lt;/span&gt;&lt;span&gt;BarsSince&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span&gt;RSI&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span&gt;9&lt;/span&gt;&lt;span&gt;)&amp;gt;&lt;/span&gt;&lt;span&gt;70&lt;/span&gt;&lt;span&gt;);&lt;/span&gt;&lt;/p&gt;
    &lt;p class="MsoNormal"&gt;
    &lt;span&gt;
    down=&lt;/span&gt;&lt;span&gt;BarsSince&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span&gt;RSI&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span&gt;9&lt;/span&gt;&lt;span&gt;)&amp;lt;&lt;/span&gt;&lt;span&gt;30&lt;/span&gt;&lt;span&gt;);&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
    &lt;p class="MsoNormal"&gt;&lt;b&gt;
    &lt;span&gt;
    Graph0&lt;/span&gt;&lt;/b&gt;&lt;span&gt;=&lt;/span&gt;&lt;span&gt;IIf&lt;/span&gt;&lt;span&gt;(up&amp;lt;down,&lt;/span&gt;&lt;span&gt;1&lt;/span&gt;&lt;span&gt;,-&lt;/span&gt;&lt;span&gt;1&lt;/span&gt;&lt;span&gt;);&lt;/span&gt;&lt;/p&gt;
    &lt;p class="MsoNormal"&gt;&lt;b&gt;
    &lt;span&gt;
    Graph0Style&lt;/span&gt;&lt;/b&gt;&lt;span&gt;=&lt;/span&gt;&lt;span&gt;2&lt;/span&gt;&lt;span&gt;;&lt;/span&gt;&lt;/p&gt;
    &lt;p class="MsoNormal"&gt;&lt;b&gt;
    &lt;span&gt;
    Graph0BarColor&lt;/span&gt;&lt;/b&gt;&lt;span&gt;=&lt;/span&gt;&lt;span&gt;IIf&lt;/span&gt;&lt;span&gt;( 
    up&amp;lt;down &lt;b&gt;AND&lt;/b&gt; &lt;/span&gt;
    &lt;span&gt;
    LLV&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span&gt;RSI&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span&gt;9&lt;/span&gt;&lt;span&gt;),up)&amp;gt;Aup 
    ,&lt;/span&gt;&lt;span&gt;5&lt;/span&gt;&lt;span&gt;,&lt;/span&gt;&lt;span&gt;IIf&lt;/span&gt;&lt;span&gt;(down&amp;lt;up
    &lt;b&gt;AND&lt;/b&gt; &lt;/span&gt;
    &lt;span&gt;
    HHV&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span&gt;RSI&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span&gt;9&lt;/span&gt;&lt;span&gt;),down)&amp;lt;Adown,&lt;/span&gt;&lt;span&gt;4&lt;/span&gt;&lt;span&gt;,&lt;/span&gt;&lt;span&gt;0&lt;/span&gt;&lt;span&gt;));&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
    &lt;p class="MsoNormal"&gt;&lt;b&gt;
    &lt;span&gt;
    Graph1&lt;/span&gt;&lt;/b&gt;&lt;span&gt;=&lt;/span&gt;&lt;span&gt;1.1&lt;/span&gt;&lt;span&gt;;&lt;/span&gt;&lt;/p&gt;
    &lt;p class="MsoNormal"&gt;&lt;b&gt;
    &lt;span&gt;
    Graph1Color&lt;/span&gt;&lt;/b&gt;&lt;span&gt;=&lt;/span&gt;&lt;span&gt;0&lt;/span&gt;&lt;span&gt;;&lt;/span&gt;&lt;/p&gt;
    &lt;p class="MsoNormal"&gt;&lt;b&gt;
    &lt;span&gt;
    Graph2&lt;/span&gt;&lt;/b&gt;&lt;span&gt;=-&lt;/span&gt;&lt;span&gt;1.1&lt;/span&gt;&lt;span&gt;;&lt;/span&gt;&lt;/p&gt;
    &lt;p class="MsoNormal"&gt;&lt;b&gt;
    &lt;span&gt;
    Graph2Color&lt;/span&gt;&lt;/b&gt;&lt;span&gt;=&lt;/span&gt;&lt;span&gt;0&lt;/span&gt;&lt;span&gt;;&lt;/span&gt;&amp;nbsp;&lt;/p&gt;&lt;p class="MsoNormal"&gt;Someone in yahoo groups forum shared this code and gives the original source (http://www.scientifictrader.com/stock_trend.htm). The idea is good but I just dont know how to play with LLV function. Every time when I tried to put the same code, it just promt me to change " up" to number of period.&amp;nbsp;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;br&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;Thanks&lt;/p&gt;&lt;p class="MsoNormal"&gt;Lucas&lt;br&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;br&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;br&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;br&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;br&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;br&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;br&gt;&lt;/p&gt;&lt;br&gt;</description></item><item><title>EST Trailing Stop using Elder...</title><link>http://forum.equis.com/forums/thread/31081.aspx</link><pubDate>Tue, 03 Nov 2009 01:31:33 GMT</pubDate><guid isPermaLink="false">2fa994ca-da92-4cc0-8578-1c713492f1d7:31081</guid><dc:creator>junkyard</dc:creator><slash:comments>4</slash:comments><comments>http://forum.equis.com/forums/thread/31081.aspx</comments><wfw:commentRss>http://forum.equis.com/forums/commentrss.aspx?SectionID=3053&amp;PostID=31081</wfw:commentRss><description>I've been searching the forums attempting to find a resolution but seem to be dumbfounding myself on the crumbs looking for the whole piece.&amp;nbsp; I'm trying to run a simple system test to verify accuracy of my results before attempting something more complicated but am hung up on the stop.&amp;nbsp; &lt;br&gt;&lt;br&gt;The buy is simply:&lt;br&gt;BUY: Cross(Mov(Close,13,e),Mov(Close,26,e))&lt;br&gt;&lt;br&gt;For the sell I am attempting to use the Chandelier formula of the Elder package "FmlVar("Elder - Chandelier Long","ATRDAYS")" into my sell code in order to have a trigger based upon the close being lower than the Chandelier exit since the highest high of the cross over.&lt;br&gt;&lt;br&gt;I've tried a number of approaches such as:&lt;br&gt;SELL:&lt;br&gt;C &amp;lt; FmlVar("Elder - Chandelier Long","ATRDAYS")&lt;br&gt;to&lt;br&gt;HI := HighestSince(1,Cross(Mov(Close,13,e),Mov(Close,26,e) ,C) - FmlVar("Elder - Chandelier Long","ATRDAYS");&lt;br&gt;C&amp;lt;HI&lt;br&gt;&lt;br&gt;and think I may be mixing concepts in trying to code this am an looking for some direction.&amp;nbsp; I'm stumping myself and getting lost in the forum.dll and latches concepts that I've been coming across in my research and think I may be making things more difficult for myself than they need be.&lt;br&gt;&lt;br&gt;Thanks in advance,&lt;br&gt;Michael&lt;br&gt;&lt;br&gt;</description></item><item><title>using symbol name in a formula</title><link>http://forum.equis.com/forums/thread/30684.aspx</link><pubDate>Sat, 12 Sep 2009 15:59:36 GMT</pubDate><guid isPermaLink="false">2fa994ca-da92-4cc0-8578-1c713492f1d7:30684</guid><dc:creator>ravik</dc:creator><slash:comments>6</slash:comments><comments>http://forum.equis.com/forums/thread/30684.aspx</comments><wfw:commentRss>http://forum.equis.com/forums/commentrss.aspx?SectionID=3053&amp;PostID=30684</wfw:commentRss><description>I need to use symbol names inside a formula, can anyone help me ?&lt;br&gt;</description></item><item><title>Super slow ValueWhen/Prev</title><link>http://forum.equis.com/forums/thread/30834.aspx</link><pubDate>Fri, 25 Sep 2009 13:37:11 GMT</pubDate><guid isPermaLink="false">2fa994ca-da92-4cc0-8578-1c713492f1d7:30834</guid><dc:creator>Data</dc:creator><slash:comments>4</slash:comments><comments>http://forum.equis.com/forums/thread/30834.aspx</comments><wfw:commentRss>http://forum.equis.com/forums/commentrss.aspx?SectionID=3053&amp;PostID=30834</wfw:commentRss><description>When I use either of these functions (Valuewhen or Prev) Metastock becomes extremely slow and sometimes it will simply freeze !&amp;nbsp; I've got a recent computer, a dual core, 4 Go of Ram, 1500 Go on my hard drive, I can't see why this program is freezing :(&amp;nbsp;&amp;nbsp;&amp;nbsp; Especially when it takes less than 80 Mb of RAM.&lt;br&gt;&lt;br&gt;&lt;br&gt;Is there any way out of this mess ?&amp;nbsp; Can I : &lt;br&gt;- allow Metastock to use more ressources ;&lt;br&gt;- find another way to code these indicators ;&lt;br&gt;- find an alternative program ?&lt;br&gt;&lt;br&gt;&lt;br&gt;What I am trying to do is quite simple : I don't want to do any trade is the close is higher/lower than the last short/buy signal.&amp;nbsp; A basic C &amp;gt; valuewhen(1,signal,C)&amp;nbsp; does the trick but that blocks metastock.&amp;nbsp; It works quite well if I'm offline and it really improves my bottom line.&lt;br&gt;Could I just switch to Trade Station ?&lt;br&gt;When I think about it, I can not go somewhere else because of very useful add ons...&lt;br&gt;</description></item><item><title>Question on MACD Histogram</title><link>http://forum.equis.com/forums/thread/30693.aspx</link><pubDate>Sat, 12 Sep 2009 20:57:55 GMT</pubDate><guid isPermaLink="false">2fa994ca-da92-4cc0-8578-1c713492f1d7:30693</guid><dc:creator>michmauro</dc:creator><slash:comments>4</slash:comments><comments>http://forum.equis.com/forums/thread/30693.aspx</comments><wfw:commentRss>http://forum.equis.com/forums/commentrss.aspx?SectionID=3053&amp;PostID=30693</wfw:commentRss><description>I compared the weekly histogram , using the custom formula, utilizing daily data : http://www.equis.com/customer/resources/formulas/formula.aspx?Id=32,&amp;nbsp; with macd histogram in a normal weekly chart.&lt;br&gt;&amp;nbsp;They appear not the same. Can someone, please,&amp;nbsp; help me in understanding why?&lt;br&gt;Thanks in aadvance for your help.&lt;br&gt;&lt;br&gt;michmauro&lt;br&gt;&lt;br&gt;&lt;br&gt;</description></item><item><title>metastock  programmers</title><link>http://forum.equis.com/forums/thread/30681.aspx</link><pubDate>Sat, 12 Sep 2009 14:47:50 GMT</pubDate><guid isPermaLink="false">2fa994ca-da92-4cc0-8578-1c713492f1d7:30681</guid><dc:creator>pwood</dc:creator><slash:comments>1</slash:comments><comments>http://forum.equis.com/forums/thread/30681.aspx</comments><wfw:commentRss>http://forum.equis.com/forums/commentrss.aspx?SectionID=3053&amp;PostID=30681</wfw:commentRss><description>&lt;P&gt;Hi All,&lt;/P&gt;
&lt;P&gt;I am a new member to this group.I would like to ask if there is anyone who could write some simple alerts for me.I am willing to pay for this help,&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;
&lt;P&gt;Peter&lt;/P&gt;</description></item><item><title>exploration using a custom period?</title><link>http://forum.equis.com/forums/thread/30622.aspx</link><pubDate>Mon, 07 Sep 2009 14:52:56 GMT</pubDate><guid isPermaLink="false">2fa994ca-da92-4cc0-8578-1c713492f1d7:30622</guid><dc:creator>Kalle</dc:creator><slash:comments>1</slash:comments><comments>http://forum.equis.com/forums/thread/30622.aspx</comments><wfw:commentRss>http://forum.equis.com/forums/commentrss.aspx?SectionID=3053&amp;PostID=30622</wfw:commentRss><description>Tried to use the search but I guess I didnt use the correct keyword because I am certain this have been asked before! :)&lt;br&gt;&lt;br&gt;I want to do exploration that calculates correlation between index and stocks using historical timeperiod. I mean I can do the correlation exploration clicking index and then Correl(P,C,250,0). This works fine but now it is using the LATEST 250 days in my database. Can I somehow use other 250 days? For example 250 days in 2000-2001? &lt;br&gt;&lt;br&gt;Obviously my main goal is to backtest a system that uses "index-stock" -pair and I need to find index-stock combos that have the highest correlation, for example 2001-2002, and then I use my method 2002-2003 to see if it would have made any money.&amp;nbsp; Thanks!&lt;br&gt;</description></item><item><title>Trouble with indicator date calculations</title><link>http://forum.equis.com/forums/thread/30554.aspx</link><pubDate>Sun, 30 Aug 2009 12:39:07 GMT</pubDate><guid isPermaLink="false">2fa994ca-da92-4cc0-8578-1c713492f1d7:30554</guid><dc:creator>Dendee</dc:creator><slash:comments>4</slash:comments><comments>http://forum.equis.com/forums/thread/30554.aspx</comments><wfw:commentRss>http://forum.equis.com/forums/commentrss.aspx?SectionID=3053&amp;PostID=30554</wfw:commentRss><description>When plotting my Stop Loss Indicator I use ":= Input" to input the day, month, year.&lt;br /&gt;&lt;br /&gt;With daily bars this is fine, but if I am using Weekly bars, the Close Day of the weekly bar is the last day of the week, which may not be actual day I entered.&lt;br /&gt;&lt;br /&gt;When I enter a date that is mid week using weekly bars, the indicator won't find that date and therefore can't calculate.&lt;br /&gt;&lt;br /&gt;I need a formulae that, when I enter a mid week date, the formulae will look  back (or forward) one day at a time up to 5 days until it finds the actual close date of that particular weekly bar, then calculate ithe indicator.&lt;br /&gt;&lt;br /&gt;Could someone please help me with such a formulae?&lt;br /&gt;Thanks</description></item><item><title>Floating Stop Loss Line (FSL)</title><link>http://forum.equis.com/forums/thread/30415.aspx</link><pubDate>Fri, 14 Aug 2009 04:38:57 GMT</pubDate><guid isPermaLink="false">2fa994ca-da92-4cc0-8578-1c713492f1d7:30415</guid><dc:creator>Dendee</dc:creator><slash:comments>4</slash:comments><comments>http://forum.equis.com/forums/thread/30415.aspx</comments><wfw:commentRss>http://forum.equis.com/forums/commentrss.aspx?SectionID=3053&amp;PostID=30415</wfw:commentRss><description>I want to create a Floating Stop Loss (FSL) indicator line, that places a horizontal line 10% 'below' a stocks buying price.  The line then rises when the stock price rises, but stays fixed when the stock price falls.  If the stock falls and then rises in the future the line will rise again when the price exceeds the FSL line.&lt;br /&gt;&lt;br /&gt;To enter my buying price for a stock, I need a pop up data entry window that appears each time I set the FSL indicator, so that I can enter the buying price.&lt;br /&gt;I don't want to have to alter the formulae every time to set a new buying price, but rather use the data entry window.&lt;br /&gt;&lt;br /&gt;My problem is that I am not Metastock formulae language literate and have really been struggling for weeks without any sucsess, so I have had to give up.&lt;br /&gt;&lt;br /&gt;Could someone please help me with a workable formulae t do the above!</description></item><item><title>Plotting only the highest value between 2 indicators </title><link>http://forum.equis.com/forums/thread/30312.aspx</link><pubDate>Thu, 30 Jul 2009 09:44:10 GMT</pubDate><guid isPermaLink="false">2fa994ca-da92-4cc0-8578-1c713492f1d7:30312</guid><dc:creator>zvior</dc:creator><slash:comments>2</slash:comments><comments>http://forum.equis.com/forums/thread/30312.aspx</comments><wfw:commentRss>http://forum.equis.com/forums/commentrss.aspx?SectionID=3053&amp;PostID=30312</wfw:commentRss><description>&lt;P&gt;Please help me to build an indicator which is a highest value between 2 indicators, like 2 moving averages. &lt;/P&gt;
&lt;P&gt;Thanks.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description></item><item><title>PS Bull Power Bear Power 3 (Signal) - Not working for Explorer HELP!</title><link>http://forum.equis.com/forums/thread/30298.aspx</link><pubDate>Tue, 28 Jul 2009 09:23:30 GMT</pubDate><guid isPermaLink="false">2fa994ca-da92-4cc0-8578-1c713492f1d7:30298</guid><dc:creator>CAR1</dc:creator><slash:comments>0</slash:comments><comments>http://forum.equis.com/forums/thread/30298.aspx</comments><wfw:commentRss>http://forum.equis.com/forums/commentrss.aspx?SectionID=3053&amp;PostID=30298</wfw:commentRss><description>&lt;P&gt;I played around with the formulas and now is no longer working. Help! Can someone paste the formula here so I can fix this.&lt;/P&gt;
&lt;P&gt;Thx.&lt;/P&gt;</description></item><item><title>Quote centre formula in Excel</title><link>http://forum.equis.com/forums/thread/30072.aspx</link><pubDate>Tue, 07 Jul 2009 14:17:32 GMT</pubDate><guid isPermaLink="false">2fa994ca-da92-4cc0-8578-1c713492f1d7:30072</guid><dc:creator>gaurav</dc:creator><slash:comments>4</slash:comments><comments>http://forum.equis.com/forums/thread/30072.aspx</comments><wfw:commentRss>http://forum.equis.com/forums/commentrss.aspx?SectionID=3053&amp;PostID=30072</wfw:commentRss><description>Hi, I am using the below formula in quote centre to get data in excel. Is there a way that instead of referring to ticker, I can reference to cell in excel which has the tickers and it gives me the results.&lt;br /&gt;&lt;br /&gt;Instead of writing IBM in formula below, can I reference to a cell which has IBM written and it give me the results.&lt;br /&gt;&lt;br /&gt;This can be done in Reuters station, and have been using it but is it possible to do in quote centre also.&lt;br /&gt;&lt;br /&gt;=BDDE|TKR!'\\\IBM/LS,LTM'</description></item><item><title>Please help me find a way to fix this code ;)</title><link>http://forum.equis.com/forums/thread/30067.aspx</link><pubDate>Tue, 07 Jul 2009 08:18:52 GMT</pubDate><guid isPermaLink="false">2fa994ca-da92-4cc0-8578-1c713492f1d7:30067</guid><dc:creator>Arash</dc:creator><slash:comments>2</slash:comments><comments>http://forum.equis.com/forums/thread/30067.aspx</comments><wfw:commentRss>http://forum.equis.com/forums/commentrss.aspx?SectionID=3053&amp;PostID=30067</wfw:commentRss><description>I am trying to write a code to calculate the total up move on a series of back to back up bars (or total down move on a series of back to back down bars...(this is only part of the code because I have to take into consideration the case when ROC(C,1,$)=0 which I have done in part of a code thats not below...)&lt;br&gt;&lt;br&gt;&lt;span&gt;A:= BarsSince(ROC(C,1,$)&amp;gt;0);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;

&lt;p class="MsoNormal"&gt;&lt;span&gt;B:= BarsSince(ROC(C,1,$)&amp;lt;0);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class="MsoNormal"&gt;&lt;span&gt;If(ROC(C,1,$)&amp;lt;0,&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class="MsoNormal"&gt;&lt;span&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;If(Ref(ROC(C,1,$),-1)&amp;gt;0,ROC(C,1,$),
ROC(C,A,$)),&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class="MsoNormal"&gt;&lt;span&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;If(Ref(ROC(C,1,$),-1)&amp;lt;0,ROC(C,1,$),ROC(C,B
,$)))&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;br&gt;but I keep in getting an error that I can only use a constant inside the ROC function. &lt;br&gt;&lt;br&gt;In other words if&amp;nbsp; I have 5 back to back up bars then I would find 5 by&lt;br&gt;BarsSince(ROC(C,1,$)&amp;lt;0)--&amp;gt;which should give you 5&lt;br&gt;Then I would want to calculate&lt;br&gt;ROC(C,BarsSince(ROC(C,1,$)&amp;lt;0,$) &lt;br&gt;to
find the total up move from the 5th up bar to the very start of the up
move of the 5 series up bars. but metastock is not allowing me to put
the barssince function inside of Roc or Ref function&lt;br&gt;&lt;br&gt;So what do I do? How can I go around this? Any ideas would be very appreciated?&lt;br&gt;&lt;br&gt;Thank you&lt;br&gt;</description></item><item><title>Stop Limit Entry on days high</title><link>http://forum.equis.com/forums/thread/29972.aspx</link><pubDate>Tue, 23 Jun 2009 23:28:07 GMT</pubDate><guid isPermaLink="false">2fa994ca-da92-4cc0-8578-1c713492f1d7:29972</guid><dc:creator>SMenday</dc:creator><slash:comments>9</slash:comments><comments>http://forum.equis.com/forums/thread/29972.aspx</comments><wfw:commentRss>http://forum.equis.com/forums/commentrss.aspx?SectionID=3053&amp;PostID=29972</wfw:commentRss><description>&lt;P&gt;Hi&lt;/P&gt;
&lt;P&gt;I cannot get the EST to go long on a stop limit that is equal to the days high.&amp;nbsp; It places the order but it expires.&amp;nbsp; Does anyone know why?&amp;nbsp; I assume it doesn't work for shorts on the low either.&lt;/P&gt;
&lt;P&gt;Cheers&lt;/P&gt;
&lt;P&gt;Stewart&lt;/P&gt;</description></item><item><title>Count Back</title><link>http://forum.equis.com/forums/thread/29929.aspx</link><pubDate>Wed, 17 Jun 2009 16:47:30 GMT</pubDate><guid isPermaLink="false">2fa994ca-da92-4cc0-8578-1c713492f1d7:29929</guid><dc:creator>Flexi</dc:creator><slash:comments>3</slash:comments><comments>http://forum.equis.com/forums/thread/29929.aspx</comments><wfw:commentRss>http://forum.equis.com/forums/commentrss.aspx?SectionID=3053&amp;PostID=29929</wfw:commentRss><description>&lt;P&gt;How to code a bar count back on a indicator to the next signal. When use barssince(Ind1), the bar count is forward but how to do a bar count back rather than count forward?&lt;/P&gt;</description></item><item><title>Expert - buy/sell to show only once for condition</title><link>http://forum.equis.com/forums/thread/29894.aspx</link><pubDate>Wed, 10 Jun 2009 23:49:04 GMT</pubDate><guid isPermaLink="false">2fa994ca-da92-4cc0-8578-1c713492f1d7:29894</guid><dc:creator>jer99</dc:creator><slash:comments>2</slash:comments><comments>http://forum.equis.com/forums/thread/29894.aspx</comments><wfw:commentRss>http://forum.equis.com/forums/commentrss.aspx?SectionID=3053&amp;PostID=29894</wfw:commentRss><description>&lt;P&gt;I would like to have my EA show a buy arrow the first time a condition is met until a second condition appears.&amp;nbsp; For example:&lt;/P&gt;
&lt;P&gt;Condition 1 (Buy)&lt;/P&gt;
&lt;P&gt;mov(c,12,s)&amp;nbsp; &amp;gt; mov(c,24,s)&amp;nbsp; and rsi(14) &amp;gt; 60&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Condition 2 (sell)&lt;/P&gt;
&lt;P&gt;mov(c,24,s) &amp;gt; mov(c,12,s) and rsi(14) &amp;lt; 60&lt;/P&gt;
&lt;P&gt;I would like to see one arrow the first time a buy or sell is done and then when the opposite condition exists, the other arrow.&amp;nbsp; But only once. &lt;/P&gt;
&lt;P&gt;I tried placing the above logic into an EA and got multiple Buys/Sells.&lt;/P&gt;
&lt;P&gt;I understand why that happened - I'm used to writting code in a linear fashion like:&lt;/P&gt;
&lt;P&gt;if condition1 and not flag1 &lt;/P&gt;
&lt;P&gt;then &lt;/P&gt;
&lt;P&gt;flag1 = true&lt;/P&gt;
&lt;P&gt;place arrow&lt;/P&gt;
&lt;P&gt;end if&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;but the environment is different and am having a tough time with this type of logic. &lt;/P&gt;</description></item><item><title>Adding exception code</title><link>http://forum.equis.com/forums/thread/29854.aspx</link><pubDate>Thu, 04 Jun 2009 18:08:29 GMT</pubDate><guid isPermaLink="false">2fa994ca-da92-4cc0-8578-1c713492f1d7:29854</guid><dc:creator>Flexi</dc:creator><slash:comments>3</slash:comments><comments>http://forum.equis.com/forums/thread/29854.aspx</comments><wfw:commentRss>http://forum.equis.com/forums/commentrss.aspx?SectionID=3053&amp;PostID=29854</wfw:commentRss><description>Have this indicator that plot 1 or 0. But now want the indicator to plot 0 (even there is a signal) whenever the month is &amp;gt; 30 days. The indicator is not base on calendar month. In other word only wan the indicator to plot signal in month &amp;lt;= 30 days and ignore months &amp;gt; 30 days. Possible? </description></item><item><title>Problem with RSI system</title><link>http://forum.equis.com/forums/thread/29843.aspx</link><pubDate>Tue, 02 Jun 2009 04:34:56 GMT</pubDate><guid isPermaLink="false">2fa994ca-da92-4cc0-8578-1c713492f1d7:29843</guid><dc:creator>mav67</dc:creator><slash:comments>3</slash:comments><comments>http://forum.equis.com/forums/thread/29843.aspx</comments><wfw:commentRss>http://forum.equis.com/forums/commentrss.aspx?SectionID=3053&amp;PostID=29843</wfw:commentRss><description>Hi everyone, I am new here.&amp;nbsp; I am taking my first steps at using the Metastock formula to create my own trading systems.&amp;nbsp; Just for practice, I tried to create a system that would BUY when the 14-day RSI crosses above 30 and SELL when it crosses below 70.&amp;nbsp; This was done in the System Editor and only the Buy and Sell tabs were filled in.&amp;nbsp; All other tabs such as Stops and Optimizations were left blank.&amp;nbsp; The formulas I used were:&lt;br&gt;&lt;br&gt;BUY ORDER: cross(RSI(14), 30) &lt;br&gt;SELL ORDER: cross(70, RSI(14))&lt;br&gt;&lt;br&gt;Now, my problem is that when I come to back-test this system over 10 years of data, it always comes up with fewer trades than expected.&amp;nbsp; After checking the security being tested, and plotting the 14-day RSI for it, it is obvious that there are many crossovers which are not being acted upon.&amp;nbsp; It is interesting to note that the trades being identified are correct, but somehow, it identifies a few and then skips a few and then identifies a few more and so on.... &lt;br&gt;&lt;br&gt;I am not sure why this is happening and would appreciate any help possible. Thanks very much!!&lt;br&gt;</description></item><item><title>mean reversion?</title><link>http://forum.equis.com/forums/thread/29717.aspx</link><pubDate>Thu, 14 May 2009 19:47:25 GMT</pubDate><guid isPermaLink="false">2fa994ca-da92-4cc0-8578-1c713492f1d7:29717</guid><dc:creator>zigzag</dc:creator><slash:comments>3</slash:comments><comments>http://forum.equis.com/forums/thread/29717.aspx</comments><wfw:commentRss>http://forum.equis.com/forums/commentrss.aspx?SectionID=3053&amp;PostID=29717</wfw:commentRss><description>&lt;P&gt;I have recently read an interesting article in Futures Magazine about the existence (or lack thereof) of mean reversion in stocks.&amp;nbsp; Under the authors' apparent conclusion that there is a significant degree of autocorrelation in the SPX with a one-day lookback period, they suggest a simple trading system where one would buy at close if close&amp;lt;open and sell at close if close&amp;gt;open.&lt;/P&gt;
&lt;P&gt;Further looking into the mean reversion assumption, I tested (with optimization - sorry) the following system on SPY from 3/12/1997 to 5/8/2009, including some long-term trend filter:&lt;/P&gt;
&lt;P&gt;LE: ref(c&amp;lt;ref(O,-8) and l&amp;gt;mov(c,282,e),-1)&lt;/P&gt;
&lt;P&gt;LX: ref(c&amp;gt;ref(O,-1)&amp;nbsp;or l&amp;lt;mov(c,282,e),-1)&lt;/P&gt;
&lt;P&gt;SE: ref(c&amp;gt;ref(O,-1) and h&amp;lt;mov(c,282,e),-1)&lt;/P&gt;
&lt;P&gt;SX: ref(c&amp;lt;ref(O,-8)&amp;nbsp;or l&amp;gt;mov(c,282,e),-1)&lt;/P&gt;
&lt;P&gt;With the following parameters:&lt;/P&gt;
&lt;P&gt;Interest 0%&lt;/P&gt;
&lt;P&gt;Margin 3%&lt;/P&gt;
&lt;P&gt;100% available equity&lt;/P&gt;
&lt;P&gt;Position Limit 1&lt;/P&gt;
&lt;P&gt;Long Initial 100%&lt;/P&gt;
&lt;P&gt;Long Maintenance 0%&lt;/P&gt;
&lt;P&gt;Short Initial 200%&lt;/P&gt;
&lt;P&gt;Short Maintenance 101%&lt;/P&gt;
&lt;P&gt;Commissions $10&lt;/P&gt;
&lt;P&gt;Realistic Market Price No&lt;/P&gt;
&lt;P&gt;Delay to Open 0&lt;/P&gt;
&lt;P&gt;All trades at Close&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The results stats look good and the equity curve almost improbably good.&amp;nbsp; Would anybody care to post comments on this system?&amp;nbsp; Is it realistic from a practical point of view?&lt;/P&gt;
&lt;P&gt;Many thanks.&lt;/P&gt;
&lt;P&gt;ZigZag&lt;/P&gt;</description></item><item><title>Can the Parabolic SAR be programmed from scratch with the MSFL?</title><link>http://forum.equis.com/forums/thread/29634.aspx</link><pubDate>Wed, 06 May 2009 01:18:28 GMT</pubDate><guid isPermaLink="false">2fa994ca-da92-4cc0-8578-1c713492f1d7:29634</guid><dc:creator>jhughey</dc:creator><slash:comments>6</slash:comments><comments>http://forum.equis.com/forums/thread/29634.aspx</comments><wfw:commentRss>http://forum.equis.com/forums/commentrss.aspx?SectionID=3053&amp;PostID=29634</wfw:commentRss><description>&lt;br&gt;Hello,&lt;br&gt;&lt;br&gt;&lt;p class="MsoNormal"&gt;As an exercise in Basic Metastock Programming, is it possible to use
the MSFL to create the Parabolic SAR from scratch?&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/p&gt;

&lt;p class="MsoNormal"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/p&gt;

&lt;p class="MsoNormal"&gt;Yes, I do realize MSFL has the SAR() function, MS has the SAR indicator,
and there are probably many DLLs out there, and I have studied the MSFL functions in the User's Guide until I am cross-eyed.&lt;span&gt;&amp;nbsp;&amp;nbsp;
&lt;/span&gt;However, I would like to play with variations on the basic SAR algorithm;
and, just for the nut of it, determine whether or not such an indicator can be
done solely with the MSFL.&lt;span&gt;&amp;nbsp; &lt;/span&gt;&lt;/p&gt;

&lt;p class="MsoNormal"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/p&gt;

&lt;p class="MsoNormal"&gt;If it is possible to program the SAR, perhaps someone in this forum
might use this as an example to demonstrate the power of the MSFL to us
less-experienced basic programmers?&lt;span&gt;&amp;nbsp; &lt;/span&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;I
think my problem is understanding the initialization and propagation of
parameters with the MSFL, along with the roles of&lt;span&gt;&amp;nbsp; &lt;/span&gt;PREV and Ref()?&lt;span&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;If it
cannot be done, perhaps this would a good place to explain the restrictions?&lt;/p&gt;

&lt;p class="MsoNormal"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/p&gt;

&lt;p class="MsoNormal"&gt;If anyone is interested, here is the attempt with lots of commented documentation.&lt;span&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;I checked the syntax with the formula editor,
so it should be cut-and-paste ready.&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; I shall be happy to post the final results if anyone can get me past the fundamental glitches.&lt;br&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;br&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;Thanks!&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;br&gt;&lt;/p&gt;

&lt;p class="MsoNormal"&gt;&lt;o:p&gt;======================================================= &lt;br&gt;&lt;/o:p&gt;&lt;/p&gt;

&lt;p class="MsoNormal"&gt;{ &lt;span&gt;&amp;nbsp;&lt;/span&gt;PARABOLIC &lt;span&gt;&amp;nbsp;&lt;/span&gt;SAR &lt;span&gt;&amp;nbsp;&lt;/span&gt;IN &lt;span&gt;&amp;nbsp;&lt;/span&gt;METASTOCK &lt;span&gt;&amp;nbsp;&lt;/span&gt;FORMULA &lt;span&gt;&amp;nbsp;&lt;/span&gt;LANGUAGE }&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;

&lt;p class="MsoNormal"&gt;{&lt;span&gt;&amp;nbsp; &lt;/span&gt;Using an Acceleration Factor Step of 0.02
with a max of 0.20&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;

&lt;p class="MsoNormal"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/p&gt;

&lt;p class="MsoNormal"&gt;{ POS = 1
means Long Position; 0 means Short.&amp;nbsp;&amp;nbsp; }&lt;/p&gt;

&lt;p class="MsoNormal"&gt;{ We start
with Long&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;

&lt;p class="MsoNormal"&gt;&lt;b&gt;POS := If(Cum(1)=1, 1, PREV);&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/p&gt;

&lt;p class="MsoNormal"&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;

&lt;p class="MsoNormal"&gt;{ Use Long
and Short Booleans to improve code readability }&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;

&lt;p class="MsoNormal"&gt;&lt;b&gt;Long := If(Cum(1)=1, 1, PREV);&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/p&gt;

&lt;p class="MsoNormal"&gt;&lt;b&gt;Short := If(Cum(1)=1, 0, PREV&lt;/b&gt;);&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;

&lt;p class="MsoNormal"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/p&gt;

&lt;p class="MsoNormal"&gt;{ Start with
the maximum Acceleration Factor}&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;

&lt;p class="MsoNormal"&gt;&lt;b&gt;AF := If(Cum(1)=1, 0.20, PREV);&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/p&gt;

&lt;p class="MsoNormal"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/p&gt;

&lt;p class="MsoNormal"&gt;{ Start with
SAR equal to the Low}&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;

&lt;p class="MsoNormal"&gt;&lt;b&gt;MySAR := If(Cum(1)=1, L, PREV);&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/p&gt;

&lt;p class="MsoNormal"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/p&gt;

&lt;p class="MsoNormal"&gt;{ Start with
the Extreme Price equal to the High}&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;

&lt;p class="MsoNormal"&gt;&lt;b&gt;ExtPrc := If(Cum(1)=1, H, PREV);&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/p&gt;

&lt;p class="MsoNormal"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/p&gt;

&lt;p class="MsoNormal"&gt;{ Calculate
the Acceleration Factor First&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;

&lt;p class="MsoNormal"&gt;{ If the
position changes, reset AF to 0.02&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;

&lt;p class="MsoNormal"&gt;{ If the
position does not change:&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&lt;/span&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;

&lt;p class="MsoNormal"&gt;{&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;- increment AF if long and higher highs &lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;} &lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;

&lt;p class="MsoNormal"&gt;{&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;- increment AF if short and lower lows &lt;span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;

&lt;p class="MsoNormal"&gt;{&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;- otherwise, AF does not change.&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;

&lt;p class="MsoNormal"&gt;&lt;b&gt;AF := If(POS &amp;lt;&amp;gt; Ref(POS,-1) , 0.02, &lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/p&gt;

&lt;p class="MsoNormal"&gt;&lt;b&gt;If((Long&lt;span&gt;&amp;nbsp;
&lt;/span&gt;AND H&amp;gt;Ref(H,-1) ) OR (Short AND L&amp;lt;Ref(L,-1)),&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/p&gt;

&lt;p class="MsoNormal"&gt;&lt;b&gt;If(PREV+0.02&amp;lt;0.20, PREV+0.02, 0.20),&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/b&gt;{ increment, but don’t exceed max AF}&lt;/p&gt;

&lt;p class="MsoNormal"&gt;&lt;b&gt;PREV));&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/p&gt;

&lt;p class="MsoNormal"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/p&gt;

&lt;p class="MsoNormal"&gt;{If Long,
the Extreme Price is the highest high }&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;

&lt;p class="MsoNormal"&gt;{If Short,
it is the lowest low.&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;

&lt;p class="MsoNormal"&gt;&lt;b&gt;ExtPrc := &lt;span&gt;&amp;nbsp;&lt;/span&gt;If(long AND H&amp;gt;PREV, H, If(short AND
L&amp;lt;PREV, L, PREV)); &lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/p&gt;

&lt;p class="MsoNormal"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/p&gt;

&lt;p class="MsoNormal"&gt;{ Calculate
SAR from yesterday’s values&lt;span&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;

&lt;p class="MsoNormal"&gt;{ This had
to be broken down into NewSAR&lt;span&gt;&amp;nbsp; &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;

&lt;p class="MsoNormal"&gt;{ to avoid
MSFL binary overflow.&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;

&lt;p class="MsoNormal"&gt;&lt;b&gt;NewSAR := (Ref(ExtPrc,-1) -
Ref(MySAR,-1))*Ref(AF,-1) + Ref(MySAR,-1); &lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/p&gt;

&lt;p class="MsoNormal"&gt;&lt;b&gt;MySAR &lt;span&gt;&amp;nbsp;&lt;/span&gt;:= &lt;span&gt;&amp;nbsp;&lt;/span&gt;If(POS
&amp;lt;&amp;gt; Ref(POS,-1), Ref(ExtPrc,-1), NewSAR);&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/p&gt;&lt;br&gt;&lt;p class="MsoNormal"&gt;&lt;b&gt;&lt;/b&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;

&lt;p class="MsoNormal"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/p&gt;

&lt;p class="MsoNormal"&gt;{Now we have
a new SAR, do we need a new position?}&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;

&lt;p class="MsoNormal"&gt;&lt;b&gt;POS := If(Long AND MySAR&amp;gt;L,0,&lt;/b&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;{ Switch to Short&lt;span&gt;&amp;nbsp; &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;

&lt;p class="MsoNormal"&gt;&lt;b&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&lt;/span&gt;If(Short AND MySAR&amp;lt;H,1,&lt;/b&gt; &lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;{ Switch to Long&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;

&lt;p class="MsoNormal"&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;b&gt;PREV));&lt;/b&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;{ Otherwise don't change }&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;

&lt;p class="MsoNormal"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/p&gt;

&lt;p class="MsoNormal"&gt;{ Change
Short and Long as appropriate for new position.&lt;span&gt;&amp;nbsp;
&lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;

&lt;p class="MsoNormal"&gt;&lt;b&gt;Short := If(POS,0,1);&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/p&gt;

&lt;b&gt;&lt;span&gt;Long
:= If(POS,1,0);&lt;/span&gt;&lt;/b&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;



&lt;b&gt;MySAR;&lt;/b&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;</description></item><item><title>Simple Coding Question</title><link>http://forum.equis.com/forums/thread/29638.aspx</link><pubDate>Wed, 06 May 2009 10:29:36 GMT</pubDate><guid isPermaLink="false">2fa994ca-da92-4cc0-8578-1c713492f1d7:29638</guid><dc:creator>ksrt</dc:creator><slash:comments>10</slash:comments><comments>http://forum.equis.com/forums/thread/29638.aspx</comments><wfw:commentRss>http://forum.equis.com/forums/commentrss.aspx?SectionID=3053&amp;PostID=29638</wfw:commentRss><description>Hi &lt;br /&gt;&lt;br /&gt;I am trying to build an indicator as an expert advisor, giving +1 for long positions and -1 for short positions but when I plot even a simple version like below it plots positive 1 for both! &lt;br /&gt;&lt;br /&gt;If(Cross(RSI(14),30),1,0) OR If(Cross(70,RSI(14)),-1,0)&lt;br /&gt;&lt;br /&gt;Is there something I am doing wrong??</description></item><item><title>Passing paramaters to fml</title><link>http://forum.equis.com/forums/thread/29620.aspx</link><pubDate>Tue, 05 May 2009 03:30:01 GMT</pubDate><guid isPermaLink="false">2fa994ca-da92-4cc0-8578-1c713492f1d7:29620</guid><dc:creator>SMenday</dc:creator><slash:comments>3</slash:comments><comments>http://forum.equis.com/forums/thread/29620.aspx</comments><wfw:commentRss>http://forum.equis.com/forums/commentrss.aspx?SectionID=3053&amp;PostID=29620</wfw:commentRss><description>&lt;P&gt;Hi&lt;/P&gt;
&lt;P&gt;Is it possible to pass paramaters using fml and if not is there some other way.&amp;nbsp; I want to be able to use a custom indicator in a system test but I want to be able to pass the indicator a value.&lt;/P&gt;
&lt;P&gt;Cheers&lt;/P&gt;
&lt;P&gt;Stew&lt;/P&gt;</description></item><item><title>Keeping Track of the Next Highest High or Lowest Low for a Basic SAR Calculation</title><link>http://forum.equis.com/forums/thread/29590.aspx</link><pubDate>Fri, 01 May 2009 16:00:13 GMT</pubDate><guid isPermaLink="false">2fa994ca-da92-4cc0-8578-1c713492f1d7:29590</guid><dc:creator>jhughey</dc:creator><slash:comments>4</slash:comments><comments>http://forum.equis.com/forums/thread/29590.aspx</comments><wfw:commentRss>http://forum.equis.com/forums/commentrss.aspx?SectionID=3053&amp;PostID=29590</wfw:commentRss><description>
 
  Normal
  0
  
  
  
  
  false
  false
  false
  
  EN-US
  X-NONE
  X-NONE
  
   
   
   
   
   
   
   
   
   
   
   
  
  MicrosoftInternetExplorer4
  
   
   
   
   
   
   
   
   
   
   
   
  

 
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
 




 /* Style Definitions */
 table.MsoNormalTable
	{mso-style-name:"Table Normal";
	mso-tstyle-rowband-size:0;
	mso-tstyle-colband-size:0;
	mso-style-noshow:yes;
	mso-style-priority:99;
	mso-style-qformat:yes;
	mso-style-parent:"";
	mso-padding-alt:0in 5.4pt 0in 5.4pt;
	mso-para-margin-top:0in;
	mso-para-margin-right:0in;
	mso-para-margin-bottom:6.0pt;
	mso-para-margin-left:0in;
	line-height:115%;
	mso-pagination:widow-orphan;
	font-size:11.0pt;
	font-family:"Calibri","sans-serif";
	mso-ascii-font-family:Calibri;
	mso-ascii-theme-font:minor-latin;
	mso-fareast-font-family:"Times New Roman";
	mso-fareast-theme-font:minor-fareast;
	mso-hansi-font-family:Calibri;
	mso-hansi-theme-font:minor-latin;}



&lt;p class="MsoNormal"&gt;&amp;nbsp;&lt;/p&gt;&lt;p class="MsoNormal"&gt;Hello,&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;br&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;I am trying to reproduce the Parabolic SAR calculation, and
I am having problems keeping track of the Next Extreme High/Low Point when it
toggles Long/Short.&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/p&gt;

&lt;p class="MsoNormal"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/p&gt;

&lt;p class="MsoNormal"&gt;So far I am able to use Excel to correctly reproduce the tabulated
SAR example in the Achelis’ book, “Technical Analysis from A to Z” (without
typos);&lt;span&gt;&amp;nbsp; &lt;/span&gt;and,&lt;span&gt;&amp;nbsp; &lt;/span&gt;if&lt;span&gt;&amp;nbsp; &lt;/span&gt;I
try the Excel calculations on several hundred H/L values of a real stock, the
Excel chart looks great.&lt;span&gt;&amp;nbsp; &lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;The problem is translating this over to the
Metastock Formula Language.&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/p&gt;

&lt;p class="MsoNormal"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/p&gt;

&lt;p class="MsoNormal"&gt;Ideally, I want the Next Extreme Point (NEP) to be the
Highest High while SAR is Long, then toggle to be the Lowest Low while SAR is
Short.&lt;span&gt;&amp;nbsp; &lt;/span&gt;… etc.&lt;/p&gt;

&lt;p class="MsoNormal"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/p&gt;

&lt;p class="MsoNormal"&gt;Here is a Next Extreme Point calculation using the Metastock
SAR as a toggle.&lt;span&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;Unfortunately, nothing
is displayed.&lt;span&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/p&gt;

&lt;p class="MsoNormal"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/p&gt;

&lt;p class="MsoNormal"&gt;Even if there is an alternative SAR calculation, I would really
like to know why this does this not work, and how can I get it to work?&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;br&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;Thanks!&lt;br&gt;&lt;/p&gt;

&lt;p class="MsoNormal"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/p&gt;

&lt;p class="MsoNormal"&gt;SARms := SAR(0.02,0.2);&lt;/p&gt;

&lt;p class="MsoNormal"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/p&gt;

&lt;p class="MsoNormal"&gt;{ Long / Short Toggles}&lt;/p&gt;

&lt;p class="MsoNormal"&gt;LONG := IF( SARms&lt;span&gt;&amp;nbsp; &lt;/span&gt;&amp;lt;&lt;span&gt;&amp;nbsp; &lt;/span&gt;Low &lt;span&gt;&amp;nbsp;&lt;/span&gt;AND
&lt;span&gt;&amp;nbsp;&lt;/span&gt;Ref(SARms,-1) &lt;span&gt;&amp;nbsp;&lt;/span&gt;&amp;gt; &lt;span&gt;&amp;nbsp;&lt;/span&gt;Ref(High,-1)
, 1 , 0);&lt;/p&gt;

&lt;p class="MsoNormal"&gt;SHORT := IF( SARms &amp;gt; High &lt;span&gt;&amp;nbsp;&lt;/span&gt;AND &lt;span&gt;&amp;nbsp;&lt;/span&gt;Ref(SARms,-1)
&lt;span&gt;&amp;nbsp;&lt;/span&gt;&amp;lt; &lt;span&gt;&amp;nbsp;&lt;/span&gt;Ref(Low,-1) , 1 , 0);&lt;/p&gt;

&lt;p class="MsoNormal"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/p&gt;

&lt;p class="MsoNormal"&gt;{ NEP is the Next Extreme Point } &lt;/p&gt;

&lt;p class="MsoNormal"&gt;NEP&lt;span&gt;&amp;nbsp; &lt;/span&gt;:= IF( &lt;span&gt;&amp;nbsp;&lt;/span&gt;LONG &lt;span&gt;&amp;nbsp;&lt;/span&gt;AND &lt;span&gt;&amp;nbsp;&lt;/span&gt;Ref(NEP,
-1) &lt;span&gt;&amp;nbsp;&lt;/span&gt;&amp;lt; &lt;span&gt;&amp;nbsp;&lt;/span&gt;High , High , Ref(NEP,-1) &lt;span&gt;&amp;nbsp;&lt;/span&gt;);&lt;/p&gt;&lt;p class="MsoNormal"&gt;NEP&lt;span&gt;&amp;nbsp; &lt;/span&gt;:= IF( &lt;span&gt;&amp;nbsp;&lt;/span&gt;SHORT &lt;span&gt;&amp;nbsp;&lt;/span&gt;AND
&lt;span&gt;&amp;nbsp;&lt;/span&gt;Ref(NEP, -1) &lt;span&gt;&amp;nbsp;&lt;/span&gt;&amp;gt; &lt;span&gt;&amp;nbsp;&lt;/span&gt;Low
, Low , Ref(NEP, -1) );

&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/p&gt;

&lt;span&gt;NEP;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;/span&gt;</description></item><item><title>linear regression slope and linear regression</title><link>http://forum.equis.com/forums/thread/29513.aspx</link><pubDate>Mon, 20 Apr 2009 03:25:20 GMT</pubDate><guid isPermaLink="false">2fa994ca-da92-4cc0-8578-1c713492f1d7:29513</guid><dc:creator>Mr Travis</dc:creator><slash:comments>1</slash:comments><comments>http://forum.equis.com/forums/thread/29513.aspx</comments><wfw:commentRss>http://forum.equis.com/forums/commentrss.aspx?SectionID=3053&amp;PostID=29513</wfw:commentRss><description>&lt;P&gt;can any one in this forum tell me the differences between these 2 indicators?&lt;/P&gt;
&lt;P&gt;also I have had a chance to visit Jose Silva web page indicator formula for linear regression slope and linear regression. is that the standard function ( the same as metastock equis )? if they are not the same can someone show me the basic code for these indicators?&lt;/P&gt;
&lt;P&gt;I just wish to construct them by my self&lt;/P&gt;
&lt;P&gt;Many thanks &lt;/P&gt;
&lt;P&gt;Dave&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description></item></channel></rss>