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

Re: [EquisMetaStock Group] CBL Trailing Stop Loss, drawn for "x" periods only



PureBytes Links

Trading Reference Links

Mike

> I can create a new formula with your 2 lines below, and using the fml()
> function can call the output from my formula... that all works perfectly!
> Thankyou very much for your assistance.
> Following on though as you indicate below, is it actually possible to
> reference and use the output from within the same formula? I've tried to
> figure it out, but am now asking the dumb question of the day... sorry, is
> there a return() function or something one can use to call the output?

Sorry, I'm the dumb one. I can't quite see what you're getting at here. If
it's any help I've just finished testing my ideas on your formula and here's
the "all-in-one" version. Can you rephrase your question above?

Roy

HighDays:=Input("Enter # days to cover last HIGH for CBL calc'n:",3,55,13);
X:=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 ))))));
B:=LastValue(Cum(1))-Cum(1);
Y:=ValueWhen(1,X>0,X); {this line is redundant if the following line is in
place}
Y:=ValueWhen(1,B<=2*HighDays,Y);
Y;



------------------------ Yahoo! Groups Sponsor ---------------------~-->
Rent DVDs from home.
Over 14,500 titles. Free Shipping
& No Late Fees. Try Netflix for FREE!
http://us.click.yahoo.com/ybSovB/hP.FAA/3jkFAA/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/