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

Re: [EquisMetaStock Group] How to do it in Metastock's coding??



PureBytes Links

Trading Reference Links

Eric


Is this something like what you want?

C1:=L>Ref(L,-1);
Cum(1)-ValueWhen(3,C1,Cum(1));


Kind regards

Roy Larsen
www.metastocktips.co.nz
Free formulas and MS links





----- Original Message ----- 
From: "chichungchoi" <no_reply@xxxxxxxxxxxxxxx>
To: <equismetastock@xxxxxxxxxxxxxxx>
Sent: Thursday, December 30, 2004 7:37 PM
Subject: [EquisMetaStock Group] How to do it in Metastock's coding??


> 
> 
> 
> Does anyone know how to do coding to meet following condition?
> 
> Start from any day, and count backward (CB) to find when the number 
> of occurrence for C1 equal to 3 times, and save the number of days 
> into a variable "CB".
> C1:=L>Ref(L,-1);
> 
> Such as if the current day is 30 Dec, 2004, Starting on any day, for 
> example, 20 Dec, 2004, and count backward to find number of 
> occurrence for C1, it occurred on
> 15 Dec, 2004
> 13 Dec, 2004 and
> 10 Dec, 2004, then on 10 Dec, 2004, the number of occurrence for C1 
> is equal to 3 times, therefore, the number of days is 10, 10 Dec, 
> 2004 to 20 Dec, 2004, and save 10 into CB variable for 20 Dec, 2004, 
> so CB variable will be different on different periods, such as on 29 
> Dec, 2004, and count backward to find number of occurrence for C1, it 
> occurred on 
> 27 Dec, 2004
> 26 Dec, 2004 and 
> 22 Dec, 2004, the on 22 Dec, 2004, the number of occurrence for C1 is 
> equal to 3 times, therefore, the number of days is 7, 22 Dec, 2004 to 
> 29 Dec, 2004, and save 7 into CB variable for 29 Dec, 2004, 
> 
> Does anyone have any suggestion on coding it in Metastock? 
> Thank you for any suggestion
> Eric
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> Yahoo! Groups Links
> 
> 
> 
> 
> 
> 
> 
> 
>



------------------------ Yahoo! Groups Sponsor --------------------~--> 
Make a clean sweep of pop-up ads. Yahoo! Companion Toolbar.
Now with Pop-Up Blocker. Get it for free!
http://us.click.yahoo.com/L5YrjA/eSIIAA/yQLSAA/BefplB/TM
--------------------------------------------------------------------~-> 

 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/equismetastock/

<*> 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/