PureBytes Links
Trading Reference Links
|
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Does this help?
/*
TodayDateNum.afl
*/
// Sets TodayDateNum to the datenum of the current or most recent
// trading Day (ie weekday, too hard to allow for holidays)
// If(LastValue(DateNum()) != TodayDateNum), data hasn't been updated
// for today (or you are using unpadded data and there were no trades).
EnableScript("jscript");
<%
Now = new Date();
dow = Now.getDay();
switch(dow) {
case 6: // Saturday
Now = new Date(Now.getTime()-86400000); // 1 day ago
break;
case 0: // Sunday
Now = new Date(Now.getTime()-172800000); // 2 days ago
break;
}
ccyy = Now.getFullYear()-1900;
mm = Now.getMonth()+1;
dd = Now.getDate();
AFL("TodayDateNum") = ccyy*10000 + mm*100 + dd;
%>
Nigel
On Sun, 8 Feb 2004 20:27, Herman van den Bergen wrote:
> Thanks DT,
>
> Yes, I understand Now() however i am trying to make an EOD system foolproof
> by showing the actual day/date for today and by displaying the last
> day/date for the last data bar in the database. Ideally I would like to
> give a message when there has been an additional trading day since the last
> update of the database. It is not really a critical need but it is fun to
> add little features that are usefull for others, less AB-literate, who use
> my computer. You point out:
>
> d. Now(3)-LastValue(DateNum()) for Saturdays will be equal to 1, for
> Sundays will be equal to 2 and for the regular trading days will be
> equal to 1 or 0 [if you hit apply before 24:00 of a trading day will
> be equal to 0, at 00:01 will be 1]
>
> So, we can conclude that Now(3)-LastValue(DateNum()) is equal to zero for
> days that the database is uptodate and >0 when the database needs
> updating... ? Ignoring the Saturday and Sunday, well, actually QP produces
> some files on those and other non-trading days as well...so this equation
> might not be so bad for detecting an out-of-date database.
>
> Thanks for the input, I'll try that!
> herman.
>
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.2 (GNU/Linux)
iD8DBQFAJgfuBbmcM2pfckkRAqswAKDYSSslzPqr/mC7GQjOptOz/uxwZQCgojz6
J7gv0ND68jpbzyZrOnR4Euc=
=+wFl
-----END PGP SIGNATURE-----
------------------------ Yahoo! Groups Sponsor ---------------------~-->
Buy Ink Cartridges or Refill Kits for your HP, Epson, Canon or Lexmark
Printer at MyInks.com. Free s/h on orders $50 or more to the US & Canada.
http://www.c1tracking.com/l.asp?cid=5511
http://us.click.yahoo.com/mOAaAA/3exGAA/qnsNAA/GHeqlB/TM
---------------------------------------------------------------------~->
Send BUG REPORTS to bugs@xxxxxxxxxxxxx
Send SUGGESTIONS to suggest@xxxxxxxxxxxxx
-----------------------------------------
Post AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx
(Web page: http://groups.yahoo.com/group/amiquote/messages/)
--------------------------------------------
Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.html
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/amibroker/
<*> To unsubscribe from this group, send an email to:
amibroker-unsubscribe@xxxxxxxxxxxxxxx
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
|