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 NullPointStrategies, Today, 05:17 AM
      0 responses
      43 views
      0 likes
      Last Post NullPointStrategies  
      Started by argusthome, 03-08-2026, 10:06 AM
      0 responses
      124 views
      0 likes
      Last Post argusthome  
      Started by NabilKhattabi, 03-06-2026, 11:18 AM
      0 responses
      65 views
      0 likes
      Last Post NabilKhattabi  
      Started by Deep42, 03-06-2026, 12:28 AM
      0 responses
      42 views
      0 likes
      Last Post Deep42
      by Deep42
       
      Started by TheRealMorford, 03-05-2026, 06:15 PM
      0 responses
      46 views
      0 likes
      Last Post TheRealMorford  
      Working...
      X