[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




no it 
was me after all :) [very much so!]
<FONT face=Arial color=#0000ff 
size=2> 
I did 
figure it out just before getting this, as you indicate by sticking X:= at 
the beginning of the whole formula that in itself very simply labels the return, 
you don't have to mention it again. 
Soo 
simple!! Couldn't be easier, and something I probably should have picked up 
from the formula primer study.
I'm 
used to naming outputs in this way:
<FONT face=Arial color=#0000ff 
size=2> 
int 
X;
<FONT face=Arial color=#0000ff 
size=2> 
<FONT face=Arial color=#0000ff 
size=2><code>
<FONT face=Arial color=#0000ff 
size=2> 
<FONT face=Arial color=#0000ff 
size=2>return(X);
<FONT face=Arial color=#0000ff 
size=2> 
Thanks 
for all your help with this one Roy! Think I'll do better if I stop confusing 
with other languages.
<FONT face=Arial color=#0000ff 
size=2> 
<FONT face=Arial color=#0000ff 
size=2>cheers,  Mike
<FONT face=Arial color=#0000ff 
size=2> 

  <FONT face=Tahoma 
  size=2>-----Original Message-----From: Roy Larsen 
  [mailto:rlarsen@xxxxxxxxxxxxxx]Sent: Tuesday, 28 October 2003 2:42 
  PMTo: equismetastock@xxxxxxxxxxxxxxxSubject: Re: 
  [EquisMetaStock Group] CBL Trailing Stop Loss, drawn for "x" periods 
  onlyMike> 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. Ifit's any help I've just 
  finished testing my ideas on your formula and here'sthe "all-in-one" 
  version. Can you rephrase your question 
  above?RoyHighDays:=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 ANDRef(L,-1) < L, {then ...} Ref(L,-2),   {2nd day 
  back low, else...}If((Ref(L,-3)< Ref(L,-2) ANDRef(L,-3) 
  <Ref(L,-1) ANDRef(L,-3) < L) AND(Ref(L,-2)< L ORRef(L,-1) 
  < L),{then ... } Ref(L,-3), {3rd day back low, 
  else...}If((Ref(L,-4)<Ref(L,-3) ANDRef(L,-4) < Ref(L,-2) 
  ANDRef(L,-4)< Ref(L,-1) ANDRef(L,-4) < L) AND(Ref(L,-3)< 
  L ORRef(L,-2)< L ORRef(L,-1) < L), {then... }Ref(L,-4), {4th 
  day back low, else...}If((Ref(L,-5)<Ref(L,-4) ANDRef(L,-5) < 
  Ref(L,-3) ANDRef(L,-5) < Ref(L,-2) ANDRef(L,-5) < Ref(L,-1) 
  ANDRef(L,-5) < L) AND(Ref(L,-4)< L ORRef(L,-3) < L 
  ORRef(L,-2) < L ORRef(L,-1) < L), {then ...}Ref(L,-5), {5th 
  day back low, else...}If((Ref(L,- 6 )<Ref(L,- 5) ANDRef(L,- 6 ) 
  < Ref(L,- 4) ANDRef(L,- 6 ) < Ref(L,- 3) ANDRef(L,- 6 ) < 
  Ref(L,- 2) ANDRef(L,- 6 ) < Ref(L,- 1) ANDRef(L,- 6 ) < L) 
  AND(Ref(L,- 5 )< L ORRef(L,- 4 ) < L ORRef(L,- 3 ) < L 
  ORRef(L,- 2 ) < L ORRef(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 
  inplace}Y:=ValueWhen(1,B<=2*HighDays,Y);Y;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.