getCurrentBarIndex()
Previous Top Next
getCurrentBarIndex()
Returns the current offset into the price series that is loaded in the chart.
Parameters
none |
this function has no input parameters |
Usage
function main() {
var nBarIndex;
...
...
nBarIndex = getCurrentBarIndex();
if ( nBarIndex < 0 ) {
//we are currently on a historical bar
}
else if ( nBarIndex == 0 ) {
//we are on the most current bar
}
}