Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Session Manager Templates

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

    Session Manager Templates

    Hi All,

    Well firstly after a short 2 week period, we have now almost completed a trading strategy on Ninja 7. Good job guys, to experienced developers this is a pleasant experience.

    As we wanted to create Money Management behaviour for all of our strategies, we have developed an Abstract class that all of our implementation strategies inherit instead of inheriting directly from the Ninja Strategy class. This seems to work very well in the first implementation that we've nearly finished.

    We'd like to improve the use of the session manager and be able to utilise the nice Session Manager templates you have introduced into NT7 from within our Abstract layer. We need to do this because the current method of filtering "out of hours" bars from the chart is too severe as end of session positions are not handled correctly and provide incorrect outcomes during back testing.

    Is it possible to either extend an overrideable method or mode setting to derived classes such that we may either use the built in filtering mechanism (default) or simply ask the question "IsTradingTime()" and do our own filter processing? In most cases, we'd like to leave the bars in play but simply disable trade entry.

    We have implemented our own Time management layer to simulate this but we'd like to have the flexibility of using your nice Session Manager classes that allow users to enter collections of durations.

    If the enhancement suggestion I've made is not what Ninja would like to do, can we at least have access to the Session manager templates and accessors so we can make use of them?

    Regards,

    Paul

    #2
    Paul, I will have someone respond to you tomorrow.
    AustinNinjaTrader Customer Service

    Comment


      #3
      Paul,

      The session templates define the bars that will be used. Unfortunately it does not define a subset of bars that is trade-able. For that, you will need to employ a time filter like something outlined here: http://www.ninjatrader-support2.com/...ead.php?t=3226

      What is available for the Session Manager are things like accessing the next begin/end time. Please see here: http://ninjatrader.com/support/helpG...ml?session.htm Unfortunately there is no override method at this point in time. Thank you for the suggestion.
      Josh P.NinjaTrader Customer Service

      Comment


        #4
        Originally posted by NinjaTrader_Josh View Post
        Paul,

        The session templates define the bars that will be used. Unfortunately it does not define a subset of bars that is trade-able. For that, you will need to employ a time filter like something outlined here: http://www.ninjatrader-support2.com/...ead.php?t=3226
        Yes, this is pretty basic and allows me to test against the Time[n] bar value using some kind of time value. My problem is not how to test for valid time, its about being able to utilise the session manager templates such that I can create a complex session profile then test if the bar time is in an active or passive time then I can act accordingly.
        What is available for the Session Manager are things like accessing the next begin/end time. Please see here: http://ninjatrader.com/support/helpG...ml?session.htm Unfortunately there is no override method at this point in time. Thank you for the suggestion.
        At present your use case only provides the ability to filter all historical bars when you select a particular session template. This is a very limited use for a powerful aspect of Ninja.

        What I'd like to do is create a template using the ninja session manager then from my strategy get access to the collection of session times durations then simply query it to determine if the Time[n] bar value is in a trade-able session time.

        So my question is, "Is there a way to get access to the session manager from within a derived strategy or indicator (for that matter)?"

        And in addition if not, "Can Ninja make these access ors available for use from the strategy or indicator layer so we can do our own session filtering?"

        Comment


          #5
          Hi Paul,

          here some code to retrieve session templates from the db. I never pursued further though: Should work from within a Strategy!

          For you in Australia I can understand your interest in SessionTemplate as you have probably some grief caused by them. Also in Europe I have "strange crashes" when running NT outside trading hours. (To NT support: Unfortunately I cannot yet present a reproducible scenario )


          Greeting from the other side of the world,
          Andreas, www.zweisteintrading.eu

          rv.Add("<Use instrument settings>");
          List<string> templates = new List<string>();
          try
          {
          Wilson.ORMapper.ObjectSpace objspace = NinjaTrader.Db.Globals.Engine;
          Wilson.ORMapper.ObjectReader cursor = objspace.GetObjectReader(typeof(Session),String.Em pty);
          while (cursor.Read())
          {
          Session A= (Session) cursor.Current();
          if (!templates.Contains(A.TemplateName)) templates.Add(A.TemplateName);
          }
          cursor.Close();

          }
          catch(Exception e) {
          }
          templates.Sort();
          foreach (string t in templates)
          {
          rv.Add(t);
          }
          return rv.ToArray();
          }
          Last edited by zweistein; 04-19-2010, 09:56 PM.

          Comment


            #6
            Hi,

            We do not support accessing the session templates beyond what was shown in the original help guide article. What is supported is to use a session template for your overall bars you want to load and then using time filters to create your trading session checks. You can use ToTime() and ToDay() to check the Time[0]s and also check the DayOfWeek. Essentially you can program up your own "tradeable" hours versus your loaded historical bars. Unfortunately to do this with multiple session templates is not supported.
            Josh P.NinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by Geovanny Suaza, 02-11-2026, 06:32 PM
            0 responses
            602 views
            0 likes
            Last Post Geovanny Suaza  
            Started by Geovanny Suaza, 02-11-2026, 05:51 PM
            0 responses
            347 views
            1 like
            Last Post Geovanny Suaza  
            Started by Mindset, 02-09-2026, 11:44 AM
            0 responses
            103 views
            0 likes
            Last Post Mindset
            by Mindset
             
            Started by Geovanny Suaza, 02-02-2026, 12:30 PM
            0 responses
            560 views
            1 like
            Last Post Geovanny Suaza  
            Started by RFrosty, 01-28-2026, 06:49 PM
            0 responses
            559 views
            1 like
            Last Post RFrosty
            by RFrosty
             
            Working...
            X