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

RE: [EquisMetaStock Group] Re: Last bar's date in Explorations



PureBytes Links

Trading Reference Links

Jose, thanks!

I tried both mmddyy and yymmdd (I have nothing against the latter format). 
The problem with both is that:
- the leading zero gets removed, so Sep 12, 2006 is written as 91206 (in 
mmddyy) and as 60912 (in yymmdd); they both look like US postal zip codes! 
It would be nice if the leading zero may not be dropped
- it would be even nicer if the entire year could be preserved (as 2006, not 
as 06)!
- 3 zeros get plotted after the date (so its actually 91206.000 in mmddyy 
format); they are useless - can they be removed?

JD
==========================

From: "Jose Silva" <josesilva22@xxxxxxxxx>
Reply-To: equismetastock@xxxxxxxxxxxxxxx
To: equismetastock@xxxxxxxxxxxxxxx
Subject: [EquisMetaStock Group] Re: Last bar's date in Explorations
Date: Tue, 12 Sep 2006 16:46:16 -0000

John, I would recommend that you wean yourself from the impractical
MM/DD/YYYY date format (it cannot be easily sorted numerically), and
adopt either of the dd/mm/yyyy or yyyymmdd standards.

Anyway, the formula below plots mmddyy without any leading zeroes.
Large numbers such as mmddYYYY result in precision errors in
MetaStock, so I've truncated YYYY to YY.
e.g.: 12th Sept 2006 will plot as (0)91206.

=================
mmddyy - last bar
=================
---8<--------------------------------

{ http://www.metastocktools.com }

{ Last bar's signal }
last:=Cum(1)=LastValue(Cum(1));

{ Signal's yymmdd value }
yy:=ValueWhen(1,last,Year());
yy:=Int(Frac(yy/100)*100+.5);
mm:=ValueWhen(1,last,Month());
dd:=ValueWhen(1,last,DayOfMonth());
yymmdd:=LastValue(yy*10000+mm*100+dd);
mmddyy:=LastValue(yy+mm*10000+dd*100);

{ Plot in own window }
mmddyy

---8<--------------------------------


jose '-)
http://www.metastocktools.com




--- In equismetastock@xxxxxxxxxxxxxxx, "John Doe" <ms001122@xxx>
wrote:
 >
 > In some of my explorations, in one of the columns I would like to
 > retrieve the date (in US format: MM/DD/YYYY) of the last bar; this
 > would serve as a check that the security did trade on the last date
 > like other securities. I know how to get Year(), Month(),
 > DayOfMonth() etc. in individual columns but I would like to
 > retrieve the entire date in 1 column. The answer is probably
 > very simple but eludes me at the moment. Any help appreciated.









Yahoo! Groups Links










 
Yahoo! Groups Links

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

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/equismetastock/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto:equismetastock-digest@xxxxxxxxxxxxxxx 
    mailto:equismetastock-fullfeatured@xxxxxxxxxxxxxxx

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