Announcement

Collapse
No announcement yet.

Absolute bar info access

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

  • Absolute bar info access

    I am writing a routine that will cycle through all the bars and store information about certain bars. I've written this in other trading packages, and I simply store the bar index of these bars and then access them when I need to. In EFS it seems you can't do this, but rather you have to access that bar as an offset.

    Does anyone have a suggestion on how to best approach this?

    Should I just write a routine that will call getCurrentBarIndex() and then store that value for these bars that I need to store. then when I need to access that info, simple call a routine that will subtract the currentbarindex minus that stored value. This would then give me the offset I need and then access that bar.
    Seems a funny way to do it, but only thing I can think of at this late hour.

    thoughts?

    Todd

  • #2
    Todd:

    If you are working on real-time data, the offsets will change as each new bar comes in. You might want to consider creating a custom bar index based on the offset to a fixed reference point, such as today's opening bar or yesterday's opening bar.

    Chris

    Comment


    • #3
      You could store the currentbar index and then everytime you see a BARSTATE_NEWBAR increment the index values.

      I saw your post about wanting to store information in each bar - good idea. Perhaps in a future release

      m.
      Matt Gundersen

      Comment

      Working...
      X