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

Re: [EquisMetaStock Group] Trace a line



PureBytes Links

Trading Reference Links

--- In equismetastock@xxxxxxxxxxxxxxx, "Roy Larsen" <rlarsen@xxxx> 
wrote:
> Scoubidoo
> 
> > I'd like to trace a line between 2 tops.
> >
> > Those tops are from  "high -20 days before"  to  " high-8 days 
before".
> >
> > I only know a formula to trace a line until yesterday's high. But 
i'd
> > like to stop the line, many days before, yesterday's high.
> >
> > How should I construct the formula ?
> >
> > Regards,
> >
> > Scoubidoo.
> 
> Calculate how many bars from the required point (where the signal 
is to be
> truncated) to the right side of the chart. This value is stored as a
> variable using LastValue() so that it can be used as a constant in 
a Ref()
> function. Then use Ref() to move the line the required number of 
bars to the
> right (negative Ref()), then move it the same number of bars to the 
left
> (positive Ref()).
> 
> Line:=Ref(Ref(Line,-BlankPeriods),BlankPeriods); {blank right side 
of line}
> 
> You can easily blank the left side of a line or signal (SignalA) by 
using
> the ValueWhen() function. First you need to create another signal 
(SignalB)
> that goes true where you want the line or signal to start.
> 
> ValueWhen(1,{binary}SignalB,{value}SignalA)
> 
> There are many variations to this, depending on your need.
> 
> Roy

Roy & Scoub,

Starting playing around with several of the formulas that Roy has 
posted. What I have initially come up with is a horizontal view of 
the high 20 bars ago that is constant for the next 12 bars. Meaning 
that the display extends from 20 bars ago to 8 bars ago and is 
constant. 

Since the original question was for a line from one high to the next 
I am assuming it would be an declining trendline. To do this we 
incorporate the slope and subtract its value from the line each day 
forward. This is where I'm stumped. Any suggestions?

{BarBack View}
len:=Input("Periods for Ref High",1,100,20)-1;
Signal:=Ref(H,-len);
Barbk:=Input("Barsback High",1,100,8)-1;
Signal2:=Ref(H,-Barbk);
Slope:=(Signal-Signal2)/(len-Barbk);
Periods:=len; {periods to display last value}
LastBar:=Cum(1)=LastValue(Cum(1)-(Periods));
bacdis:=ValueWhen(1,LastBar,LastValue(Signal));
{blank right side of line}
Line:=Ref(Ref(bacdis,-Barbk),Barbk);
line{end}


Preston   


------------------------ 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/l.m7sD/LIdGAA/qnsNAA/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/