PureBytes Links
Trading Reference Links
|
Roy,
Thanks very much for your help. As with numerous times before,
you've come and saved the day. Your ValueWhen() suggestion works
like a charm. I did use the following earlier:
SUPPORT:=If(cond and cond=LastValue(cum(cond)), CLOSE, PREV);
However, the above still had the horizontal line at zero due to the
PREV initialization. Your ValueWhen() method eliminated that problem.
Thanks again,
-Alex
--- In Metastockusers@xxxxxxxxxxxxxxx, "Roy Larsen" <rlarsen@xxxx>
wrote:
> Alex
>
> Yes there is a way to do this. By using the ValueWhen() function
you can manipulate the full signal
> plot so that only that portion of the plot from the most recent
event will display. You may find,
> however that it is more useful to start the plot at the second most
recent event so that you are
> never left with a single bar plot (most recent event occurred on
the last bar). When this happens
> the plot can be very difficult to see because it is only a small
spot.
>
> You can achieve a "trigger" for ValueWhen() by first counting every
event. For easiest use it would
> probably be helpful if "the event" is restricted to one bar only.
By counting these events using
> Cum("event") and comparing that against LastValue(Cum("event")) you
can create a signal for the
> "condition" portion of ValueWhen(). Your code might look something
like this.
>
> Condition:="your multiple bar signal"; {signal true for several
bars}
> Condition:=Condition AND Alert(Condition=0,2); {converted to one
bar signal}
> Trigger:=LastValue(Cum(Condition)-1)>=Cum(Condition);
> ValueWhen(1,Trigger,"support value");
>
> Remove the "-1" from the trigger variable if you really do want to
trigger on the last value. You
> may also need to change ">=" to "=" or "<=".
>
> If you can't make my suggestion work then ask again. I know the
method works but getting the detail
> correct can be a little tricky. Any real world example I give is
going to need to be adapted before
> it will work for you so I have not attempted to provide something
you can simply cut and paste.
> Think through the issues and ask more questions if it's not clear.
>
> Roy
>
> ----- Original Message -----
> From: "alui_98" <alui_98@xxxx>
> To: <Metastockusers@xxxxxxxxxxxxxxx>
> Sent: Wednesday, January 28, 2004 4:18 PM
> Subject: [Metastockusers] Drawing horizontal line from a previous
day to today
>
>
> > Sorry if this question had been asked before. Is there a way to
draw
> > a horizontal line from the most recent bar satisfying a condition
to
> > today only (i.e. without drawing previous bars that satisfy my
> > condition)?
> > For example, I have the following code for drawing a horizontal
> > support line when "cond" is satisfied:
> >
> > SUPPORT:=If(cond, CLOSE, PREV);
> > SUPPORT
> >
> > However, the above draws horizontal supports for all the previous
> > occurrences that "cond" was satisfied. What I end up w/ is a
stair-
> > step like indicator. I want to have only the most recent
horizontal
> > support drawn. How do I do this?
> >
> > Thanks in advance,
> > -Alex
> >
> >
> >
> >
> >
> >
> > 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/
> >
> >
> >
> >
------------------------ Yahoo! Groups Sponsor ---------------------~-->
Buy Ink Cartridges or Refill Kits for your HP, Epson, Canon or Lexmark
Printer at MyInks.com. Free s/h on orders $50 or more to the US & Canada.
http://www.c1tracking.com/l.asp?cid=5511
http://us.click.yahoo.com/mOAaAA/3exGAA/qnsNAA/zMEolB/TM
---------------------------------------------------------------------~->
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/
|