<?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>Advanced Coding Techniques</title><link>http://forum.equis.com/forums/3027/ShowForum.aspx</link><description>Advanced MetaStock Coding Techniques &lt;BR&gt;Group Manager: &lt;A href="http://www.metastocktips.com/" target=_blank&gt;Roy Larsen&lt;/A&gt;</description><dc:language>en-US</dc:language><generator>CommunityServer 2.0 (Debug Build: 60217.2664)</generator><item><title>sell stop that works with L signals on first day already - possible?</title><link>http://forum.equis.com/forums/thread/31070.aspx</link><pubDate>Mon, 02 Nov 2009 05:19:33 GMT</pubDate><guid isPermaLink="false">2fa994ca-da92-4cc0-8578-1c713492f1d7:31070</guid><dc:creator>exito100</dc:creator><slash:comments>0</slash:comments><comments>http://forum.equis.com/forums/thread/31070.aspx</comments><wfw:commentRss>http://forum.equis.com/forums/commentrss.aspx?SectionID=3027&amp;PostID=31070</wfw:commentRss><description>&lt;P&gt;Hello Metastock wizards,&lt;/P&gt;
&lt;P&gt;I looking for a code that creates a simple percentage stop that works on the first bar and triggered by the low price.&amp;nbsp;I can't believe nobody has created such a thing..or worse it's not possible in MS - based on my own programming attempts and conversations with others. It specifically should do:&lt;/P&gt;
&lt;P&gt;1) buy on open one day after buy is triggered (optional: buy non delayed but use closing price)&lt;/P&gt;
&lt;P&gt;2) ability to sell on same day as purchase happend if sell stop is triggered on same day&lt;/P&gt;
&lt;P&gt;3) sell stop refers to the actual buy price according to 1)&lt;/P&gt;
&lt;P&gt;4) sell stop works instantly - same day and following days -&amp;nbsp; not only after 2days as in e.g Jose's code below&lt;/P&gt;
&lt;P&gt;5) sell stop is triggered (L) not just on close &lt;/P&gt;
&lt;P&gt;6)&amp;nbsp; "clean" sell and buy signals i.e. a proper latch with no consecutive buys or sells - the usual..&lt;/P&gt;
&lt;P&gt;7) no prev function and fast; dll prefered or combo MSFL with dll&lt;/P&gt;
&lt;P&gt;The problem seem the buy/sell signal on the same day. And also with richard Doyle's advanced stop dll , the dll requires at least one day after buy to reset. So the stop won't work on the first two days.&lt;/P&gt;
&lt;P&gt;I would not even need a trailing stop or a profit stop - though it would be a bonus.&lt;/P&gt;
&lt;P&gt;Has someone out there a solution for a stop that actually works right away and fast (no prevs) on low (L)&amp;nbsp;signals? :)&lt;/P&gt;
&lt;P&gt;Any help or pointers are greatly appreciated,&lt;/P&gt;
&lt;P&gt;Klaus&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description></item><item><title>Value Area... POC, VAL, VAH...</title><link>http://forum.equis.com/forums/thread/31024.aspx</link><pubDate>Wed, 28 Oct 2009 22:57:40 GMT</pubDate><guid isPermaLink="false">2fa994ca-da92-4cc0-8578-1c713492f1d7:31024</guid><dc:creator>gabibbo</dc:creator><slash:comments>0</slash:comments><comments>http://forum.equis.com/forums/thread/31024.aspx</comments><wfw:commentRss>http://forum.equis.com/forums/commentrss.aspx?SectionID=3027&amp;PostID=31024</wfw:commentRss><description>&lt;P&gt;Hi, lately I've followed some interesting threads about Value Area in a forum discussing trading in all his different aspects (TradersLaboratory).&lt;/P&gt;
&lt;P&gt;As MS user I'm now wondering if it is possible to implement such indicators (levels) in MetaStock and if there's anybody who tried to do it in the past. &lt;/P&gt;
&lt;P&gt;For those who never heard about this particular price levels, following is a brief description... &lt;/P&gt;
&lt;P&gt;first I've to say that these levels are useful&amp;nbsp;only for intraday trading... there're 3 main levels called POC... Point of Control, VAL... Lowest of the Value Area, VAH... Highest of the Value Area and they must be plotted on today chart(session); &lt;/P&gt;
&lt;P&gt;the POC is the price level where yesterday most of the volume&amp;nbsp;was traded at (it's simply the level of the higher volume by price&amp;nbsp;value for yesterday) &lt;/P&gt;
&lt;P&gt;the VAL and the VAH are the extreme of the Value Area that is usually considered (and calculated) as the 70% of the price area where the total yesterday volume was traded... for more knowledge take a look here &lt;BR&gt;&lt;A href="http://www.mypivots.com/investopedia/40/calculating-market-profile-value-area"&gt;http://www.mypivots.com/investopedia/40/calculating-market-profile-value-area&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;taken from that page... calculating VAH and VAL &lt;BR&gt;" Starting at the POC we add together the TPO's by moving&lt;BR&gt;in the direction of the closest price (higher or lower) with &lt;BR&gt;the most TPO's. We do this by moving in pairs of prices. &lt;BR&gt;If both 'next'/adjacent prices have the same number of TPO's &lt;BR&gt;we choose the higher price. &lt;BR&gt;We stop when the cumulative percentage of TPO's breaks 68%." &lt;/P&gt;
&lt;P&gt;I think the main problem is, as well as&amp;nbsp;with every intraday formula &lt;BR&gt;needing data-value from previous session, to take yesterday &lt;BR&gt;value and use/plot them today.&lt;/P&gt;
&lt;P&gt;All ideas will be appreciated.&lt;/P&gt;
&lt;P&gt;Regards&lt;/P&gt;
&lt;P&gt;gabibbo&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description></item><item><title>Help required</title><link>http://forum.equis.com/forums/thread/30925.aspx</link><pubDate>Sat, 10 Oct 2009 18:47:01 GMT</pubDate><guid isPermaLink="false">2fa994ca-da92-4cc0-8578-1c713492f1d7:30925</guid><dc:creator>perfecttip</dc:creator><slash:comments>0</slash:comments><comments>http://forum.equis.com/forums/thread/30925.aspx</comments><wfw:commentRss>http://forum.equis.com/forums/commentrss.aspx?SectionID=3027&amp;PostID=30925</wfw:commentRss><description>Is this possible ? &lt;br /&gt;What I am looking for is automation of the stock picking process. Please allow me to discuss in detail the aspects I am looking for. &lt;br /&gt;&lt;br /&gt;1. Camarilla levels shall be calculated as per the following equations : &lt;br /&gt;H5 = (H/L)*C &lt;br /&gt;H4 = [1.1*(H-L)/2]+C &lt;br /&gt;H3 = [1.1*(H-L)/4]+C &lt;br /&gt;H2 = [1.1*(H-L)/6]+C &lt;br /&gt;H1 = [1.1*(H-L)/12]+C &lt;br /&gt;&lt;br /&gt;L1 = C-[1.1*(H-L)/12] &lt;br /&gt;L2 = C-[1.1*(H-L)/6] &lt;br /&gt;L3 = C-[1.1*(H-L)/4] &lt;br /&gt;L4 = C-[1.1*(H-L)/2] &lt;br /&gt;L5 = C-(H5-C) &lt;br /&gt;&lt;br /&gt;2.These levels must be used to develop a Custom Indicator, a Custom Exploration and a Custom Expert Advisor. &lt;br /&gt;3.All of the above must take care of trading holidays even those which fall within the week. &lt;br /&gt;4.Custom Indicator : An integrated indicator which will display the weekly and daily Camarilla levels when plotted on any chart irrespective of whether it is an RealTime intraday chart, a daily chart or a weekly chart with easily recognisable colour coding. Also a seperate indicator for monthly Camarilla levels. &lt;br /&gt;5.Custom Exploration : Three seperate explorations (daily, weekly and monthly) to find out which stocks are trading near any of the Camarila levels. &lt;br /&gt;6.Custom Expert Advisor : An advisor which when attached to a chart, whether its an RT intraday chart, a weekly chart or a monthly chart, alerts with a visual and audio alert when the stock trades near any of the Daily, Weekly or Monthly Camarilla levels. &lt;br /&gt;7.Changes necessary in the coding if the numbers (2,4,6,12) in the equations are to me modified. &lt;br /&gt;8.System tester.&lt;br /&gt;9.Passowrd protection (of course should be know to me) for all of the above.</description></item><item><title>Pointfig code?</title><link>http://forum.equis.com/forums/thread/30890.aspx</link><pubDate>Tue, 06 Oct 2009 09:35:29 GMT</pubDate><guid isPermaLink="false">2fa994ca-da92-4cc0-8578-1c713492f1d7:30890</guid><dc:creator>tengfei932</dc:creator><slash:comments>1</slash:comments><comments>http://forum.equis.com/forums/thread/30890.aspx</comments><wfw:commentRss>http://forum.equis.com/forums/commentrss.aspx?SectionID=3027&amp;PostID=30890</wfw:commentRss><description>Hello,&lt;br&gt;&lt;br&gt;&amp;nbsp;&amp;nbsp; I wanted to know if the code for pointfig.dll (point and figure) is public and if I can view it.&lt;br&gt;&lt;br&gt;Thanks you,&lt;br&gt;Teng&lt;br&gt;</description></item><item><title>Marubozu candle stick pattern</title><link>http://forum.equis.com/forums/thread/30831.aspx</link><pubDate>Fri, 25 Sep 2009 03:22:06 GMT</pubDate><guid isPermaLink="false">2fa994ca-da92-4cc0-8578-1c713492f1d7:30831</guid><dc:creator>shanthi</dc:creator><slash:comments>1</slash:comments><comments>http://forum.equis.com/forums/thread/30831.aspx</comments><wfw:commentRss>http://forum.equis.com/forums/commentrss.aspx?SectionID=3027&amp;PostID=30831</wfw:commentRss><description>can any one help me to create new explorer for finding securities matching Marubozu chart pattern&lt;br /&gt;</description></item><item><title>Exploration </title><link>http://forum.equis.com/forums/thread/30832.aspx</link><pubDate>Fri, 25 Sep 2009 03:28:49 GMT</pubDate><guid isPermaLink="false">2fa994ca-da92-4cc0-8578-1c713492f1d7:30832</guid><dc:creator>shanthi</dc:creator><slash:comments>1</slash:comments><comments>http://forum.equis.com/forums/thread/30832.aspx</comments><wfw:commentRss>http://forum.equis.com/forums/commentrss.aspx?SectionID=3027&amp;PostID=30832</wfw:commentRss><description>can any one help me to create a new explorer to find securities matching the following candle stock patterns&lt;br /&gt;&lt;br /&gt;1. Bullish Kicking Pattern (The Bullish Kicking Pattern is a White Marubozu following a Black Marubozu)&lt;br /&gt;&lt;br /&gt;2.Abandoned Baby (It is composed of a Doji Star, which gaps away (including shadows) from the prior and following days’ candlesticks.)&lt;br /&gt;&lt;br /&gt;3. BULLISH CONCEALING BABY SWALLOW (:              This pattern is highlighted by two consecutive Black Marubozu. They are characterized by the fact that a gapping black candlestick trades into the body of the previous day and it is seen during a downtrend. Then there is another Black Marubozu on the third day showing sale of positions since it closes at a new low. However this may give incentive to the shorts to cover their positions implying that a bullish reversal is now possible.)&lt;br /&gt;&lt;br /&gt;</description></item><item><title>Pairs trading</title><link>http://forum.equis.com/forums/thread/30624.aspx</link><pubDate>Mon, 07 Sep 2009 18:47:46 GMT</pubDate><guid isPermaLink="false">2fa994ca-da92-4cc0-8578-1c713492f1d7:30624</guid><dc:creator>decofeevale</dc:creator><slash:comments>2</slash:comments><comments>http://forum.equis.com/forums/thread/30624.aspx</comments><wfw:commentRss>http://forum.equis.com/forums/commentrss.aspx?SectionID=3027&amp;PostID=30624</wfw:commentRss><description>Hellow&lt;br&gt;&lt;br&gt;i have thwo securities and i have to buy "A" and sell "B" when RSI(14)&amp;lt;30! How can i do it?Can i test in the system tester?&lt;br&gt;&lt;br&gt;thanks Deco&lt;br&gt;</description></item><item><title>Help Wanted - Normalized RSI Indicator Coding</title><link>http://forum.equis.com/forums/thread/30194.aspx</link><pubDate>Sat, 18 Jul 2009 15:50:07 GMT</pubDate><guid isPermaLink="false">2fa994ca-da92-4cc0-8578-1c713492f1d7:30194</guid><dc:creator>zigzag</dc:creator><slash:comments>14</slash:comments><comments>http://forum.equis.com/forums/thread/30194.aspx</comments><wfw:commentRss>http://forum.equis.com/forums/commentrss.aspx?SectionID=3027&amp;PostID=30194</wfw:commentRss><description>Hello All&lt;br /&gt;&lt;br /&gt;Borrowing from the idea of a RSI indicator with extremes normalized for bull and bear phases (from June 2009 issue of TASC by Giorgos Siligardos, copyright 2009 Technical Analysis Inc, all rights reserved), I have attempted to code an RSI that would have it's extreme boundaries automatically  adjusted according to four "phases" of an ATR-based indicator, as follows:&lt;br /&gt;&lt;br /&gt;indic:=ATR(21)/((H+L)/2)*100&lt;br /&gt;&lt;br /&gt;The general formula for this normalized RSI is (rsi(prd)-rsi(prd) low boundary)/(rsi(prd) high boundary-rsi(prd) low boundary).&lt;br /&gt;&lt;br /&gt;Here is my attempt at the code:&lt;br /&gt;&lt;br /&gt;hi1:=Highest(ValueWhen(1,indichi2:=Highest(ValueWhen(1,1hi3:=Highest(ValueWhen(1,2hi4:=Highest(ValueWhen(1,indic&gt;4,RSI(14)));&lt;br /&gt;&lt;br /&gt;lo1:=Lowest(ValueWhen(1,indiclo2:=Lowest(ValueWhen(1,1lo3:=Lowest(ValueWhen(1,2lo4:=Lowest(ValueWhen(1,indic&gt;4,RSI(14)));&lt;br /&gt;&lt;br /&gt;hilo1:=hi1-lo1;&lt;br /&gt;hilo2:=hi2-lo2;&lt;br /&gt;hilo3:=hi3-lo3;&lt;br /&gt;hilo4:=hi4-lo4;&lt;br /&gt;&lt;br /&gt;If(indic&lt;br /&gt;The problem is that it only plots the latest "phase" of the ATR indicator.&lt;br /&gt;&lt;br /&gt;Would anybody like to take a swing at it?&lt;br /&gt;&lt;br /&gt;Many thanks.&lt;br /&gt;&lt;br /&gt;ZigZag</description></item><item><title>advanced System tester - stop gain</title><link>http://forum.equis.com/forums/thread/30136.aspx</link><pubDate>Tue, 14 Jul 2009 04:20:11 GMT</pubDate><guid isPermaLink="false">2fa994ca-da92-4cc0-8578-1c713492f1d7:30136</guid><dc:creator>andre.capit</dc:creator><slash:comments>0</slash:comments><comments>http://forum.equis.com/forums/thread/30136.aspx</comments><wfw:commentRss>http://forum.equis.com/forums/commentrss.aspx?SectionID=3027&amp;PostID=30136</wfw:commentRss><description>Hello&lt;br&gt;&lt;br&gt;I´m having some troubles trying to set a parcial stop gain.&lt;br&gt;&lt;br&gt;Imagine that I need to sell only half of my position when the price gets the stop gain.&lt;br&gt;&lt;br&gt;It´s possible?&lt;br&gt;&lt;br&gt;Hugs and thanks for help.&lt;br&gt;&lt;br&gt;André&lt;br&gt;RS - Brazil&lt;br&gt;</description></item><item><title>MOV AVG CROSS SYSTEM</title><link>http://forum.equis.com/forums/thread/29932.aspx</link><pubDate>Wed, 17 Jun 2009 19:39:09 GMT</pubDate><guid isPermaLink="false">2fa994ca-da92-4cc0-8578-1c713492f1d7:29932</guid><dc:creator>budfox45</dc:creator><slash:comments>1</slash:comments><comments>http://forum.equis.com/forums/thread/29932.aspx</comments><wfw:commentRss>http://forum.equis.com/forums/commentrss.aspx?SectionID=3027&amp;PostID=29932</wfw:commentRss><description>On a mov Avg cross system like &lt;br /&gt;cross(mov(DataArray,periods,S),(mov(DataArray,periods,S))) &lt;br /&gt;&lt;br /&gt;how can I comfirm the buy on a higher low AFTER the symbol bar high &lt;br /&gt;&lt;br /&gt;</description></item><item><title>code for Pullback system</title><link>http://forum.equis.com/forums/thread/29879.aspx</link><pubDate>Mon, 08 Jun 2009 20:35:33 GMT</pubDate><guid isPermaLink="false">2fa994ca-da92-4cc0-8578-1c713492f1d7:29879</guid><dc:creator>zigzag</dc:creator><slash:comments>3</slash:comments><comments>http://forum.equis.com/forums/thread/29879.aspx</comments><wfw:commentRss>http://forum.equis.com/forums/commentrss.aspx?SectionID=3027&amp;PostID=29879</wfw:commentRss><description>&lt;P&gt;Would anybody be interested in taking a crack at this system?&amp;nbsp; it seems very promising based on&amp;nbsp;some testing i saw in an article...&lt;/P&gt;
&lt;P&gt;I came across a system called Pullback that has the following trading rules (assume today T):&lt;/P&gt;
&lt;P&gt;A. LE setup and rule&lt;/P&gt;
&lt;P&gt;A1. two previous&amp;nbsp;closes (at bars T-2 and T-1) must have been two consecutive lower closes and&lt;/P&gt;
&lt;P&gt;A2.&amp;nbsp;H of bar at T must be higher than H at T-1 and&lt;/P&gt;
&lt;P&gt;A3. close of bar at T must be higher than the 50-period EMA of closes for bar T&lt;/P&gt;
&lt;P&gt;A4. buy at next open if A1 and A2 and A3 are all true&lt;/P&gt;
&lt;P&gt;B.&amp;nbsp;LX&lt;/P&gt;
&lt;P&gt;B1. sell&amp;nbsp;at next open when position shows a profit at close&lt;/P&gt;
&lt;P&gt;B2. sell at a loss if the L falls below lowest low of the last two bars&lt;/P&gt;
&lt;P&gt;C. Position Size&lt;/P&gt;
&lt;P&gt;number of shares to trade = 4% * available equity / (entry price-stop-loss price [item B2 above])&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This is my attempt to code it in MS's EST:&lt;/P&gt;
&lt;P&gt;BUY:&lt;/P&gt;
&lt;P&gt;LEsetup1:=ref(c,-2)&amp;lt;ref(c,-3) and ref(c,-1)&amp;lt;rf(c,-2);&lt;/P&gt;
&lt;P&gt;LEsetup2:=h&amp;gt;ref(h,-1);&lt;/P&gt;
&lt;P&gt;LEsetup3:=c&amp;gt;mov(c,50,e);&lt;/P&gt;
&lt;P&gt;LE:=LEsetup1=1 and LEsetup2=1 and LEsetup3=1;&lt;/P&gt;
&lt;P&gt;ref(LE=1,-1)&lt;/P&gt;
&lt;P&gt;SELL:&lt;/P&gt;
&lt;P&gt;LXsetup1:=valuewhen(1,LE,ref(o,1))-c&amp;gt;0;&lt;/P&gt;
&lt;P&gt;LXsetup2:=l&amp;lt;(llv(l,2),-1);&lt;/P&gt;
&lt;P&gt;LX:=LXsetup1=1 or LXsetup2=1;&lt;/P&gt;
&lt;P&gt;ref(LX,-1)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;NOT SURE HOW TO CODE&amp;nbsp;"availbale equity"&amp;nbsp;but the basic equation for position size is:&lt;/P&gt;
&lt;P&gt;number of shares to trade = 4% * available equity / (valuewhen(1,LE,ref(o,1))-ref(llv(l,2),-1))&lt;/P&gt;</description></item><item><title>mean-reversion, again</title><link>http://forum.equis.com/forums/thread/29774.aspx</link><pubDate>Sun, 24 May 2009 14:16:40 GMT</pubDate><guid isPermaLink="false">2fa994ca-da92-4cc0-8578-1c713492f1d7:29774</guid><dc:creator>zigzag</dc:creator><slash:comments>3</slash:comments><comments>http://forum.equis.com/forums/thread/29774.aspx</comments><wfw:commentRss>http://forum.equis.com/forums/commentrss.aspx?SectionID=3027&amp;PostID=29774</wfw:commentRss><description>&lt;P&gt;Following&amp;nbsp;jhughey's suggestion, i am posting the message below in the Advanced Coding session.&lt;/P&gt;
&lt;P&gt;Basically, I am&amp;nbsp;curious to know from Forum members what works and what doesn't for them in terms of indicators that try to identify mean-reverting/non-mean-reverting markets and respective trading system for each regime.&amp;nbsp; For instance, I am experimenting with oscillators (ie, rsi) for mean-reverting periods and with breakout systems for non-mean-reverting periods.&amp;nbsp; As for identifying the regime, I find that ADX is&amp;nbsp;a bit too slow and misses beginning of meaningful moves.&amp;nbsp; I am studying simple indicators that measure % change from X-period High -- for instance, (hhv(h,50)-low)/hhv(h,50) -- above/below a certain level, as indication of mean-reversion.&amp;nbsp; Nothing too earth-shattering, just looking for a simple and fairly effective method.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&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>is there a funtion in MS to COUNT no of securities satisying a particular criteria??</title><link>http://forum.equis.com/forums/thread/29696.aspx</link><pubDate>Tue, 12 May 2009 12:34:20 GMT</pubDate><guid isPermaLink="false">2fa994ca-da92-4cc0-8578-1c713492f1d7:29696</guid><dc:creator>Riii</dc:creator><slash:comments>1</slash:comments><comments>http://forum.equis.com/forums/thread/29696.aspx</comments><wfw:commentRss>http://forum.equis.com/forums/commentrss.aspx?SectionID=3027&amp;PostID=29696</wfw:commentRss><description>&lt;P&gt;Hi folks,&lt;/P&gt;
&lt;P&gt;can ne1 of u help me wid this..my aim is to create an exploration or an indicator in metastock which will scan say a 100 securities and test them for close being higher than 200 day SMA...&lt;/P&gt;
&lt;P&gt;instead of a report listing all securities..i just need to get a percentage or number of securites which satisfy the SMA condition.&lt;/P&gt;
&lt;P&gt;i need help to knw if there is any code or funtion which helps in counting the no of securities generated in the reports??&lt;/P&gt;
&lt;P&gt;all ideas are welcome:)&lt;/P&gt;
&lt;P&gt;thanks!!&lt;BR&gt;&lt;/P&gt;</description></item><item><title>Trading on/at/near the close (or the last bar)</title><link>http://forum.equis.com/forums/thread/29444.aspx</link><pubDate>Thu, 16 Apr 2009 01:43:58 GMT</pubDate><guid isPermaLink="false">2fa994ca-da92-4cc0-8578-1c713492f1d7:29444</guid><dc:creator>wabbit</dc:creator><slash:comments>0</slash:comments><comments>http://forum.equis.com/forums/thread/29444.aspx</comments><wfw:commentRss>http://forum.equis.com/forums/commentrss.aspx?SectionID=3027&amp;PostID=29444</wfw:commentRss><description>A lot of traders have asked these sort of questions before; but I am darned if I can find my stock response to the problem, so have made this new post which will hopefully incorporate many of the discussions as I remember them...&lt;br&gt;&lt;br&gt;There are many problems associated with trading on close which are not easily solved using a single application; the problems in data-responsive applications like MetaStock are even harder for many to comprehend, usually through lack of appreciation of the dependencies and inter-operability requirements of computerized systems, software, markets and data, and especially the limitations of time on those factors.&lt;br&gt;&lt;br&gt;&lt;b&gt;End of Day (EOD)&lt;/b&gt;&lt;br&gt;&lt;br&gt;Let’s start by looking at the end-of-day trader.&lt;br&gt;&lt;br&gt;Many EOD or overnight traders download their data at the end of the day.&amp;nbsp; By this time, the market is closed, the numbers finalized and no more trading is possible.&amp;nbsp; The market CLOSE price reflected in the data is exactly that, the market is closed; no more trading is done.&amp;nbsp; So how can a trader enter or exit on the CLOSE price of that day?&amp;nbsp; They cannot.&amp;nbsp; Although it possible to write a trading system which "takes" trades at the CLOSE price of the day, in real-life this is not the case.&amp;nbsp; If your system relies on you trading on the close then I suggest you review the rules to reflect what is possible in reality; the next opportunity to trade is on the next trading day at the market OPEN.&lt;br&gt;&lt;br&gt;There is an exception, actually, it’s more of a modification than an exception; some data vendors provide intraday snapshots of the market which means traders can download their “EOD” data whilst the market is still open and they can “pretend” the data is representative of the entire trading day, when in fact there is still some of the trading day missing from the data.&amp;nbsp; If their trading system signals an entry or an exit, the trader can place their order and (hopefully) it will be filled by the time the market closes.&amp;nbsp; If it does, their trade will be included in the actual market EOD data that can be downloaded after the market closes.&amp;nbsp; These traders cannot see on their data the current price action at the moment they place their orders because their data reflects what was happening at the time the data was compiled.&amp;nbsp; They can use the time of the data snapshot (within reason) to generate trading signals because they know the bar they are looking at is going to be the last bar of the trading day.&amp;nbsp; (Of course, if they download another snapshot, this last bar might change and this might affect the signal generation, but this is a risk the trader takes by choosing to get more data.)&lt;br&gt;&lt;br&gt;The trader could also look at their wrist-watch or another clock and make the trade as required which would be reflected in the true EOD data.&amp;nbsp; This is using a third-party system for trading decision making, something I shall discuss more later.&lt;br&gt;&lt;br&gt;&amp;nbsp;&lt;b&gt;Intraday&lt;/b&gt;&lt;br&gt;&lt;br&gt;On many occasions, the intraday trader often does not want to be left holding positions overnight.&amp;nbsp; (IMHO, many traders fly too close to the wind when trying to exit their positions, leaving it until the very last moment to try to close their positions, but that’s another story.)&amp;nbsp; These traders usually want to write systems which generate signals on the last bar of the chart; but here come the problems?&amp;nbsp; How does the system know the current bar on the intraday chart is the last bar of the day?&lt;br&gt;&lt;br&gt;Let’s pretend you have a system (crystal ball) which says the current bar is the last bar of the day, so the trader exits their open positions.&amp;nbsp; What effect does this have?&amp;nbsp; New trades have entered the market and been executed, and if the time has sufficiently advanced from the time of the chart a new bar is generated; so what was the last bar is no longer the last bar.&amp;nbsp; This paradox cannot be solved using code.&lt;br&gt;&lt;br&gt;Another scenario then, the trader knows this market closes at 16:00 so a bar on a 1 minute chart with a time of 15:59 is going to be the last bar of the day and IF (I repeat, IF) they can get their trade into the market, it will be incorporated into the data for that bar.&amp;nbsp; This is a possibility if the data vendor time-stamps their data with the opening time of the bar and not the closing time of the bar. The problem for the trader using MS is that MS is responsive to incoming tick data to initiate the computation of indicators and experts.&amp;nbsp; If no tick arrives, there is nothing to start the computational process which leads to the generation of trading signals.&amp;nbsp;&amp;nbsp; E.g. what happens if there is a tick of data received at 15:59:00 on the 1 minute chart?&amp;nbsp; If the computation process and the trade execution time-lag is short, a signal generated on the new tick can be reacted to and the trade placed (and filled?) in the market before it closes; this would generate a new tick which would be received by MS and the trader will feel happy.&amp;nbsp; (This tick could be used by other traders in the generation of their signals too.)&amp;nbsp; If the 15:59:00 tick arrives and the computational process is too long or there is a delay in getting to the order to the market or the market doesn’t want the order, the market will close and the trader will be left holding a position they don’t want (and maybe cannot afford?) and no new tick will be generated for that bar.&amp;nbsp; What if no tick arrives after, say, 15:57?&lt;br&gt;&lt;br&gt;In order to escape the last scenario in the example above, some traders move their target time to say 5 minutes before the close of the market.&amp;nbsp; This does not alleviate the fact that on the day, there might not be any trades filled at or after 15:55 in which case there is nothing to trigger their system to generate signals to close their positions.&amp;nbsp;&amp;nbsp; I have seen on slow days in some markets there have been no trades in the last 45 minutes of a day, whereas “normally” there are trades at least every minute of the day.&amp;nbsp; How far back is the trader willing to push the "trigger-time"?&amp;nbsp; How does an algorithmic system deal with this scenario?&amp;nbsp; It’s an even longer story.&lt;br&gt;&lt;br&gt;There are a couple of ways to algorithmically generate signals without relying on data or using forward referencing, but these are not available in the simple charting applications like MS.&amp;nbsp; As MS doesn’t know what the time is, it only knows the time of the last incoming tick, it cannot be programmed to trigger a time based event in real-life.&amp;nbsp; The simplest solution is to use another application to signal or execute the trade at a specific time (or mechanical device, such as an alarm clock!)&amp;nbsp; These trades will cause new ticks to be generated to which MS can respond.&amp;nbsp; In some other applications it is possible to read the computer system clock or data server clock to generate time-based signals, or enter loops to read the time whilst waiting for the next data tick to arrive; as I said these are not options for MS.&lt;br&gt;&lt;br&gt;&lt;b&gt;System Testing&lt;/b&gt;&lt;br&gt;&lt;br&gt;If the trader has method that will actually allow them to trade at/near the last bar of the day, how do they test their ideas in the EST?&lt;br&gt;&lt;br&gt;This is one of the few times when forward referencing is allowed: the EST code can look at the datetime of the next bar in the data series and determine whether it is on the same day or the next day.&amp;nbsp; If the datetime is in the next trading period, this means the current bar is the last bar of the period and the appropriate signal can be generated.&amp;nbsp; There is one small hiccup with this approach; on the last bar of the data series, there is no future bar for the Ref() function to do its comparison with so it retuerns N/A, and no trades would ever be signalled on the last charted bar.&amp;nbsp; To avoid this N/A bar, the forum.dll can be utilized in conjunction with Ref() to return a value and this is OR’d with the LastValue(Cum(1)) to detect the last charted bar.&amp;nbsp; Of course, the CLOSE price at which the EST will take the trade is only going to be representative of what trade could have taken place, but close enough might be good enough in this instance?&lt;br&gt;&lt;br&gt;Note: although we have discussed the trader looking to exit at the close of a day, the same problems apply with any intraday time.&amp;nbsp; E.g. foreign exchange (FX) traders often want to exit their positions, say, 5 minutes before a news event but if no ticks are arriving in the time window then no signal can be generated, etc.&lt;br&gt;&lt;br&gt;&lt;b&gt;Summary&lt;/b&gt;&lt;br&gt;&lt;br&gt;Like with a lot of trading systems, computers and software, it is possible to code impossible scenarios and show their success in back-testing.&amp;nbsp; It is vital that during the system development process, traders be mindful of the differences between possibility and reality.&amp;nbsp; A lot has been written about the use of indicators such as Peak() , Trough(), Zig(), LastValue() and redrawing trendlines etc, we know to avoid these because they are not tradable in real-life; the same has to be said about time-based systems and systems reliant on trading at/near the close of a trading day.&lt;br&gt;&lt;br&gt;&amp;nbsp;&lt;br&gt;&lt;br&gt;Hope this helps.&lt;br&gt;&lt;br&gt;&amp;nbsp;&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>problem in getting Daily data when using Minutes data.....</title><link>http://forum.equis.com/forums/thread/29185.aspx</link><pubDate>Sun, 15 Mar 2009 11:39:48 GMT</pubDate><guid isPermaLink="false">2fa994ca-da92-4cc0-8578-1c713492f1d7:29185</guid><dc:creator>metaken</dc:creator><slash:comments>1</slash:comments><comments>http://forum.equis.com/forums/thread/29185.aspx</comments><wfw:commentRss>http://forum.equis.com/forums/commentrss.aspx?SectionID=3027&amp;PostID=29185</wfw:commentRss><description>when I use the minutes data and wanna get the daily value from other security, I use the following script:&lt;br&gt;&lt;br&gt;&lt;font color="#ff1493"&gt;Ddata := (Security("C:\MetaStock Data\data\xxxx",Ref(C,-1)));&lt;br&gt;if (H&amp;lt;Ddata,1,0)&lt;/font&gt; &amp;lt;----this H is for Minutes bar..~&lt;br&gt;&lt;br&gt;it prompt me a error like that: &lt;br&gt;&lt;br&gt;&lt;i&gt;"Error
retrieving data for Security() function.&amp;nbsp; No security with a compatible
periodicity found in folder Path C:\MetaStock Data\data\xxxx&lt;/i&gt;"&lt;br&gt;&lt;br&gt;I use MetaStock Pro in fact....&lt;br&gt;&lt;br&gt;how can I fix this??......&lt;br&gt;&lt;br&gt;Many thx!!!!</description></item><item><title>Last price in the time series</title><link>http://forum.equis.com/forums/thread/28993.aspx</link><pubDate>Mon, 23 Feb 2009 01:46:55 GMT</pubDate><guid isPermaLink="false">2fa994ca-da92-4cc0-8578-1c713492f1d7:28993</guid><dc:creator>knorthington</dc:creator><slash:comments>1</slash:comments><comments>http://forum.equis.com/forums/thread/28993.aspx</comments><wfw:commentRss>http://forum.equis.com/forums/commentrss.aspx?SectionID=3027&amp;PostID=28993</wfw:commentRss><description>&lt;P&gt;Does anyone know how function code can determine if the current value is the last (most current) value in the chart, or data record?&lt;/P&gt;
&lt;P&gt;MSW&lt;/P&gt;</description></item><item><title>coding a system: write data to external file but outside of Buy/Sell/Short/Cover</title><link>http://forum.equis.com/forums/thread/26942.aspx</link><pubDate>Sun, 13 Apr 2008 19:43:30 GMT</pubDate><guid isPermaLink="false">2fa994ca-da92-4cc0-8578-1c713492f1d7:26942</guid><dc:creator>appress</dc:creator><slash:comments>3</slash:comments><comments>http://forum.equis.com/forums/thread/26942.aspx</comments><wfw:commentRss>http://forum.equis.com/forums/commentrss.aspx?SectionID=3027&amp;PostID=26942</wfw:commentRss><description>&lt;P&gt;Hi, I'm trying to analyse system results in XL and as such need to output these results to XL from Metastock 9.0&lt;/P&gt;
&lt;P&gt;But in the system window I can only see areas to write code for Buy, Sell, Sell Short, Buy to Cover. Is there a coding space to write generic code which is not triggered by these four events? (eg. write to file the following header info "Days profitable", "Profit %" etc. )&lt;/P&gt;
&lt;P&gt;I'm trying to follow the book by Stridsman which seems to have some very valid ideas, however all the examples are in Tradestation Easylanguage. I'm certainly happy with MS though, perhaps someone can recommend a book which uses MS as its principal source of code ideas and examples?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Cheers!&lt;/P&gt;
&lt;P&gt;Phil&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description></item><item><title>Make Horizontal Lines Dissappear if Far From Price</title><link>http://forum.equis.com/forums/thread/28977.aspx</link><pubDate>Sat, 21 Feb 2009 00:52:42 GMT</pubDate><guid isPermaLink="false">2fa994ca-da92-4cc0-8578-1c713492f1d7:28977</guid><dc:creator>pspr</dc:creator><slash:comments>1</slash:comments><comments>http://forum.equis.com/forums/thread/28977.aspx</comments><wfw:commentRss>http://forum.equis.com/forums/commentrss.aspx?SectionID=3027&amp;PostID=28977</wfw:commentRss><description>Hi,&lt;br /&gt;&lt;br /&gt;I've been trying to work with one of those pivot line formulas trying to make the pivot lines on intraday charts dissappear after they are say 10 points from the current bar close.&lt;br /&gt;&lt;br /&gt;I know about using the "if" funcrtion to move the line to like 10 below the close if they are lower (or higher) by more than 10.  This works but it leaves lines going all over the place.&lt;br /&gt;&lt;br /&gt;I would prefer to just have the line go blank on the chart so the Y axis can adjust without considering the line.  Sort of like allowing the pivot lines to scroll off the top or bottom of the chart if they are not near the price.&lt;br /&gt;&lt;br /&gt;Is there any way to do this in Metastock 10?&lt;br /&gt;&lt;br /&gt;Thanks for your help</description></item><item><title>BarsSince, ValueWhen and Custom Formula call in an Expert.</title><link>http://forum.equis.com/forums/thread/28909.aspx</link><pubDate>Sat, 14 Feb 2009 22:04:34 GMT</pubDate><guid isPermaLink="false">2fa994ca-da92-4cc0-8578-1c713492f1d7:28909</guid><dc:creator>marketwatch</dc:creator><slash:comments>2</slash:comments><comments>http://forum.equis.com/forums/thread/28909.aspx</comments><wfw:commentRss>http://forum.equis.com/forums/commentrss.aspx?SectionID=3027&amp;PostID=28909</wfw:commentRss><description>Good day all,&lt;br&gt;&lt;br&gt;I have an issue with the above functions working together.&amp;nbsp; I have a custom formula that determines if a trend exists or not. If not the formula equals 5. I can accurately determine how long the market has been flat (e.g 9 days) using BarsSince() but when I try to ascertain the closing price when no trend existed, using ValueWhen, it fails to give the correct value.&amp;nbsp; And if I 'page' back in time in the Expert, the length of time the market was flat decreases accordingly but the closing price changes each time. Perhaps I have gone 'code' blind and someone can easily see the errors of my ways. If so let me know. Or perhas there is a better way to achieve my goals.&lt;br&gt;&lt;br&gt;In the Expert I have;&lt;br&gt;&lt;br&gt;writeif( Fml( "MT-Trend") = 5, "&amp;lt;Name&amp;gt; is not trending over the medium term it is flat. It has been flat for the past writeval( BarsSince( Fml( "MT-Trend") &amp;lt;&amp;gt; 5 ),0.0) day(s). The closing price at that time was writeval(valuewhen(1, BarsSince( Fml( "MT-Trend") &amp;lt;&amp;gt; 5 ),c),3.4)", ")&lt;br&gt;&lt;br&gt;Thank you in advance.&lt;br&gt;&lt;br&gt;Steve &lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;</description></item><item><title>Problem with barssince() and valuewhen()</title><link>http://forum.equis.com/forums/thread/28889.aspx</link><pubDate>Fri, 13 Feb 2009 09:46:39 GMT</pubDate><guid isPermaLink="false">2fa994ca-da92-4cc0-8578-1c713492f1d7:28889</guid><dc:creator>FoxerFX</dc:creator><slash:comments>2</slash:comments><comments>http://forum.equis.com/forums/thread/28889.aspx</comments><wfw:commentRss>http://forum.equis.com/forums/commentrss.aspx?SectionID=3027&amp;PostID=28889</wfw:commentRss><description>&lt;P&gt;Guys, please help to solve the following problem:&lt;/P&gt;
&lt;P&gt;if today for example mov(close,10,S)&amp;gt;mov(close,15,S) then &lt;/P&gt;
&lt;P&gt;barssince(mov(close,10,S)&amp;gt;mov(close,15,S)) will return 0 as distance in bars to last occurence of such event when it was true, but how can I get distance in bars to previous occurence of the event mov(close,10,S)&amp;gt;mov(close,15,S) before today?&lt;/P&gt;
&lt;P&gt;Thanks&lt;/P&gt;</description></item><item><title>Algorithm problem.</title><link>http://forum.equis.com/forums/thread/28881.aspx</link><pubDate>Thu, 12 Feb 2009 17:54:16 GMT</pubDate><guid isPermaLink="false">2fa994ca-da92-4cc0-8578-1c713492f1d7:28881</guid><dc:creator>barcode</dc:creator><slash:comments>2</slash:comments><comments>http://forum.equis.com/forums/thread/28881.aspx</comments><wfw:commentRss>http://forum.equis.com/forums/commentrss.aspx?SectionID=3027&amp;PostID=28881</wfw:commentRss><description>Hello,&lt;br&gt;&lt;br&gt;I am new to MS programming so I want to make something clear. &lt;br&gt;I want to create to Expert Advisor some symbol signals.&lt;br&gt;The problem is that I want to compare two different prices that verifiy the same condition.&lt;br&gt;For example.. a:=if (condition,c,false)&lt;br&gt;but when I want to compare A with B MS&amp;nbsp; replaces the variable with the new price and forgets the old one. Is there any way to use arrays for my variable or maybe do you have any ideas to make this work? (sorry for my bad english)&lt;br&gt;&lt;a href="http://imageshack.us" target="_blank" title="http://imageshack.us"&gt;&lt;img src="http://img165.imageshack.us/img165/2162/96997681qf8.jpg" border="0" /&gt;&lt;/a&gt;&lt;br&gt;&lt;br&gt;</description></item><item><title>Non-PREV B And Q Indicators                                 </title><link>http://forum.equis.com/forums/thread/13630.aspx</link><pubDate>Fri, 06 Jan 2006 14:28:32 GMT</pubDate><guid isPermaLink="false">2fa994ca-da92-4cc0-8578-1c713492f1d7:13630</guid><dc:creator>mstt</dc:creator><slash:comments>15</slash:comments><comments>http://forum.equis.com/forums/thread/13630.aspx</comments><wfw:commentRss>http://forum.equis.com/forums/commentrss.aspx?SectionID=3027&amp;PostID=13630</wfw:commentRss><description>The following Q Indicator has been sourced from the Equis website but with one small adjustment (see point 2 below). This code and the original B Indicator provide the model on which the revised indicators have been based. There are several points about the basic Q Indicator that are worthy of note, and these are listed and commented on below.&lt;br /&gt;&lt;br /&gt;{Q-indicator}&lt;br /&gt;m:=Input("% Scalar trend period",1,25,4);&lt;br /&gt;n:=Input("% Scalar noise period",1,500,250);&lt;br /&gt;cf:=Input("% Scalar correction factor",1,250,2);&lt;br /&gt;p1:=Input("First moving average periods",1,200,7);&lt;br /&gt;p2:=Input("Second moving average periods",1,200,15);&lt;br /&gt;rev:=Mov(C,p1,E)-Mov(C,p2,E);&lt;br /&gt;pds:=If(rev&amp;gt;0,1,-1);&lt;br /&gt;dc:=ROC(C,1,$);&lt;br /&gt;cpc:=If(pds&amp;lt;&amp;gt;Ref(pds,-1),0,(dc {*pds} )+PREV);&lt;br /&gt;trend:=If(pds&amp;lt;&amp;gt;Ref(pds,-1),0,(cpc*(1/m))+(PREV*(1-(1/m))));&lt;br /&gt;dt:=cpc-trend;&lt;br /&gt;noise:=cf*Sqrt(Mov(dt*dt,n,S));&lt;br /&gt;trend/noise;&lt;br /&gt;&lt;br /&gt;1.	The default "n" setting is 250 periods.&lt;br /&gt;2.	The "cpc" variable has had the "*pds" expression commented out.&lt;br /&gt;3.	The "cpc" variable contains a PREV function.&lt;br /&gt;4.	The "trend" variable also contains a PREV function.&lt;br /&gt;&lt;br /&gt;There are several implications arising from these points. The first is that this indicator will not plot any value with the current default settings unless 265 or more data bars are loaded. This requires more than 1 year of EOD data or 5 years of weekly data – a fact that makes it less than useful with many securities.&lt;br /&gt;&lt;br /&gt;For item 2 it can easily be demonstrated that Q fails to plot most trending-down values as negative unless the "pds" multiplier in the "cpc" variable is commented out or removed completely.&lt;br /&gt;&lt;br /&gt;The PREV functions noted in items 3 and 4 can (and do) seriously affect execution speed, particularly when exploring or testing large amounts of historical data. The "cpc" variable is simply a counter that can be replaced by code not requiring the PREV function. The "trend" variable is essentially a re-settable exponential moving average, and this can be replaced by an EMA generated by the Forum DLL.&lt;br /&gt;&lt;br /&gt;A modifier for the "trend" variable  has been added to the non-PREV (NP) versions of B and Q, and its purpose is simply to ensure an exact match between PREV and non-PREV versions when plotted on the same data. With the same user settings.&lt;br /&gt;&lt;br /&gt;An "n" variable modifier has also been added, though currently disabled, and its purpose is to reduce the "n" parameter in the "noise" variable when otherwise insufficient data is loaded. This allows the indicator to return a legitimate value rather than an N/A value for many securities having less than the optimum amount of data. Results generated using a lesser amount of data might be less accurate than desirable, but a valid plot is probably of more use than an invalid one. I suggest that the default for the "n" variable be reduced to 100 for weekly data, whether or not the modifier is enabled.&lt;br /&gt;&lt;br /&gt;The Forum DLL exponential moving average permits an EMA to be reset or reseeded at appropriate times whereas the standard MetaStock Mov() function does not permit such an action.&lt;br /&gt;&lt;br /&gt;Note that some versions of the B and Q indicators in circulation use an exponential moving average in the "noise" variable, while other use a simple moving average. Check this if you have difficulty matching your B and Q indicators values to agree with the following formulas.&lt;br /&gt;&lt;br /&gt;{B Indicator NP} {Trend-Noise Balance}&lt;br /&gt;m:=Input("% Scalar trend period",2,25,4);&lt;br /&gt;n:=Input("% Scalar noise period",2,500,250);&lt;br /&gt;cf:=Input("% Scalar correction factor",1,250,2);&lt;br /&gt;p1:=Input("First moving average periods",1,200,7);&lt;br /&gt;p2:=Input("Second moving average periods",1,200,15);&lt;br /&gt;pds:=Mov(C,p1,E)&amp;gt;Mov(C,p2,E);&lt;br /&gt;pds:=pds&amp;lt;&amp;gt;ValueWhen(2,1,pds);&lt;br /&gt;dc:=ROC(C,1,$);&lt;br /&gt;init:=Cum(pds&amp;gt;-1)=1;&lt;br /&gt;cdc:=Cum(dc);&lt;br /&gt;cpc:=cdc-ValueWhen(1,init+pds,cdc);&lt;br /&gt;trend:=ExtFml("Forum.MOV",cpc,If(pds,1,2*m-1),E);&lt;br /&gt;trend:=If(Sum(trend,2)=Sum(trend,2),trend,trend); {adds an invalid bar}&lt;br /&gt;dt:=cpc-trend;&lt;br /&gt;{n:=LastValue(Min(Cum(1)-2*p2,n));} {adjusts "n" if not enough bars are loaded}&lt;br /&gt;noise:=Sqrt(Mov(dt*dt,n,S));&lt;br /&gt;noise:=If(Abs(trend)+Abs(noise)=0,1,Abs(trend)+Abs(noise));&lt;br /&gt;100*Abs(trend)/noise;&lt;br /&gt;&lt;br /&gt;{Q Indicator NP} {Trend Quality}&lt;br /&gt;m:=Input("% Scalar trend period",2,25,4);&lt;br /&gt;n:=Input("% Scalar noise period",2,500,250);&lt;br /&gt;cf:=Input("% Scalar correction factor",1,250,2);&lt;br /&gt;p1:=Input("First moving average periods",1,200,7);&lt;br /&gt;p2:=Input("Second moving average periods",1,200,15);&lt;br /&gt;pds:=Mov(C,p1,E)&amp;gt;Mov(C,p2,E);&lt;br /&gt;pds:=pds&amp;lt;&amp;gt;ValueWhen(2,1,pds);&lt;br /&gt;dc:=ROC(C,1,$);&lt;br /&gt;init:=Cum(pds&amp;gt;-1)=1;&lt;br /&gt;cdc:=Cum(dc);&lt;br /&gt;cpc:=cdc-ValueWhen(1,init+pds,cdc);&lt;br /&gt;trend:=ExtFml("Forum.MOV",cpc,If(pds,1,2*m-1),E);&lt;br /&gt;trend:=If(Sum(trend,2)=Sum(trend,2),trend,trend); {adds an invalid bar}&lt;br /&gt;dt:=cpc-trend;&lt;br /&gt;{n:=LastValue(Min(Cum(1)-2*p2,n));} {adjusts "n" if not enough bars are loaded}&lt;br /&gt;noise:=cf*Sqrt(Mov(dt*dt,n,S));&lt;br /&gt;trend/noise;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Roy&lt;br /&gt;&lt;a href="http://www.metastocktips.co.nz" target="_blank" title="http://www.metastocktips.co.nz"&gt;&lt;i&gt;&lt;b&gt;MetaStock Tips &amp;amp; Tools&lt;/b&gt;&lt;/i&gt;&lt;/a&gt;</description></item><item><title>Enhanced System Tester - Executing Orders At A Specific Price</title><link>http://forum.equis.com/forums/thread/24850.aspx</link><pubDate>Sat, 28 Jul 2007 19:48:09 GMT</pubDate><guid isPermaLink="false">2fa994ca-da92-4cc0-8578-1c713492f1d7:24850</guid><dc:creator>ironcondor</dc:creator><slash:comments>5</slash:comments><comments>http://forum.equis.com/forums/thread/24850.aspx</comments><wfw:commentRss>http://forum.equis.com/forums/commentrss.aspx?SectionID=3027&amp;PostID=24850</wfw:commentRss><description>Is it possible to execute buy/sell/short/cover trades in the system tester using a &lt;u&gt;specific&lt;/u&gt; (exact) price entry?&amp;nbsp; I am trying to execute trades on the same (weekly) bar as a generated signal, but I cannot get the system tester to use anything other than the O/H/L/C on the signal bar.&amp;nbsp; Thanks!&lt;br&gt;</description></item><item><title>formulas using mutli-underlying stocks</title><link>http://forum.equis.com/forums/thread/28758.aspx</link><pubDate>Mon, 02 Feb 2009 05:22:10 GMT</pubDate><guid isPermaLink="false">2fa994ca-da92-4cc0-8578-1c713492f1d7:28758</guid><dc:creator>squark62</dc:creator><slash:comments>6</slash:comments><comments>http://forum.equis.com/forums/thread/28758.aspx</comments><wfw:commentRss>http://forum.equis.com/forums/commentrss.aspx?SectionID=3027&amp;PostID=28758</wfw:commentRss><description>hi all,&lt;br&gt;&lt;br&gt;this is not so much a how to question but a capability question.&amp;nbsp; i want to know if metastock's programming syntax allows manipulation of data from two different stocks symbols at once.&amp;nbsp; i have an arbitrage algorithm in a spreadsheet i'd like to try to replicate and automate in metastock.&amp;nbsp; the computation in the spreadsheet compares data from two or more symbols and then graphs the results.&amp;nbsp; any useful insight?&lt;br&gt;&lt;br&gt;thanks,&lt;br&gt;mike james&lt;br&gt;</description></item><item><title>Pristine variation code</title><link>http://forum.equis.com/forums/thread/28740.aspx</link><pubDate>Wed, 28 Jan 2009 18:27:11 GMT</pubDate><guid isPermaLink="false">2fa994ca-da92-4cc0-8578-1c713492f1d7:28740</guid><dc:creator>zigzag</dc:creator><slash:comments>2</slash:comments><comments>http://forum.equis.com/forums/thread/28740.aspx</comments><wfw:commentRss>http://forum.equis.com/forums/commentrss.aspx?SectionID=3027&amp;PostID=28740</wfw:commentRss><description>&lt;P&gt;hello&lt;/P&gt;
&lt;P&gt;would anybody have handy the MS code for the system Pristine Variation discussed in May 2002's issue of Active Trader magazine?&amp;nbsp; I have tried to code it but am not confident that i've done it right...&amp;nbsp; should be an easy/quick task for the top programmers in EIOC...&lt;/P&gt;
&lt;P&gt;below, the logic of the system (my interpretation of the article).&amp;nbsp; The accompanying&amp;nbsp;Easylanguage code is in the magazine's website under the name "Pristine&amp;nbsp;Variation" in&amp;nbsp;&lt;A href="http://www2.wealth-lab.com/activetrader/ActiveTrader.htm"&gt;http://www2.wealth-lab.com/activetrader/ActiveTrader.htm&lt;/A&gt;&amp;nbsp;(for some reason, I can't get to that site today, otherwise I would have pasted it here...).&lt;/P&gt;
&lt;P&gt;the results stats for this system as&amp;nbsp;published in the article are almost too good to be true...&lt;/P&gt;
&lt;P&gt;LOGIC&lt;/P&gt;
&lt;P&gt;&lt;U&gt;LE&lt;/U&gt;&lt;/P&gt;
&lt;P&gt;setup: three consecutive lower highs and three consecutive closes lower than the opens&lt;/P&gt;
&lt;P&gt;1. go long at&amp;nbsp;bar immediately after setup with stop at previous bar's high + 0.01&lt;/P&gt;
&lt;P&gt;&lt;U&gt;LX&lt;/U&gt;&lt;/P&gt;
&lt;P&gt;1. Trailing stop: sell at current bar IF price crosses below previous bar's low with stop at previous bar's low - 0.01&lt;/P&gt;
&lt;P&gt;2. Reversal stop: sell at&amp;nbsp;current bar's close&amp;nbsp;IF current bar's high is higher than previous bar's high but current bar's close is lower than previous bar's close&lt;/P&gt;
&lt;P&gt;3. Profit-taking: sell at next bar IF next bar's open crosses above&amp;nbsp;current bar's high with stop at next bar's open - 0.01&lt;/P&gt;
&lt;P&gt;Other:&lt;/P&gt;
&lt;P&gt;1. dynamic position sizing: available equity * percent of equity&amp;nbsp;at risk per trade&amp;nbsp;(5%) / (4*ATR(10))&lt;/P&gt;
&lt;P&gt;2. no margining (ie, trade from a cash account)&lt;/P&gt;
&lt;P&gt;Best&lt;/P&gt;
&lt;P&gt;ZigZag&lt;/P&gt;</description></item></channel></rss>