Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Impact of adding instrument with different session time to strategy

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

    Impact of adding instrument with different session time to strategy

    All,

    I seem to have an issue with a multi-instrument strategy, the primary instrument (primary BarObject) is ES 03-11 (15min) with an added BarObject ^SP500 (15min). The issue revolves around the Session Templates applied to the two BarObjects.

    To explain the issue visually, if the two instruments are displayed as separate charts the ES 03-11 would have a session template of "Default 24/7" to show both sessions of the futures contract, the ^SP500 would have a session template of "<Use instrument settings>".
    As a quick aside, in the Instrument Editor, ^SP500 appears to be defined with instrument type set as Future and the Session template set as CME FX Futures RTH:- Mon-Fri 7:20AM-2:00PM US Central Time (GMT-6:00), which would make the session template incorrect. The New York Stock Exchange, NYSE, is open from Monday through Friday 9:30AM - 4:00PM US Eastern Time (AKA 8:30AM - 3:00PM US Central Time). Interestingly, the session template "<Use instrument settings>" does refer to the correct timeframe.

    So, the two BarObjects require two different Session Templates to display correctly (Displaying ^SP500 as "Default 24/7" would result in an additional 15mins of after-market trade to be displayed). Understandably, for any indicators (e.g. SMA) referring to prior bars to be correctly calculated the Session Templates have to be correct.

    Question 1, if the strategy is executed on the ES 03-11 chart, is the set Session Template ("Default 24/7") used?
    Question 2, if the strategy is executed via the Control Centre | Strategies Tab, what Session Template is used and how is it set?
    Question 3, to correctly calculate indicator values on the ^SP500, which are referenced by the strategy, how can I specify the correct Session Template to use?

    Thank you for indulging this rather long question
    Regards
    Shannon

    #2
    Hello there, to answer your questions:

    1) The strategy will run on whatever session the chart is set to. So in this case, it would run on the Default 24/7 template.

    2) You set the session template when you start the strategy. In NT6.5, you specify the session start and end time and in NT7, you pick the session template to use in the dialogue.

    3) You'll have to chose the template that correctly represents the hours you have SP500 data for. If such a template does not exist, you can create it, but from your post it seems like US Equities RTH (9:30 am to 4 pm) would be best.
    Attached Files
    AustinNinjaTrader Customer Service

    Comment


      #3
      Austin,

      Thank you for the quick reply.

      If I correctly understand your response for question 3, I'm in a bit of a quandary.

      The multi-instrument strategy (primary BarObject = ES03-11, secondary BarObject = ^SP500) refers to indicators on both BarObjects (e.g. SMA). To correctly calculate indicators on the ES03-11 requires session template "Default 24/7", to correctly calculate indicators on the ^SP500 requires session template "US Equities RTH". Setting the session template used by the multi-instrument strategy to "Default 24/7" will result in incorrect ^SP500 indicators, setting the session template to "US Equities RTH" will result in incorrect ES03-11 indicators.

      I believe the above problem would be an issue for all multi-instrument strategies where the instrument session times were different.

      How can this issue be resolved?

      Again, thank you
      Regards
      Shannon

      Comment


        #4
        Shannon, I will have someone get back to you tomorrow. Thank you for your patience.
        AustinNinjaTrader Customer Service

        Comment


          #5
          Hi Shannon, unfortunately the primary's series session template will be used for all Add() series as well - you could not mix match 2 series running on different templates - a workaround would be using Default 24 / 7 to ensure you have access to all data needed for the complete strategy and then self calculating the index's SMA value on the data you wish to.

          Comment


            #6
            Bertrand,

            Thanks for the reply. Sounds like it is a bit of a curly one.

            There a more than a few indicators (referenced by the strategy) affected by this problem. I'll investigate to see how wide reaching the issue is. Again, thank you for the workaround idea.

            Any hope of this issue being addresses in future releases?

            Regards
            Shannon

            Comment


              #7
              You're welcome, yes this one is unfortunately a bit more tricky - we've added it to our list of feedback and will consider it for future feature consideration.

              Comment


                #8
                Bertrand,

                Would it be possible to "edit" the secondary BarSeries object essentially deleting (or ignoring) the extra 15mins of BarUpdate information after NYSE close? Thus allowing all indicators calling the secondary BarSeries to correctly calculate?

                Alternatively, would it be possible to create new DataSeries objects (called from the primary BarObject series with session template = "Default 24/7") with all the information (i.e. Open, High, Low, Close) that forms part of the secondary BarObject (with the different session template)?

                Code:
                #region Variables
                  public DataSeries CashOpen;
                  public DataSeries CashHigh; 
                  public DataSeries CashLow;
                  public DataSeries CashClose;
                #endregion
                
                protected override void Initialize()
                {
                  CashOpen = new DataSeries(this); 
                  CashHigh = new DataSeries(this); 
                  CashLow = new DataSeries(this); 
                  CashClose = new DataSeries(this); 
                }
                
                protected override void OnBarUpdate()
                {
                  // NYSE trading hours = 9:30am -> 4:00pm US EST.  Mark trading hours with boolean "BCashHours" = true
                  if (!(USTradingHours(0).BCashHours))
                    return;	  
                
                  // Calculate each of the elements based on BarsArray 1
                  CashOpen.Set(Opens[1][0]); 
                  CashHigh.Set(Highs[1][0]);
                  CashLow.Set(Lows[1][0]);
                  CashClose.Set(Closes[1][0]);
                }
                Under this possible solution the PUBLIC DataSeries would be accessed by essentially duplicate indicators (of which there are many) designed to call on the CashOpen, CashHigh, etc instead of a BarArray Opens[1][0], Highs[1][0].

                Any guidance would be appreciated.
                Regards
                Shannon

                Comment


                  #9
                  Bertrand,

                  It would appear a concurrent tread also deals with this matter. http://www.ninjatrader.com/support/f...ad.php?t=38302
                  If a multi-series script adds an additional Bars object that already exists on the chart, the script will use the preexisting series instead of creating a new one to conserve memory. This includes that series' session template as applied from the chart. If the Bars object does not exist on the chart, the session template of the added Bars object will be the session template of the primary Bars object. If the primary Bars object is using the "<Use instrument settings>" session template then the additional Bars objects will use the default session templates as defined for their particular instrument in the Instrument Manager.
                  If I understand the soon to be updated NT7 Help Guide (p.583) correctly, my issue could be resolve by:
                  1 - changing the primary BarsObject (ES) default session template to "Default 24/7" via the Instrument Manager, and
                  2 - changing the secondary BarsObject (^SP500) default session template to "US Equities RTH" (i.e. New York 9:30am - 4:00pm) via the Instrument Manager, and
                  3 - Execute the strategy on the primary BarsObject with "<Use instrument settings>", thus operating on ES "Default 24/7" and ^SP500 "US Equities RTH".

                  Please confirm my understanding

                  Regards
                  Shannon

                  Comment


                    #10
                    Shannon, I will have Bertrand get back to you tomorrow when he gets in.
                    AustinNinjaTrader Customer Service

                    Comment


                      #11
                      Hi Shannon, thanks for the patience - your understanding is correct.

                      Comment

                      Latest Posts

                      Collapse

                      Topics Statistics Last Post
                      Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                      0 responses
                      649 views
                      0 likes
                      Last Post Geovanny Suaza  
                      Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                      0 responses
                      370 views
                      1 like
                      Last Post Geovanny Suaza  
                      Started by Mindset, 02-09-2026, 11:44 AM
                      0 responses
                      109 views
                      0 likes
                      Last Post Mindset
                      by Mindset
                       
                      Started by Geovanny Suaza, 02-02-2026, 12:30 PM
                      0 responses
                      574 views
                      1 like
                      Last Post Geovanny Suaza  
                      Started by RFrosty, 01-28-2026, 06:49 PM
                      0 responses
                      576 views
                      1 like
                      Last Post RFrosty
                      by RFrosty
                       
                      Working...
                      X