PureBytes Links
Trading Reference Links
|
Hi Eric, Wabbit
If I am interpreting the original question correctly this is how I would code it. (The question was somewhat ambiguous and that probably explains why 3 different people have each come up with a different interpretation of what was meant.)
Cum(C>REF(C,-1));
You could check this over 1000 bars by also checking results from
Cum(C<REF(C,-1)); and
Cum(C=REF(C,-1));
Summing all three values on the last bar should give 999 (you'd need to scan 1001 bars to count a total of 1000 events). Don't forget that securities with less than 1000 bars of history will also produce a lower total so a fourth exploration column with Cum(1) would also be a good idea.
Cum(1);
I may also have misunderstood the question in which case this solution will be no closer to what you need.
Regards
Roy
www.metastocktips.co.nz
----- Original Message -----
From: chichungchoi
To: equismetastock@xxxxxxxxxxxxxxx
Sent: Monday, September 04, 2006 12:13 PM
Subject: Re: [EquisMetaStock Group] Help - Metastock coding ?
Thank everyone for suggestions
Sum(C>REF(C,-1),days);
The code "C > Ref(C,-1)" only check with the previous one, and it
cannot check with Ref(C,-2), Ref(C,-3), Ref(C,-4) ...
Cum(LastValue(C)>C);
which is closer to what I need, but it can only show the result for the
last day. If there is an approach to show the result for every day,
then it will great, will it be the limitation for Metastock Coding?
If(C > Ref(C,-1),1,0)+
If(C > Ref(C,-2),1,0)+
If(C > Ref(C,-3),1,0)+
If(C > Ref(C,-4),1,0)+
If(C > Ref(C,-5),1,0)+ ...
Do you have any more suggestion ?
Thank everyone
Eric
[Non-text portions of this message have been removed]
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/
|