Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Overnight

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

    Overnight

    Hi,

    I have a problem with overnight positions. Actually I created constrain for that problem like "to time > 3pm & to time < 10pm". But I still got overnight positions.

    #2
    Could you kindly elaborate on what your issue is? I am afraid I don't see a clear question in your post. Thanks.
    RayNinjaTrader Customer Service

    Comment


      #3
      What can I do to avoid "overnight positions" in an automated strategy? I want to close all positions at the end of the day, every day.
      Last edited by Jesse; 12-20-2008, 12:20 PM.

      Comment


        #4
        Hi Jesse,



        I recommend closing out your trades manually as this would likely be the most efficient way to ensure you do not leave overnight positions.
        MichaelNinjaTrader Customer Service

        Comment


          #5
          Hi,

          our problem is, that we want to close our positions in a stock future before the stock market is actually closing. For example, we want to close all our positions in a YM-Future, before the NYSE is closing - 4p.m.

          Therefore we added the following condition to our strategies:

          Code:
                      if (ToTime(Time[0]) >= ToTime(21, 45, 0))
                      {
                          ExitLong("", "");
                          ExitShort("", "");
                      }
          Since we are UTC/GMT+1 (Berlin, Central European Time), this should be 3:45 p.m. EST. So, this condition should be true when it is 3:45 p.m. EST or later and therefore prevent overnight positions, but it doesn't. Why?

          Or ist there another automated way, to flatten all positions at a specific time?

          Comment


            #6
            Hi GerTrader,
            You could use ExitOnClose and set the ExitOnCloseSeconds to match your desired exit time -> http://www.ninjatrader-support.com/H...itOnClose.html

            NinjaTrader will use your set local time zone, maybe you want to check into this to make sure your code gets executed properly.
            BertrandNinjaTrader Customer Service

            Comment


              #7
              Yes, we know that NinjaTrader uses local time and therefore we used 21:45 for example, when we want the strategy to close all positions 3:45 p.m. EST.

              But when we use for example the S&P 500 Future ES, Close is 3:15 p.m. CST (http://www.cme.com/clearing/clr/spec...tml?product=ES) respectively 4:15 p.m. EST. This means when we want to close our positions at 3:45 p.m. EST, we should set ExitOnClose = true; and ExitOnCloseSeconds = 1800; !?

              But i'm wondering, why the condition set we used is not working !? Also, it does work while backtesting.

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by FrazMann, Today, 11:21 AM
              2 responses
              6 views
              0 likes
              Last Post NinjaTrader_ChristopherJ  
              Started by rjbtrade1, 11-30-2023, 04:38 PM
              2 responses
              80 views
              0 likes
              Last Post DavidHP
              by DavidHP
               
              Started by Spiderbird, Today, 12:15 PM
              1 response
              7 views
              0 likes
              Last Post NinjaTrader_ChristopherJ  
              Started by lorem, Yesterday, 09:18 AM
              5 responses
              18 views
              0 likes
              Last Post NinjaTrader_ChelseaB  
              Started by cmtjoancolmenero, Yesterday, 03:58 PM
              12 responses
              42 views
              0 likes
              Last Post NinjaTrader_ChelseaB  
              Working...
              X