Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

How to get current end of session time?

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

    How to get current end of session time?

    I want to stop making new trades 1 hour before the current session close.
    How do I get that?
    I am also wondering, since I am in Pacific time zone, but I think the CME is in Chicago time zone, is this going to make any difference for NT 7 to correctly tell me the current time? Is it going to tell me the end of session time for my time zone?

    #2
    zehua,

    Times are always related directly to your time zone.

    Here is a reference sample on using time filters : http://www.ninjatrader.com/support/f...ead.php?t=3226
    Adam P.NinjaTrader Customer Service

    Comment


      #3
      Originally posted by NinjaTrader_AdamP View Post
      zehua,

      Times are always related directly to your time zone.

      Here is a reference sample on using time filters : http://www.ninjatrader.com/support/f...ead.php?t=3226
      Thanks!
      So in this example, I still don't see how I can figure out how much time is left before the current trading day's end of session, can I?

      Comment


        #4
        zehua,

        You would need to hard code this value into your strategy/indicator. Its possible to do it other ways, however this is the easiest to implement solution I can offer. Perhaps others also have some good suggestions.

        Please let me know if I may assist further.
        Last edited by NinjaTrader_AdamP; 03-21-2012, 08:08 AM.
        Adam P.NinjaTrader Customer Service

        Comment


          #5
          So in this example, I still don't see how I can figure out how much time is left before the current trading day's end of session, can I?
          Read the instruments file.

          Comment


            #6
            Hello,

            I do this:

            DateTime time_end_session;
            time_end_session=Bars.Session.NextEndTime.ToUniver salTime();
            time_end_session=time_end_session.AddSeconds(-("put here the seconds you want to subtract"))
            if(DateTime.Now.ToUniversalTime()>=time_end_session. ToUniversalTime()){
            //Stop Trading
            ;
            }

            GB

            Comment


              #7
              Originally posted by gbulle View Post
              Hello,

              I do this:

              DateTime time_end_session;
              time_end_session=Bars.Session.NextEndTime.ToUniver salTime();
              time_end_session=time_end_session.AddSeconds(-("put here the seconds you want to subtract"))
              if(DateTime.Now.ToUniversalTime()>=time_end_session. ToUniversalTime()){
              //Stop Trading
              ;
              }

              GB
              Thanks a lot! You know more than those NT admins here.

              Comment


                #8
                zehua,

                There's currently unfortunately no support for this, and we are reluctant to give unsupported advice.

                Essentially, anything listed in our help guide is supported unless otherwise stated.
                Last edited by NinjaTrader_AdamP; 03-21-2012, 10:11 AM.
                Adam P.NinjaTrader Customer Service

                Comment


                  #9
                  Originally posted by NinjaTrader_AdamP View Post
                  zehua,

                  There's currently unfortunately no support for this, and we are reluctant to give unsupported advice.

                  Essentially, anything listed in our help guide is supported unless otherwise stated.
                  Whoa....... So Bars.Session.NextEndTime is not going to work?

                  Comment


                    #10
                    Zehua,

                    It probably will work, however unfortunately we simply can't support the use of this method, i.e. if you have more questions about using it we would possibly be unable to answer or unable to help you with debugging, etc. This is why we are reluctant to give unsupported advice as we prefer to be able to help our developers whenever we can.

                    If you are unsure what is or isn't supported you can check our help guide for the method. If its not there it is generally not supported, however sometime some methods may specifically say they are not supported such as advanced programming options.

                    Please let me know if you have any other questions.
                    Last edited by NinjaTrader_AdamP; 03-21-2012, 10:48 AM.
                    Adam P.NinjaTrader Customer Service

                    Comment

                    Latest Posts

                    Collapse

                    Topics Statistics Last Post
                    Started by haas88, 03-21-2024, 02:22 AM
                    19 responses
                    220 views
                    0 likes
                    Last Post NinjaTrader_Jesse  
                    Started by ZeroKuhl, Yesterday, 04:31 PM
                    4 responses
                    29 views
                    0 likes
                    Last Post ZeroKuhl  
                    Started by cupir2, Yesterday, 07:44 PM
                    3 responses
                    21 views
                    0 likes
                    Last Post NinjaTrader_Gaby  
                    Started by reynoldsn, Yesterday, 07:26 PM
                    2 responses
                    16 views
                    0 likes
                    Last Post reynoldsn  
                    Started by MartinT, 05-17-2023, 06:00 AM
                    18 responses
                    175 views
                    0 likes
                    Last Post flybuzz
                    by flybuzz
                     
                    Working...
                    X