GetDayIndex

Top  Previous  Next

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

 

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

 

Syntax

 

barIndex = instrument.GetDayIndex( date )

 

Parameters

date

 

the date in YYYYMMDD 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