PureBytes Links
Trading Reference Links
|
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.
-----Original Message-----
From: DIMITRIS TSOKAKIS [mailto:TSOKAKIS@xxxxxxxxx]
Sent: Sunday, February 08, 2004 3:21 AM
To: amibroker@xxxxxxxxxxxxxxx
Subject: [amibroker] Re: When every day is Saturday...
Herman,
Note here that, since Now() Returns current date,
a. For me [European date] it is a Sunday morning and I read 1040208.
b. It has nothing to do with trading bars.
c. Now() IS NOT A UNIVERSAL FUNCTION, some hours od the day Yuki will
read 1040209 and I will still read 1040208.
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]
Dimitris Tsokakis
PS. Nice title !!
--- In amibroker@xxxxxxxxxxxxxxx, "Herman van den Bergen"
<psytek@xxxx> wrote:
> Hello,
>
> I would like to show the names of days for today and the last data
bar on
> some of my charts. Can somebody help me complete code for Today's
Weekday?
>
> function DayString( D )
> {
> DayNames
= "Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday";
> return StrExtract(DayNames, D);
> }
>
> TodaysWeekDay = DayString(Now(3)-LastValue(DateNum())); // <<<<
WRONG -
> HELP NEEDED!!!
>
> LastDataWeekDay =
> DayString(LastValue(ValueWhen(BarIndex()==(BarCount-1),DayOfWeek
())));
> LastDataDate = LastValue(DateTime());
>
> Title = "Today's Date: "+TodaysWeekday+" "+Now(1)+
> "\nLast Data: "+LastDataWeekDay+"
> "+NumToStr(LastDataDate,formatDateTime);
>
> many thank!
>
> herman
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
------------------------ 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/
|