Returns the bar index of the date and optional time. This bar index synchronizes with the instrument.bar. To find the close for a bar Index returned, subtract from instrument.bar and use as a lookback index.

 

Note:

Returns -1 if the date is not found in the instrument series.

 

Syntax:

barIndex = instrument.GetDayIndex( date, [time] )

 

Parameter:

Description:

date

The date in YYYYMMDD format.

[time]

Optional: The time in HHMM format.

 

Example:

barIndex = instrument.GetDayIndex( 20060101 )
 
IF barIndex <> -1 THEN
  barClose = instrument.close[ instrument.bar - barIndex ]
  barDate = instrument.date[ instrument.bar - barIndex ]  
ENDIF
 
PRINT barClose, barDate

Returns:

 

 

Links:

Data Functions

See Also:

 

 


Edit Time: 9/25/2017 09:09:58 AM


Topic ID#: 351

 

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