Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Not exiting at set time

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

    Not exiting at set time

    Hello NT Support
    I want to stop strategy trading at certian time, say 4:PM. For Entries long/short there is conditon of >= 7am and <= 4pm. Also one condition set has lone condition to exit long and short ==4pm. In optimizer its trading through overnight hours.
    Thanks

    #2
    Hello,

    Are you seeing new entries being placed? Or are these exit orders? What time are they occurring?
    MatthewNinjaTrader Product Management

    Comment


      #3
      Thanks Mathew,
      Here's a screenshot. My strategy has a condition to exit longs/shorts at 4pm. I run the optimizer with the Exit on Close option at 'false'.
      Attached Files

      Comment


        #4
        Hello,

        What is the exact statement you are using to exit? Are you just checking if the time is 4:00PM?

        If you have not yet, please enable the TraceOrders property which will output some additional logging and let us know if perhaps these orders are being ignored:

        MatthewNinjaTrader Product Management

        Comment


          #5
          This strategy was built in Strategy Wizard not Ninjascript. Not quite there yet. Here's a screenshot of my condition for exiting.
          Attached Files

          Comment


            #6
            Hello,

            That should do it - if you check the Executions tab of the backtest results, do ever see any instances of these positions closing at 16:00 hrs?

            Would you mind posting your Set 1 and Set 2 conditions so I may test this here?
            MatthewNinjaTrader Product Management

            Comment


              #7
              Okay, enclosed are shots of conditions and a checking of Executions tab of the Optimizer showed no exits at 4PM (16:00) but if memory serves in playing with the optimizer the exit condition was working sometimes and sometimes not.
              Attached Files

              Comment


                #8
                Here's a screenshot of a piece of my Executions tab from optimizer to make sure I'm looking at right thing in the right way.
                Attached Files

                Comment


                  #9
                  Hello,

                  I believe these are being ignored because there is no association between the entry and exit methods.

                  I'd suggest giving you EnterLong a unique Signal name and ExitLong the same "Front entry signal"

                  For example you can call the EnterLong signal name "Long1" and use this same name in "From Entry signal".
                  MatthewNinjaTrader Product Management

                  Comment


                    #10
                    Ten-four. Will try and see how it works. Thanks.

                    Comment


                      #11
                      Hello NT Support
                      Still have the problem. I tried the solution of giving EnterLong and EnterShort unique signal names Long1 and Short1. In Optimizer it did not work--at all. Still trading through over night hours. In Backtest it worked --mostly but still some slips. Encluded are two shots of charts showing it working and not working in Backtest.
                      Thanks
                      Attached Files

                      Comment


                        #12
                        Hello,

                        Can you please clarify what interval you are backtesting on? In your condition, if there is no 4:00PM bar, the condition will not be true. You might want to add some Visual signals by using DrawDot, etc to be plotted if the condition is actually true.

                        If you get an entry signal on the last bar, it will still be processed and will not be closed by your 4:00PM. If you want to ensure that you are not holidng position overnight, you will need to set ExitOnClose to True.
                        MatthewNinjaTrader Product Management

                        Comment


                          #13
                          Thanks Mathew,
                          The shots are of 15 min chart. Shouldn't that print ==4PM on bar close update? So how to get strategy positions to exit on or slightly before 4 PM for intevals between 2-16 min.? Can you have an exit condition between a time range say Exit between 3:45 and 4PM?

                          Comment


                            #14
                            Hello,

                            Yes, you can check for a time range. Please see the attachment.

                            Would also suggest moving the time for your entry positions to be less than 3:45.
                            Attached Files
                            MatthewNinjaTrader Product Management

                            Comment

                            Latest Posts

                            Collapse

                            Topics Statistics Last Post
                            Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                            0 responses
                            650 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
                            577 views
                            1 like
                            Last Post RFrosty
                            by RFrosty
                             
                            Working...
                            X