Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Entry at open

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

    #16
    tjendra,

    Then you will need to use TraceOrders = true and watch the output when a new session starts. It will tell you when orders are placed. Please refer to the earlier post about TraceOrders tip. That will be the way to proceed to figure out the origins of the order.
    Josh P.NinjaTrader Customer Service

    Comment


      #17
      Originally posted by NinjaTrader_Josh View Post
      tjendra,

      Then you will need to use TraceOrders = true and watch the output when a new session starts. It will tell you when orders are placed. Please refer to the earlier post about TraceOrders tip. That will be the way to proceed to figure out the origins of the order.
      Doesn't the Log Tab gives you that data too which I showed in the pic on post #11? Also, since it was a live order, obviously I can tell whether it was placed at the market open or not by just looking at my brokerage account then.

      Not sure how watching the output when a new session starts helps, since I wouldn't know when a similar trade might trigger at market open isn't it? And the funny thing is, it shouldn't even trigger at all given I did all those things you said. How do I monitor something that shouldn't happen?

      Comment


        #18
        tjendra, as indicated you would either need to work with TraceOrders output in realtime to see where the PlaceOrder command came from (signal name) and it would also be good to recheck the strategy logic to recheck how the trade on the open may have been generated, for this working with Print() statements is helpful - http://www.ninjatrader-support2.com/...ead.php?t=3418

        Comment


          #19
          Originally posted by NinjaTrader_Bertrand View Post
          tjendra, as indicated you would either need to work with TraceOrders output in realtime to see where the PlaceOrder command came from (signal name) and it would also be good to recheck the strategy logic to recheck how the trade on the open may have been generated, for this working with Print() statements is helpful - http://www.ninjatrader-support2.com/...ead.php?t=3418
          Would the trace files in the NinjaTrader folder provide these information?

          Anyway, regardless of the logic of my strategy, given that I have set ExitOnClose = true, stop the strategy and restart NT so that it will start up in a fresh new state, set CalculateOnBarClose = true, set session time as 9:30am to 4pm EST and set "Exit on close seconds" to 30, the entry on market open shouldn't be happening right?

          Comment


            #20
            tjendra,

            We do not know how your strategy is programmed and cannot advise you until we get the TraceOrders readout to determine what exactly we are facing. The readout will be shown in the Output Window. Please ensure you have the Tools->Output Window open as you wait for the traces to print.

            The file you refer to may not necessarily contain the pertinent information.
            Josh P.NinjaTrader Customer Service

            Comment


              #21
              Originally posted by NinjaTrader_Josh View Post
              tjendra,

              We do not know how your strategy is programmed and cannot advise you until we get the TraceOrders readout to determine what exactly we are facing. The readout will be shown in the Output Window. Please ensure you have the Tools->Output Window open as you wait for the traces to print.

              The file you refer to may not necessarily contain the pertinent information.
              Josh, would the below code solve the problem without affecting the strategy since it would be the same as calculate on bar close on the first bar? I use a 5 min chart on 9:30am to 4:00pm EST.

              if (ToTime(Time[0]) <= 93500)
              return;

              Comment


                #22
                tjendra,

                We don't know the situation you are facing so cannot advise you.

                Using that line just means you will not process any strategy logic if the timestamp of your bar is less than or equal to 9:35AM.
                Josh P.NinjaTrader Customer Service

                Comment


                  #23
                  Originally posted by NinjaTrader_Josh View Post
                  tjendra,

                  We don't know the situation you are facing so cannot advise you.

                  Using that line just means you will not process any strategy logic if the timestamp of your bar is less than or equal to 9:35AM.
                  If I just want to make sure it doesn't do anything until the first 5 min bar is over?

                  Comment


                    #24
                    Provided you have no open working orders already that will prevent your strategy from doing anything in the first 5 minutes.
                    Josh P.NinjaTrader Customer Service

                    Comment


                      #25
                      Originally posted by NinjaTrader_Josh View Post
                      Provided you have no open working orders already that will prevent your strategy from doing anything in the first 5 minutes.
                      Josh, just to further verify this. If I use:

                      if (ToTime(Time[0]) <= 93500)

                      Would the strategy evaluate at the end of 9:35am? I am afraid it will not evaluate the strategy at the close of the first bar.

                      In that case, if I change the cut off time to 9:34am, will the first bar be evaluated then?

                      if (ToTime(Time[0]) <= 93400)

                      Comment


                        #26
                        93500 will filter out the first 5 minute bar. The first 5 minute bar is timestamped as 93500 and for sure will be filtered out with an <= operator.

                        In a five minute chart you do not have any bars that are timestamped as 93400. This means your time filter condition doesn't do anything. You might as well not use it if you are on 5 minute bars.
                        Josh P.NinjaTrader Customer Service

                        Comment


                          #27
                          Originally posted by NinjaTrader_Josh View Post
                          93500 will filter out the first 5 minute bar. The first 5 minute bar is timestamped as 93500 and for sure will be filtered out with an <= operator.

                          In a five minute chart you do not have any bars that are timestamped as 93400. This means your time filter condition doesn't do anything. You might as well not use it if you are on 5 minute bars.
                          In that case, if I change it to:

                          if (ToTime(Time[0]) < 93500)

                          That should evaluate the first bar then?

                          Comment


                            #28
                            tjendra,

                            Consider the logic. On 5 min charts, the first bar of the chart is timestamped as 93500. There would be no bars timestamped earlier than that unless you are charting pre-market information. If you are not charting pre-market information using such a line doesn't do anything. There is no information being filtered.
                            Josh P.NinjaTrader Customer Service

                            Comment


                              #29
                              Originally posted by NinjaTrader_Josh View Post
                              tjendra,

                              Consider the logic. On 5 min charts, the first bar of the chart is timestamped as 93500. There would be no bars timestamped earlier than that unless you are charting pre-market information. If you are not charting pre-market information using such a line doesn't do anything. There is no information being filtered.
                              I also don't get why I keep getting orders entered right at market open. That's why I thought with such a filter, I can make sure it doesn't evaluate any bars prior to 9:35am. Do you think it could be a synchronisation issue with the session time? If my session time is set a few seconds earlier than the actual market open, probably that why my strategy execute earlier than it should? Maybe if I make it a few seconds slower than market open?

                              Comment


                                #30
                                tjendra,

                                No. Those orders are not from what you evaluated at market open. Those are coming from whatever you had left over before. You need to cancel your working orders.

                                Please go back to your code and use TraceOrders = true to see when your order is being submitted. Then all you have to do is not submit that order or cancel that order and it will be gone.
                                Josh P.NinjaTrader Customer Service

                                Comment

                                Latest Posts

                                Collapse

                                Topics Statistics Last Post
                                Started by argusthome, 03-08-2026, 10:06 AM
                                0 responses
                                111 views
                                0 likes
                                Last Post argusthome  
                                Started by NabilKhattabi, 03-06-2026, 11:18 AM
                                0 responses
                                59 views
                                0 likes
                                Last Post NabilKhattabi  
                                Started by Deep42, 03-06-2026, 12:28 AM
                                0 responses
                                38 views
                                0 likes
                                Last Post Deep42
                                by Deep42
                                 
                                Started by TheRealMorford, 03-05-2026, 06:15 PM
                                0 responses
                                41 views
                                0 likes
                                Last Post TheRealMorford  
                                Started by Mindset, 02-28-2026, 06:16 AM
                                0 responses
                                78 views
                                0 likes
                                Last Post Mindset
                                by Mindset
                                 
                                Working...
                                X