Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

AddDataSeries on same instrument with different trading hours

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

    #16
    I have 1440 Minute Bars I am using with a trading hours template which is shorter than the one of the primary bar series. I cannot use AddDataSeries because of the problem we discussed above (in realtime all added series have to be in session for OnBarUpdate to process which I don't want). So I have to build my own 1440 minute OHLC values within the trading hours which are shorter than the trading hours template of the primary bar series right? Or is there a better way?

    When using Series<double> the values outside my time conditions will also have slots. So for example with MyCustomClose[0] I am not getting the value of the Close yesterday based on the shorter time conditions. At least in my tests I am not getting the right results.

    Am I missing something here?

    Comment


      #17
      I went through your last post again and I think I figured out how to do it:
      1. I add 2 price series (1440 Minute and 15 Minute) with my shorter trading hours on another (!) instrument than the one I am trading.
      2. In my primary data series (15 Minute) with the full trading hours I save the OHLC values as Series<double> based on the time conditions of my shorter trading hours.
      3. When constructing the Series<double> I refer to the BarsArray of the added price series of the other instrument from step 1.
      I think this way it should behave realtime exactly like historical.

      So the crucial point is to add another instrument because the problem with AddDataSeries waiting for all bars being in session occurs realtime only if the same instrument with different trading hours is used. And of course it is important to construct the Series on the Bars of this added data series so it is in sync with the trading hours template I want.

      Thanks a lot again for the hint with the Bars Array when constructing the Series this was very helpful!.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Mindset, 04-21-2026, 06:46 AM
      0 responses
      88 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by M4ndoo, 04-20-2026, 05:21 PM
      0 responses
      135 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
      119 views
      0 likes
      Last Post cmoran13  
      Started by PaulMohn, 04-10-2026, 11:11 AM
      0 responses
      69 views
      0 likes
      Last Post PaulMohn  
      Working...
      X