PureBytes Links
Trading Reference Links
|
Mike
The problem of suppressing zero's on the left side of he chart is easy to
overcome. Name your output variable then add the following lines to create
an output plot
X:=ValueWhen(1,"Plot Name">0,"Plot Name");
X;
The other issue is not a biggie either.
Create a reverse bar count and then use that count being equal or less than
the specified lookback periods to create a window at the right side of the
chart. Then all you do is use the same approach as above (using Valuewhen)
to trigger the output when the window is open.
B:=LastValue(Cum(1))-Cum(1);
X:=ValueWhen(1,B<=HighDays,"Plot Name");
X;
Roy
----- Original Message -----
From: "Mike Loveday" <mike.loveday@xxxxxx>
To: "Equismetastock@xxxxxxxxxxxx Com" <equismetastock@xxxxxxxxxxxxxxx>
Sent: Tuesday, October 28, 2003 1:49 PM
Subject: [EquisMetaStock Group] CBL Trailing Stop Loss, drawn for "x"
periods only
>
> Below is a CBL formula that I wish to use for trailing stop loss,
> acknowledgements and thanks to Trader Online and those that contributed to
> this. I have included one extra lookback day in the formula to enhance
it's
> reliability.
>
> A seemingly tiny issue I would like to solve, is that I'm only interested
in
> the most recent data, and don't need to see a line across the whole chart
(A
> secondary minor problem to this is that on some charts from the first
> displayed period the line starts from zero which compresses the scaling of
> the chart).
>
> Hence I would like only to have the formula draw the last 13 periods (as
13
> is the lookback period I use for the last high day).
>
> So I need to add to this function something like a wrapper (a FOR or WHILE
> funtion in C), which simply says:
>
> "for last x periods, do this:"
>
>
> HighDays := Input("Enter # days to cover lastHIGH for CBL calc'n:", 3, 55,
> 13);
>
> If(HIGH < HHV(HIGH, HighDays), {then ...}PREV, {previous CBLhi, else...}
> If(Ref(L,-2) < Ref(L,-1) AND Ref(L,-2) < L AND
> Ref(L,-1) < L, {then ...} Ref(L,-2), {2nd day back low, else...}
> If((Ref(L,-3)< Ref(L,-2) AND
> Ref(L,-3) <Ref(L,-1) AND
> Ref(L,-3) < L) AND
> (Ref(L,-2)< L OR
> Ref(L,-1) < L),{then ... } Ref(L,-3), {3rd day back low, else...}
> If((Ref(L,-4)<Ref(L,-3) AND
> Ref(L,-4) < Ref(L,-2) AND
> Ref(L,-4)< Ref(L,-1) AND
> Ref(L,-4) < L) AND
> (Ref(L,-3)< L OR
> Ref(L,-2)< L OR
> Ref(L,-1) < L), {then... }
> Ref(L,-4), {4th day back low, else...}
> If((Ref(L,-5)<Ref(L,-4) AND
> Ref(L,-5) < Ref(L,-3) AND
> Ref(L,-5) < Ref(L,-2) AND
> Ref(L,-5) < Ref(L,-1) AND
> Ref(L,-5) < L) AND
> (Ref(L,-4)< L OR
> Ref(L,-3) < L OR
> Ref(L,-2) < L OR
> Ref(L,-1) < L), {then ...}
> Ref(L,-5), {5th day back low, else...}
> If((Ref(L,- 6 )<Ref(L,- 5) AND
> Ref(L,- 6 ) < Ref(L,- 4) AND
> Ref(L,- 6 ) < Ref(L,- 3) AND
> Ref(L,- 6 ) < Ref(L,- 2) AND
> Ref(L,- 6 ) < Ref(L,- 1) AND
> Ref(L,- 6 ) < L) AND
> (Ref(L,- 5 )< L OR
> Ref(L,- 4 ) < L OR
> Ref(L,- 3 ) < L OR
> Ref(L,- 2 ) < L OR
> Ref(L,-1) < L), {then ...} Ref(L,- 6 ), { 6th day back low, else...}
> PREV ))))))
>
> If anyone can think of a way to achieve this, it could be applied to any
> indicator where only the recent past is of relevance (such as a SL), and
> would keep the clutter away from the rest of the primary chart data.
>
> Many thanks, Mike
>
>
>
> 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/
>
>
>
>
------------------------ 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/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/
|