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

RE: [Metastockusers] Drawing horizontal line from a previous day to today



PureBytes Links

Trading Reference Links









If I want to convert my “Daily Pivots on Intraday Chart” to
only plot the last two days, would the following be the correct adaptation to
your code?

 

<span
>Dm:=If(Hour()<=Ref(Hour(),-1),1,0);

<span
>PP3:=If(Dm=1,(Ref(HighestSince(1,Dm=1,H),-1)+

<span
>Ref(LowestSince(1,Dm=1,L),-1)
+

<span
>Ref(C,-1))/3,0);

<span
>Mh1:=If(Dm=1,Ref(HighestSince(1,Dm=1,H),-1),0);

<span
>Ml1:=If(Dm=1,Ref(LowestSince(1,Dm=1,L),-1),0);

<span
>Mh:=ValueWhen(1,Mh1>0,Mh1);

<span
>Ml:=ValueWhen(1,Ml1>0,Ml1);

<span
>PPM:=ValueWhen(1,PP3>0,PP3);

<span
>R1:=(2*PPM)-Ml;

<span
>S1:=(2*PPM)-Mh;

<span
>S3:=ppm-(Mh-Ml);

<span
>S2:=S1-(R1-S1);

<span
>R2:=R1+(R1-S1);

<span
>R3:=ppm+(Mh-Ml);

<span
>evm:=(mh-PPm)+ml;

 

Condition:=<span
>r2;r3;r1;ppm;s1;s3;s2;<font
size=2 face="Courier New"> {signal true for
several bars}<span
>
Condition:=Condition AND Alert(Condition=0,2);
{converted to one bar signal}
Trigger:=LastValue(Cum(Condition)-1)>=Cum(Condition);
ValueWhen(1,Trigger,"support value");



 

<span
>-----Original Message-----
From: Roy Larsen
[mailto:rlarsen@xxxxxxxxxxxxxx] 
Sent: Tuesday,
 January 27, 2004 <span
 >11:19 PM<font
size=2 face=Tahoma>
To: Metastockusers@xxxxxxxxxxxxxxx
Subject: Re: [Metastockusers]
Drawing horizontal line from a previous day to today

<span
> 

<span
>Alex<span
>

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<font
size=2 face="Courier New">

----- Original Message ----- 
From: "alui_98"
<alui_98@xxxxxxxxx>
To: <Metastockusers@xxxxxxxxxxxxxxx>
Sent: <font
 size=2 face="Courier New">Wednesday, January
 28, 2004<span
> <span
 >4:18 PM<font size=2
face="Courier New">
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:
>  <a
href="">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:
>  <a
href="">http://docs.yahoo.com/info/terms/
>
>
>
>








<font
size=2 face="Courier New">





<font size=2
face="Courier New">Yahoo!
Groups Links

<font size=2
face=Symbol>·<font
size=1 face="Times New Roman">        
<span
>To visit your group on the
web, go to:
http://groups.yahoo.com/group/Metastockusers/
  

<font size=2
face=Symbol>·<font
size=1 face="Times New Roman">        
<span
>To unsubscribe from this
group, send an email to:
Metastockusers-unsubscribe@xxxxxxxxxxxxxxx
  

<font size=2
face=Symbol>·<font
size=1 face="Times New Roman">        
<span
>Your use of Yahoo! Groups is
subject to the Yahoo! Terms of
Service. 









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.