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

Re: [EquisMetaStock Group] Bars Ago function?



PureBytes Links

Trading Reference Links

Paul

The solution below is only good for one value of "vp".

Using LastValue(vp+PREV-PREV) as the periods value in the last unnamed line (the plot output line)
works in some cases. Unfortunately the two PREV's cause  high processing overheads and there are
also other potential problems so I'm reluctant to suggest it as a universal way of converting a
variable into a "constant" that can be used as "periods".

Naming the variable with LastValue() and two PREV's usually results in only the last bar even
plotting, and that can be something of a problem.

Roy

----- Original Message ----- 
From: "Paul Chivers" <pchivers@xxxxxxxxxxxx>
To: <equismetastock@xxxxxxxxxxxxxxx>
Sent: Monday, March 29, 2004 1:08 PM
Subject: Re: [EquisMetaStock Group] Bars Ago function?


> I believe one of Roy's "tricks" to get around not being able to pass
> variables to various MS functions is to wrap the variable part in the
> LastValue() function.
>
> e.g.
> { 'vp' cannot normally be used with 'Ref' }
> parm:=Input("Parm",1,200,20);
> vp:= Mov(C,parm,E);
> pl:=Ref(C,-LastValue(vp));    { don't forget the '-' sign }
> pl;
>
>
> HTH
>
> Paul
>
> ----- Original Message ----- 
> From: "mazachan" <no_reply@xxxxxxxxxxxxxxx>
> To: <equismetastock@xxxxxxxxxxxxxxx>
> Sent: Sunday, 28 March 2004 10:55 PM
> Subject: Re: [EquisMetaStock Group] Bars Ago function?
>
>
> In a sense, yes.  Something like the Reference function.  However, I
> can't pass in a variable for the periods, and that is my problem.  I
> need something that can take a variable.
>
> --- In equismetastock@xxxxxxxxxxxxxxx, "Jay T" <JaysTownsend@xxxx> wrote:
> > I think you are looking for the Ref function.  Look it up and see if
> it does what you want.
> >
> > Jay
> >
> >
> > <<Hi all, is there a built in function within metastock to determine
> > what an indicator's value is for so many bars ago?  For example, say
> > that I have calculated a price for x bars ago and I want to find out
> > what the moving average is for that particular bar.  Or do I have to
> > create my own formula for this?
> >
> >
> > Thanks>>
>
>
>
>
>
>
> Yahoo! Groups Links
>
>
>
>
>
>
>
>
>
>
> Yahoo! Groups Links
>
>
>
>
>
>
>




 
Yahoo! Groups Links

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

<*> 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/