Announcement

Collapse
No announcement yet.

Index

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Index

    What is the "Index" of a bar?

    For example:

    getCurrentBarIndex()
    getFirstBarIndexOfDay(Date, [Symbol])
    getNewestBarIndex([symbol])
    getOldestBarIndex([ symbol ])

    Please explain.
    Be the diner, not the dinner.

  • #2
    Index can be thought of as the number of bars. Really it is the Index to access those bars, but it comes to much the same thing to us. The most recent bar is always zero, and you work backwards from there (ie: 1 bar back is -1, two bars back -2, etc).

    Therefore:
    getCurrentBarIndex() - Would get you the current bar number

    getFirstBarIndexOfDay(Date, [Symbol]) - Would get the first bar of a specific day for a specific Symbol,Interval

    getNewestBarIndex([symbol]) - Should always return zero.
    getOldestBarIndex([ symbol ]) - Would return the oldest bar on the chart.

    Hope this helps
    Garth

    Comment

    Working...
    X