Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Entry at open

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

    Entry at open

    Hi, when I was running live trading, I was getting some entry on market open. It seems like the order was pending from yesterday close and it execute on market open. If I shut off the strategy, and load up the strategy before market open, would the strategy still hold this pending order?

    The other weird thing is I close the strategy and restart it again during the middle of a trading session, and it doesn't show the entry at open anymore, which means the entry was incorrect to begin with.

    Also, I have CalculateOnBarClose = true set. So should it wait for the opening bar to finish calculating before entry? If so, how can it enter on the open?
    Last edited by tjendra; 04-30-2009, 09:09 AM.

    #2
    If you shutdown NinjaTrader and restart you will see different results. Rerunning calculations historically will not necessarily be the same as if it were evaluated in real-time. http://www.ninjatrader-support.com/H...TimeVsBacktest

    If you shutdown Ninja you may or may not get that market open order depending on the order type you submitted and if you had "immediately submit" selected in Tools->Options->Strategies->NinjaScript.
    Josh P.NinjaTrader Customer Service

    Comment


      #3
      Originally posted by NinjaTrader_Josh View Post
      If you shutdown NinjaTrader and restart you will see different results. Rerunning calculations historically will not necessarily be the same as if it were evaluated in real-time. http://www.ninjatrader-support.com/H...TimeVsBacktest

      If you shutdown Ninja you may or may not get that market open order depending on the order type you submitted and if you had "immediately submit" selected in Tools->Options->Strategies->NinjaScript.
      What about this 2 queries then?

      1. Is it possible that the order was pending from yesterday close and it execute on market open. If I shut off the strategy, and load up the strategy before market open, should the strategy still be holding this pending order?

      2. Also, I have CalculateOnBarClose = true set. So should it wait for the opening bar to finish calculating before entry? If so, how can it enter on the open?

      Comment


        #4
        1. The last sentence in my previous response. There is no mapping back to prior states. Leave NT running.

        2. See same sentence earlier. If the order was already placed on the prior bar and active it will fill on the open of the next bar. If the order was only placed on the opening bar then it will fill on the following bar.
        Josh P.NinjaTrader Customer Service

        Comment


          #5
          Originally posted by NinjaTrader_Josh View Post
          1. The last sentence in my previous response. There is no mapping back to prior states. Leave NT running.

          2. See same sentence earlier. If the order was already placed on the prior bar and active it will fill on the open of the next bar. If the order was only placed on the opening bar then it will fill on the following bar.
          So if I choose "Wait until Flat" selected in Tools->Options->Strategies->NinjaScript, then that entry on open wouldn't occur?

          Also, I had "Cancel strategy orders on strategy termination" checked. Shouldn't that cancel any pending orders when I shutdown NT?

          Comment


            #6
            tjendra,

            WaitUntilFlat means no trades will be made till the strategy is in a flat state.

            Cancel orders will cancel all orders on strategy stop.

            If you want that order at market do not shutdown the strategy. If you stop your strategy it will start up in a fresh new state. It will NOT know of anything it did beforehand.
            Josh P.NinjaTrader Customer Service

            Comment


              #7
              Originally posted by NinjaTrader_Josh View Post
              tjendra,

              WaitUntilFlat means no trades will be made till the strategy is in a flat state.

              Cancel orders will cancel all orders on strategy stop.

              If you want that order at market do not shutdown the strategy. If you stop your strategy it will start up in a fresh new state. It will NOT know of anything it did beforehand.
              I did not want that order. In fact I am confused why that order was entered, that's why this query in the first place. Coz I stop the strategy so that it will start up in a fresh new state like you said. And I got CalculateOnBarClose = true set, so why did it enter on market open? Shouldn't it at least wait until the first bar of the market open closes?

              Comment


                #8
                tjendra, did you check the TraceOrders output where it originated from?

                Comment


                  #9
                  Originally posted by NinjaTrader_Bertrand View Post
                  tjendra, did you check the TraceOrders output where it originated from?
                  Where do I check this TraceOrder output?
                  And what do you mean by "Where it originated from?"

                  Comment


                    #10
                    tjendra,

                    When you start your strategy again it goes through all the historical data and calculates out everything one more time. If you want to start fresh on a new day I suggest you run your strategies with ExitOnClose = true so even if you stop your strategy, as it calculates it historically it will know that at the end of the session everything should be flat.

                    See this tip for how to use TraceOrders: http://www.ninjatrader-support2.com/...ead.php?t=3627
                    Output will show up in the Output Window.
                    Josh P.NinjaTrader Customer Service

                    Comment


                      #11
                      Originally posted by NinjaTrader_Josh View Post
                      tjendra,

                      When you start your strategy again it goes through all the historical data and calculates out everything one more time. If you want to start fresh on a new day I suggest you run your strategies with ExitOnClose = true so even if you stop your strategy, as it calculates it historically it will know that at the end of the session everything should be flat.

                      See this tip for how to use TraceOrders: http://www.ninjatrader-support2.com/...ead.php?t=3627
                      Output will show up in the Output Window.
                      I did have ExitOnClose = true set as well.

                      Given that I have ExitOnClose = true set, stop the strategy so that it will start up in a fresh new state and CalculateOnBarClose = true set, the entry on market open shouldn't have happened right?

                      I can't trace back using the traceorder since it was a live order, but from the log tab (attach pic), you can see that there was entry on market open (9:30:06 AM) on the IYR.
                      Attached Files

                      Comment


                        #12
                        tjendra,

                        That is correct provided you have proper session ends set up. ExitOnClose goes off of chart session end times. You need to ensure you have a proper session end time for it to cancel your orders. You will also want to be using Day for your Time in force settings.
                        Josh P.NinjaTrader Customer Service

                        Comment


                          #13
                          Originally posted by NinjaTrader_Josh View Post
                          tjendra,

                          That is correct provided you have proper session ends set up. ExitOnClose goes off of chart session end times. You need to ensure you have a proper session end time for it to cancel your orders. You will also want to be using Day for your Time in force settings.
                          I have the session set up as 9:30am to 4pm EST, that should be correct right? I also had "Exit on close seconds" set to 30, and on my chart it showed it exited at close too. So there shouldn't be any pending orders.

                          Beside I did the 3 things mentioned previously as well. So there shouldnt be any chance of a strategy entering at market open isn't it?

                          I'm just wondering if it is a bug, as it is actually the 3rd time that this happened to me during live trading.

                          Comment


                            #14
                            tjendra,

                            I am not following you. In the beginning you clearly said the order was not placed if you stopped the strategy and started anew. Is this not the behavior you are looking for and the behavior you are getting?
                            Josh P.NinjaTrader Customer Service

                            Comment


                              #15
                              Originally posted by NinjaTrader_Josh View Post
                              tjendra,

                              I am not following you. In the beginning you clearly said the order was not placed if you stopped the strategy and started anew. Is this not the behavior you are looking for and the behavior you are getting?
                              Josh, I am trying to figure out why a market open order was entered by my strategy when it shouldn't be entered at all given I did all the things you previously mentioned correctly.

                              In the beginning, I clearly said "when I was running live trading, I was getting some entry on market open" in post #1. This entry was not suppose to happen.

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by argusthome, 03-08-2026, 10:06 AM
                              0 responses
                              116 views
                              0 likes
                              Last Post argusthome  
                              Started by NabilKhattabi, 03-06-2026, 11:18 AM
                              0 responses
                              61 views
                              0 likes
                              Last Post NabilKhattabi  
                              Started by Deep42, 03-06-2026, 12:28 AM
                              0 responses
                              40 views
                              0 likes
                              Last Post Deep42
                              by Deep42
                               
                              Started by TheRealMorford, 03-05-2026, 06:15 PM
                              0 responses
                              44 views
                              0 likes
                              Last Post TheRealMorford  
                              Started by Mindset, 02-28-2026, 06:16 AM
                              0 responses
                              82 views
                              0 likes
                              Last Post Mindset
                              by Mindset
                               
                              Working...
                              X