Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Delay execution

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

    Delay execution

    Issue: When criteria is met on the last bar of the session, the trade is automatically executing at the open of the next session. I use calculate on close=true on my strategy, but when this scenario happens, the trade will execute at the opening tick of the next session. How to avoid? Please advise?

    #2
    dancorcal, have you tried submitting the orders with another TIF setting? If you would like to submit the orders earlier you should work on a finer series so you're able to submit before the actual session end then.
    BertrandNinjaTrader Customer Service

    Comment


      #3
      I don't want the order to submit at all. I would like the strategy to start over at the beginning of the session, not take entries based off conditions from the previous session. This is how the system backtest, but when it runs in real time, it triggers orders based on the previous session's last bar. The TIF setting may be way to go though, but then again even if I use Day instead of GTC, the system apparently doesn't know what day it is when the session starts anyway so they may not work either. Any thoughts?

      Comment


        #4
        dancorcal,

        This all depends on how you program your strategy. By default your strategy takes all of the data and just keeps continuing its calculations across sessions. If you want it to stop and start afresh on each session you would need to program it in a manner that facilitates this.

        Easiest way for this is to prevent any entries on the last bar of the previous session. So let us say the closing time of the last bar of a session is 4PM. Then you could do something like this in OnBarUpdate()

        Code:
        if (ToTime(Time[0]) == 160000)
             return;
        Then when it starts up again at 9:30AM or whatever the next day it would have no trades signals from the prior day's close. If you want a complete clean slate at 9:30AM be sure to reset any variable states you may have like bools or the likes.
        Josh P.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by maybeimnotrader, Yesterday, 05:46 PM
        1 response
        18 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by Perr0Grande, Yesterday, 08:16 PM
        1 response
        7 views
        0 likes
        Last Post NinjaTrader_Jesse  
        Started by f.saeidi, Yesterday, 08:12 AM
        3 responses
        25 views
        0 likes
        Last Post NinjaTrader_Jesse  
        Started by algospoke, Yesterday, 06:40 PM
        1 response
        15 views
        0 likes
        Last Post NinjaTrader_Jesse  
        Started by quantismo, Yesterday, 05:13 PM
        1 response
        14 views
        0 likes
        Last Post NinjaTrader_Gaby  
        Working...
        X