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

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



PureBytes Links

Trading Reference Links

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

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