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

[Metastockusers] Re: Coding a "zigzag" type indicator



PureBytes Links

Trading Reference Links




Heitor
If you just need a Zig Zag indicator, then a 
Peak, Trough condition will identify the actual peaks and troughs.
Using Valuewhen() and Last value(), I think you 
should be able to pinpoint the exact data point.
 
If you want to draw a trendline between two 
points, like a low and a high, then this method will do.
 
aplitude = H - L
time = bars between the two data 
points,
slope = aplitude / time
then keep adding the slope to the previous value, 
will give you a trendline connecting hi to lo.
DusantChief Architect<A 
href="">http://www.candlestrength.com/
>    Date: Fri, 13 Feb 2004 11:09:20 -0000> 
   From: "heitor1975" <<A 
href=""><FONT face=Verdana 
size=2>heitor1975@xxxxxxxxx>> 
Subject: Re: Coding a "zigzag" type indicator> > Dusant,> 
Thks for your response. I already thought of using LastValue (must > 
be...), but not able to come up with a solution so far. I have an > array 
with 0s and, at some points, values of maxs and mins - both > ahead of 
the bars when they really occurred. In a given bar (for > example, a real 
low), how can I refer the first 2 values (even using > LastValue) of the 
above array different from 0 AND ahead of the > actual bar, in order to 
be able to plot a line connecting real low > with real high ? > 
Heitor> --- In <A 
href=""><FONT face=Verdana 
size=2>Metastockusers@xxxxxxxxxxxxxxx, 
"Dusant" <<FONT face=Verdana 
size=2>dusant@x...> wrote:> > 
Heitor,> > You can use the function lastvalue() to load a data array, 
and get > your calculations.> > On the date of the mathematical 
evaluation, you can reference a > future data point using this.> 
> E.g. assuming u have data from 1 Jan 2003 to 31 Dec 2003, you can > 
take a data point on say 30th Jan 2003, and evaluate the formula. > 
However, you cannot reference a data point in future which does not > 
exist (like) 2 Jan 2004.> > Hope this helps.> > 
Dusant> > Chief Architect> > <A 
href=""><FONT face=Verdana 
size=2>http://www.candlestrength.com/<FONT face=Verdana 
size=2>> >   ----- Original Message ----- > 
>   From: heitor1975 > >   To: <A 
href=""><FONT face=Verdana 
size=2>Metastockusers@xxxxxxxxxxxxxxx 
> >   Sent: Thursday, February 12, 2004 10:49 PM> 
>   Subject: [Metastockusers] Coding a "zigzag" type 
indicator> > > > > >   How can I code in 
MS language to plot an indicator as zigzag type > (I > 
>   mean, I have a series of alternate values, max and min, and 
want > to > >   plot a line connecting them) ? I have 
thought a lot and do not > come > >   to a conclusion 
yet (but still trying...). The problem is how to > >   
access in a bar today a value that is only available ahead. Many > thks 
> >   in advance for any ideas which can help.> 
>   Heitor> > > > 
________________________________________________________________________> 
________________________________________________________________________> 
> > > 
------------------------------------------------------------------------> 
Yahoo! Groups Links> > <*> To visit your group on the web, 
go to:>      <A 
href=""><FONT face=Verdana 
size=2>http://groups.yahoo.com/group/Metastockusers/<FONT 
face=Verdana size=2>> > <*> To unsubscribe from this group, send 
an email to:>      <A 
href=""><FONT face=Verdana 
size=2>Metastockusers-unsubscribe@xxxxxxxxxxxxxxx<FONT 
face=Verdana size=2>> > <*> Your use of Yahoo! Groups is subject 
to:>      <A 
href=""><FONT face=Verdana 
size=2>http://docs.yahoo.com/info/terms/<FONT face=Verdana 
size=2>>  > 
------------------------------------------------------------------------> 
> > 







Yahoo! Groups Sponsor


ADVERTISEMENT



Click Here














Yahoo! Groups Links
To visit your group on the web, go to:http://groups.yahoo.com/group/Metastockusers/ 
To unsubscribe from this group, send an email to:Metastockusers-unsubscribe@xxxxxxxxxxxxxxx 
Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.