[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




Thanks 
Roy! 
<FONT face=Arial color=#0000ff 
size=2> 
<FONT face=Arial color=#0000ff 
size=2> 
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.
<FONT face=Arial color=#0000ff 
size=2>Following on though as you indicate below, is it actually possible 
to<FONT face=Arial color=#0000ff 
size=2> reference and use the output from within the same formula? <SPAN 
class=748544602-28102003>I've tried to 
figure it out, but am now asking the dumb question of the day... 
<FONT 
face=Arial color=#0000ff size=2>sorry, is there a return() function or something 
one can use to call the output?

  <FONT face=Tahoma 
  size=2>-----Original Message-----From: Roy Larsen 
  [mailto:rlarsen@xxxxxxxxxxxxxx]Sent: Tuesday, 28 October 2003 12:12 
  PMTo: equismetastock@xxxxxxxxxxxxxxxSubject: Re: 
  [EquisMetaStock Group] CBL Trailing Stop Loss, drawn for "x" periods 
  onlyMikeThe problem of suppressing zero's on 
  the left side of he chart is easy toovercome. Name your output 
  variable  then add the following lines to createan output 
  plotX:=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 thanthe specified lookback periods to 
  create a window at the right side of thechart. 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 
  PMSubject: [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 enhanceit's> 
  reliability.>> A seemingly tiny issue I would like to solve, is 
  that I'm only interestedin> 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 (as13> 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 <A 
  href="">http://docs.yahoo.com/info/terms/>>>>To 
  unsubscribe from this group, send an email 
  to:equismetastock-unsubscribe@xxxxxxxxxxxxxxxYour 
  use of Yahoo! Groups is subject to the <A 
  href="">Yahoo! Terms of Service. 







Yahoo! Groups Sponsor


  ADVERTISEMENT 









To unsubscribe from this group, send an email to:
equismetastock-unsubscribe@xxxxxxxxxxxxxxx





Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.