Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Bars.GetOpen in Multi-Instrument strategy

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

    Bars.GetOpen in Multi-Instrument strategy

    I use this statement to get the open from the next future bar:

    Bars.GetOpen(CurrentBar+1)

    I would like to use this function for a second DataSeries within the strategy. But there seems to be no statement like e.g.

    Bars.getOpens[0][1](....

    Are there other solutions?

    #2
    Hello starcd,

    If you wanted to use that function for a secondary series you would need to use the secondary bars object. Bars refers to the Primary series always. You could try BarsArray[1] instead.

    Just as a heads up, its not expected to be able to retrieve future data when using the BarsAgo system or in general. When using a series that has BarsAgo that is the data up until that point in processing and the BarsAgo refers to bars in the past from that point. The GetOpen or GetValueAt methods use a specific bar index and observe the whole series at once. Those methods are generally not used in contexts where you are stepping through the data like OnBarUpdate because you can't look into the future in realtime data. Trying to do that in realtime data may produce odd results.

    I look forward to being of further assistance.

    Comment


      #3
      Thank you, that worked.! Don't worry, the function is only important for backtesting in my strategy. But of course I understand the hint.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Mindset, 04-21-2026, 06:46 AM
      0 responses
      90 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by M4ndoo, 04-20-2026, 05:21 PM
      0 responses
      137 views
      0 likes
      Last Post M4ndoo
      by M4ndoo
       
      Started by M4ndoo, 04-19-2026, 05:54 PM
      0 responses
      68 views
      0 likes
      Last Post M4ndoo
      by M4ndoo
       
      Started by cmoran13, 04-16-2026, 01:02 PM
      0 responses
      120 views
      0 likes
      Last Post cmoran13  
      Started by PaulMohn, 04-10-2026, 11:11 AM
      0 responses
      71 views
      0 likes
      Last Post PaulMohn  
      Working...
      X