[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [EquisMetaStock Group] Looping Statement



PureBytes Links

Trading Reference Links

Hi Daniel


As Jimmy has said, Alert() can be used to extend the number of bars that a signal is reported TRUE. For example, Alert(Cross(Mov(C,10,S),Mov(C,20,S)),10) would return a TRUE result for ten bars instead of one (nine additional bars). There's a problem with Alert() in that it is not reliable when used in an exploration with the Explorer set to Minimum Records.

You should be aware that exponential moving averages (that includes Wilders Smoothing), or any function using an EMA internally (such as RSI() and ADX()), will also return inaccurate results when using Minimum Records. In such cases the Explorer should be set to at least 5 times the longest EMA Periods parameter. Apart from EMAs and EMA-based functions, functions with a Periods parameter (as distinct from an Nth parameter) generally force the Explorer to load sufficient minimum bars for the task plus some more for headroom. Specifying a set number of bars to be loaded will override any minimum number that the Explorer calculates as necessary.

A variety of other functions also tend to fail when using a Minimum Records setting. Examples of these are ValueWhen(), HighestSince(), BarsSince(). In fact any function using an Nth parameter can be affected so it's wise to specify loading of an adequate number of bars for almost every exploration.

The example you gave doesn't require any form of looping - an Alert() will work fine as long as sufficient bars are loaded. Another method for achieving the same result is to use the Sum() function. There are sure to be other approaches that would also work.

Signal:=Cross(Mov(C,10,S),Mov(C,20,S))
Sum(Signal,10)>0;

Any TRUE result from Signal over the last 10 bars will generate a column or filter TRUE.

Hope this helps


Regards

Roy
www.metastocktips.co.nz



  ----- Original Message ----- 
  From: Daniel Teo 
  To: equismetastock@xxxxxxxxxxxxxxx 
  Sent: Wednesday, September 12, 2007 6:34 PM
  Subject: RE: [EquisMetaStock Group] Looping Statement


  This is what i want to do,
  I want to check for a Cross during an exploration over the past 10 days.
  and show it in the report.

  So i actually have to use Ref(Cross(Mov,Mov),-1) and specify this up to
  Ref(Cross(Mov,Mov),-10) and check each one individually ?

  _____ 

  From: equismetastock@xxxxxxxxxxxxxxx [mailto:equismetastock@xxxxxxxxxxxxxxx]
  On Behalf Of Ed Hoopes
  Sent: Wednesday, September 12, 2007 10:10 AM
  To: equismetastock@xxxxxxxxxxxxxxx
  Subject: Re: [EquisMetaStock Group] Looping Statement

  In fact there is only one flow control statement in MS - the IF
  statement. And it is not even a block IF - as in 

  if(condition)
  {
  condition true block
  }
  else
  {
  condition false block
  } 

  --- In equismetastock@ <mailto:equismetastock%40yahoogroups.com>
  yahoogroups.com, "Lionel Issen" <lissen@xxx> wrote:
  >
  > NO!
  > 
  > 
  > 
  > From: equismetastock@ <mailto:equismetastock%40yahoogroups.com>
  yahoogroups.com
  [mailto:equismetastock@ <mailto:equismetastock%40yahoogroups.com>
  yahoogroups.com]
  > On Behalf Of Daniel Teo
  > Sent: Tuesday, September 11, 2007 6:00 PM
  > To: equismetastock@ <mailto:equismetastock%40yahoogroups.com>
  yahoogroups.com
  > Subject: [EquisMetaStock Group] Looping Statement
  > 
  > 
  > 
  > Is there a looping function like FOR Loop or While Loop in metastock
  ? or
  > similar ?
  > 
  > [Non-text portions of this message have been removed]
  > 
  > 
  > 
  > 
  > 
  > [Non-text portions of this message have been removed]
  >

  [Non-text portions of this message have been removed]



   

  __________ NOD32 2525 (20070912) Information __________

  This message was checked by NOD32 antivirus system.
  http://www.eset.com


[Non-text portions of this message have been removed]



 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/equismetastock/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/equismetastock/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto:equismetastock-digest@xxxxxxxxxxxxxxx 
    mailto:equismetastock-fullfeatured@xxxxxxxxxxxxxxx

<*> To unsubscribe from this group, send an email to:
    equismetastock-unsubscribe@xxxxxxxxxxxxxxx

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/