Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

custom trading hours not respected

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

    custom trading hours not respected

    Hi,
    I copied cme us index futures trading hours template and changed the end times to 3pm (to avoid earnings, etc). Then I named my new template and clicked ok. Unfortunately, when I apply this template to a strategy, the strategy doesn't enter correctly.

    All of my strategies are OnBarClose. Instead of waiting for the first bar to close and process relative logic, the strategies enter instantly at 9:30 EST (or 8:30CT). A strategy set to 15 minute bars should only enter at 9:45 EST (8:45CT), given that the logical parameters are met.
    Any ideas?
    thanks,
    David

    #2
    Hello, thanks for writing in. The start time of CME US Index Futures RTH is 8:30 central time, so the strategy would be able to trade on this bar. You did not change the start time, you only changed the end time. If you want to prevent a trade at this start time the start would also need to be changed.

    Comment


      #3
      Hi Chris,
      My issue is that the RTH strategies are starting before the first bar of the RTH session closes. If a strategy is OnBarclose, why would it enter before the first bar closed?
      thanks,
      David
      Last edited by trader3000a; 02-23-2023, 11:37 AM.

      Comment


        #4
        Hello, thanks for the follow up. The strategy would not trigger any code in OnBarUpdate before the bar closes if the strategy is running OnBarClose. My guess is that your custom time template might have the time ranges set up incorrectly. You can use Print in your strategy to see each time OnBarUpdate is called.

        Comment


          #5
          Hi Chris,
          I'm getting the same problem using NT's standard Trading Hours template "CME US index futures RTH". I set the strategy up in the Strategies tab (not on a chart). I've attached my properties settings. Is anything set in a way that would create the problem? The strategy is set up for 10 minute bars on the RTH session, but this morning it opened a trade instantly at 9:29:59 instead of waiting until at least one 10 minute bar had closed (at 9:40 like i expected) to process logic and decide if conditions were met.
          thanks,
          David
          Attached Files

          Comment


            #6
            Hi, I see nothing wrong with these settings. If your strategy is placing orders that rest on the market like limit or stop orders this could happen. Can you reproduce this using the SampleMaCrossover strategy?

            Comment


              #7
              Hi Chris,
              The strategy is OnBarClose and only enters with EnterLong() or EnterShort() at Close[0]. No passive orders are used. I've attached a code snippet and the execution record.
              This issue doesn't happen in backtest. Only live.
              thanks,
              David
              Attached Files

              Comment


                #8
                Hi, Please use Print() methods in your script to confirm the times that OnBarUpdate is called. This should not happen and I can not reproduce it at all using the SampleMACrossover.

                Comment


                  #9
                  One other thing to check is your system time is synced to internet time, see here for a guide:
                  https://pureinfotech.com/sync-clock-...20now%20button.

                  Comment


                    #10
                    ok, I'll do that

                    Comment

                    Latest Posts

                    Collapse

                    Topics Statistics Last Post
                    Started by NullPointStrategies, Yesterday, 05:17 AM
                    0 responses
                    62 views
                    0 likes
                    Last Post NullPointStrategies  
                    Started by argusthome, 03-08-2026, 10:06 AM
                    0 responses
                    134 views
                    0 likes
                    Last Post argusthome  
                    Started by NabilKhattabi, 03-06-2026, 11:18 AM
                    0 responses
                    75 views
                    0 likes
                    Last Post NabilKhattabi  
                    Started by Deep42, 03-06-2026, 12:28 AM
                    0 responses
                    45 views
                    0 likes
                    Last Post Deep42
                    by Deep42
                     
                    Started by TheRealMorford, 03-05-2026, 06:15 PM
                    0 responses
                    50 views
                    0 likes
                    Last Post TheRealMorford  
                    Working...
                    X