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

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



PureBytes Links

Trading Reference Links

Thks again, Dusant, for your responsiveness and willing to help. I do 
not want to use Peak() or Trough(), and I know, given 2 data points, 
how to code to plot a line connecting the 2. The ONLY (and real) 
problem is, as I have explained in my previous note, how to access 
the values for those 2 data points, as they are ahead of the actual 
bar...
Heitor  
--- In Metastockusers@xxxxxxxxxxxxxxx, "Dusant" <dusant@xxxx> wrote:
> 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.
> Dusant
> Chief Architect
> http://www.candlestrength.com/
> 
> >    Date: Fri, 13 Feb 2004 11:09:20 -0000
> >    From: "heitor1975" <heitor1975@xxxx>
> > 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 Metastockusers@xxxxxxxxxxxxxxx, "Dusant" <dusant@xxxx> 
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
> > > http://www.candlestrength.com/
> > >   ----- Original Message ----- 
> > >   From: heitor1975 
> > >   To: 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
> > 
> > 
> > 
> >  
> > ------------------------------------------------------------------
------
> > 
> > 
> >



 
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:
     http://docs.yahoo.com/info/terms/