Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Entry at open

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

  • tjendra
    replied
    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)

    Leave a comment:


  • NinjaTrader_JoshP
    replied
    Provided you have no open working orders already that will prevent your strategy from doing anything in the first 5 minutes.

    Leave a comment:


  • tjendra
    replied
    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?

    Leave a comment:


  • NinjaTrader_JoshP
    replied
    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.

    Leave a comment:


  • tjendra
    replied
    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;

    Leave a comment:


  • NinjaTrader_JoshP
    replied
    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.

    Leave a comment:


  • tjendra
    replied
    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?

    Leave a comment:


  • NinjaTrader_Bertrand
    replied
    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

    Leave a comment:


  • tjendra
    replied
    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?

    Leave a comment:


  • NinjaTrader_JoshP
    replied
    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.

    Leave a comment:


  • tjendra
    replied
    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.

    Leave a comment:


  • NinjaTrader_JoshP
    replied
    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?

    Leave a comment:


  • tjendra
    replied
    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.

    Leave a comment:


  • NinjaTrader_JoshP
    replied
    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.

    Leave a comment:


  • tjendra
    replied
    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

    Leave a comment:

Latest Posts

Collapse

Topics Statistics Last Post
Started by Mindset, 04-21-2026, 06:46 AM
0 responses
118 views
0 likes
Last Post Mindset
by Mindset
 
Started by M4ndoo, 04-20-2026, 05:21 PM
0 responses
166 views
0 likes
Last Post M4ndoo
by M4ndoo
 
Started by M4ndoo, 04-19-2026, 05:54 PM
0 responses
85 views
0 likes
Last Post M4ndoo
by M4ndoo
 
Started by cmoran13, 04-16-2026, 01:02 PM
0 responses
130 views
0 likes
Last Post cmoran13  
Started by PaulMohn, 04-10-2026, 11:11 AM
0 responses
89 views
0 likes
Last Post PaulMohn  
Working...
X