getNewestBarIndex()

ICE Data Services -

getNewestBarIndex()
Previous  Top  Next


getNewestBarIndex( [symbol] )

Returns the bar index of the most recent bar in the series. This will always return zero (0) unless no data exists for the given symbol, in which case it will return null. If symbol is omitted, the symbol for the current chart it used.

Parameters

symbol
optional. the symbol to use


Usage

function main() {
var nBarIndex;

   ...
   ...

   nBarIndex = getNewestBarIndex();
   
if ( nBarIndex == null ) {
      
//there is no data for the currently-loaded symbol
   }
   
else if ( nBarIndex == 0 ) {
      
//we have data
   }

}