Creates a Chart object compatible date and a time value.

 

Syntax:

ChartTime( YYYYMMDD, HHMM )

 

Parameter:

Description:

YYYYMMDD

Any valid numeric date in the YYYYMMDD format.  Date must be a number without any delimiting characters.

HHMM

Any valid 24-hour HHMM formatted time value with no delimited characters between the hour and minute section of the time number.

 

Use a zero value when no time value is needed.

 

Returns:

Date and time values are converted to the number of seconds that have elapsed since 01-01-0001 00:00:00 to the time when executed.  This date and time format is the date & time format used by the chart object.

 

Example:

'  ----------------------------------------------------------------

'  test.currentDate without a time value

PRINT "test.currentDate ", test.currentDate

PRINT "ChartTime        ", ChartTime(test.currentDate, 0)

 

Returns:

test.currentDate , 2010-07-12

ChartTime        , 63414536400.000000000

 

'  ----------------------------------------------------------------

'  YYYYMMDD date in seconds, without a time value

PRINT "ChartTime ", ChartTime(test.currentDate, test.currentTime)

 
Returns:

ChartTime 20130126, 63494755200.000000000

 

'  ----------------------------------------------------------------

'  YYYYMMDD date in seconds, without a time value

PRINT "ChartTime 20130126 ", ChartTime(20130126, 0)

 
Returns:

ChartTime 20130126, 63494755200.000000000

 

'  ----------------------------------------------------------------

'  YYYYMMDD date in seconds, without a time value

PRINT "ChartTime ", ChartTime(test.currentDate, test.currentTime)

 

Returns:

ChartTime 20130126, 63494755200.000000000

 

'  ----------------------------------------------------------------

'  AFTER TRADING DAY SCRIPT ASSIGNS TEST DATES TO BPV Auto-Index SERIES

 

'  Store Test Dates & ChartTime seconds in two numeric series
TestDateArray = test.currentDate
'  Converted Test Dates to ChartTime seconds
DateTimeArray = ChartTime( test.currentDate, 0 )

 

 

'  AFTER TEST Print Test Dates as elapsed seconds, and YYYYMMDD dates
PRINT "DateTimeArray[3] ", DateTimeArray[3], TestDateArray[3]
PRINT "DateTimeArray[2] ", DateTimeArray[2], TestDateArray[2]
PRINT "DateTimeArray[1] ", DateTimeArray[1], TestDateArray[1]
PRINT "DateTimeArray[0] ", DateTimeArray[0], TestDateArray[0]

 
Returns:

DateTimeArray[3] ,63414230400.000000000,20100709.000000000,
DateTimeArray[2] ,63414316800.000000000,20100710.000000000,
DateTimeArray[1] ,63414403200.000000000,20100711.000000000,
DateTimeArray[0] ,63414489600.000000000,20100712.000000000,

 

 

Notes:

SystemDate is a compatible date format, but it will return the same date value for a series, but might be useful as a label.

SystemTime() function is not a compatible format for ChartTime.

 

 


 

Created with Help & Manual 7 and styled with Premium Pack Version 2.80 © by EC Software