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 NullPointStrategies, Today, 05:17 AM
      0 responses
      48 views
      0 likes
      Last Post NullPointStrategies  
      Started by argusthome, 03-08-2026, 10:06 AM
      0 responses
      126 views
      0 likes
      Last Post argusthome  
      Started by NabilKhattabi, 03-06-2026, 11:18 AM
      0 responses
      66 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