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

Re: [EquisMetaStock Group] Re: Finding and Using the Maximum Value of a Variable



PureBytes Links

Trading Reference Links

Barry

Some more thoughts on how you can manipulate data to the point where you can
use your derived value as if it were a constant.

Many MetaStock functions require a whole number as a parameter, particularly
where this is used for "periods". To achieve this you can use the Int()
function. In Ron's example below would make "cmax" a whole number with -
cmax:=Int(max(c9,c10));

Now, to make this value acceptable for use as a constant you can use the
LastValue() function as follows -
cmax:=Int(max(c9,c10));
cmax:=LastValue(cmax);

Note that this method is useless for the System Tester or any application
where you want to reference historical data without looking forward to the
present. LastValue() is only useful for analysing current data or where a
value is constant for the whole chart. It's a quirky function but can be
very useful.

Roy

----- Original Message -----
From: "Ron" <ronber@xxxxxxxxxxxxx>
To: <equismetastock@xxxxxxxxxxxxxxx>
Sent: Tuesday, April 01, 2003 3:16 AM
Subject: Re: [EquisMetaStock Group] Re: Finding and Using the Maximum Value
of a Variable


> Barry,
>
> I think you can do it by brute force something like:
>
> C1:=max((max(mov(c,10,s),mov(c,11,s)),(max(mov(c,12,s),mov(c,13,s));
> C2:=max((max(mov(c,14,s),mov(c,15,s)),(max(mov(c,16,s),mov(c,17,s));
> C3:=max((max(mov(c,18,s),mov(c,19,s)),(max(mov(c,20,s),mov(c,21,s));
> C4:=max((max(mov(c,22,s),mov(c,23,s)),(max(mov(c,24,s),mov(c,25,s));
> C5:=max((max(mov(c,26,s),mov(c,27,s)),(max(mov(c,28,s),mov(c,29,s));
> C6:=max(c1,c2);
> C7:=max(C3,c4);
> C8:=max(C5,mov(c,30,s));
> c9:=max(c6,c7);
> c10:=max(c8,c9);
> cmax:=max(c9,c10);
>
> I didn't test it, but I think you can get the idea.
>
> Ron
>
>
>
>
>
>
>
>
> pumrysh wrote:
>
> > Barry,
> >
> > Try using the HHV [highest high value]. Since you are planning on
> > using a variable moving average you may experience some difficulty.
> > It can be done though. Post your code and I'm sure some of the great
> > coders on this site will be able to help you.
> >
> > Preston
> >
> > --- In equismetastock@xxxxxxxxxxxxxxx, "Barry Seeger"
> > <barry.seeger@xxxx> wrote:
> > > MetaStock Users,
> > >
> > > Can anyone tell me how to go about finding the maximum value of a
> > > variable when one parameter is allowed to vary, and use the
> > resulting
> > > value of the variable in an indicator formula?  Let's say I want to
> > > discover today's maximum value of the simple moving average of
> > closing
> > > price, where the averaging period can be anything from the last 10
> > to 30
> > > periods. That is, I want to find the maximum value of mov(c,10,s),
> > > mov(c,11,s) etc right through to mov(c,30,s). Then I'll use the
> > > resulting highest moving average value in a formula, and plot the
> > > result.
> > >
> > > Many thanks for your help,
> > > Barry
> >
> >
> > Yahoo! Groups Sponsor
> > ADVERTISEMENT
> >
<http://rd.yahoo.com/M=243066.2784921.4151384.1769302/D=egroupweb/S=17053756
17:HM/A=1377500/R=0/*http://www.verisign.com/cgi-bin/go.cgi?a=b3154011320600
4000>
> >
> >
> >
> > To unsubscribe from this group, send an email to:
> > equismetastock-unsubscribe@xxxxxxxxxxxxxxx
> >
> >
> >
> > Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service
> > <http://docs.yahoo.com/info/terms/>.
>
>
>
>       Yahoo! Groups Sponsor
>             ADVERTISEMENT
>
>
>
>
> To unsubscribe from this group, send an email to:
> equismetastock-unsubscribe@xxxxxxxxxxxxxxx
>
>
>
> Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
>



------------------------ Yahoo! Groups Sponsor ---------------------~-->
Make Money Online Auctions! Make $500.00 or We Will Give You Thirty Dollars for Trying!
http://us.click.yahoo.com/yMx78A/fNtFAA/i5gGAA/BefplB/TM
---------------------------------------------------------------------~->

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/