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

Re: [amibroker] StrToDateNum



PureBytes Links

Trading Reference Links

First: there is NO such function as StrToDateNum.
 
The function that actuall EXISTS is called StrToDateTime.
And it returns DateTime, not datenum.
 
Therefore you should use DateTime() to compare:
 
Dat     =     "02/04/2007";
Dat1    =    StrToDateTime(Dat);
BuyPrice = ValueWhen(DateTime()==Dat1,C,1);

Best regards,
Tomasz Janeczko
amibroker.com
----- Original Message -----
From: Ken Close
Sent: Thursday, September 18, 2008 11:12 PM
Subject: [amibroker] StrToDateNum

I guess I do not understand the function StrToDateNum, as simple as the definition seems to be.
 
I have a string "02/04/2007", say
 
Dat     =     "02/04/2007";
Dat1    =    StrToDateNum(Dat);
 
I would like to find the Price on that date.
 
BuyPrice = ValueWhen(DateNum()==Dat1,C,1);
 
produces a large and incorrect value.
 
Can someone help me with why the above does not produce the correct value?
The Help definition for StrToDateNum has the example as "2007-Feb-04", but my string is formatted as mm/dd/yyyy.
Would this be the reason?
 
Thanks,
Ken
__._,_.___

Please note that this group is for discussion between users only.

To get support from AmiBroker please send an e-mail directly to
SUPPORT {at} amibroker.com

For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
http://www.amibroker.com/devlog/

For other support material please check also:
http://www.amibroker.com/support.html




Your email settings: Individual Email|Traditional
Change settings via the Web (Yahoo! ID required)
Change settings via email: Switch delivery to Daily Digest | Switch to Fully Featured
Visit Your Group | Yahoo! Groups Terms of Use | Unsubscribe

__,_._,___