Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

How to handle entry order on the last bar of the day?Historical/Realtime?

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

    How to handle entry order on the last bar of the day?Historical/Realtime?

    Hi,
    The "issue" below is not really an issue, I am just not sure how to handle it, due to real-time/historical change in logic. I need some of your help.

    When a strategy enters into a trade (for example: enter long) in the last bar of the trading session, there is an "issue" the following day, when I disable and enable the strategy.
    The issue is that I close the ninjatrader, there is a night time, then I open the ninjatrader in the morning, then I enable the strategy before the market opens.
    But the strategy is sending another "enter long" order, the moment I enable the strategy.

    It is not clear what happens when I enable the strategy before the market session. Is it historical? realtime? how does the transition happen? on the first tick?

    My strategy logic was supposed to assume that when I enable the strategy, the last bar of the previous day will be calculated as historical (enter the trade historically),
    and when the next bar open (at market open), it will transition into real-time logic and then will continue the strategy.

    From my prints, it shows that when I enable the strategy, the enterlong command comes from historical logic. But if it comes from historical logic, why it sends to the trading platform a real buy order?

    Looking forward to your help,
    Thank you!

    #2
    Hello zoharcho,

    The order may be automatically cancelled and resubmitted, depending on the Start behavior and whether that order was matched.

    Below is a link to a forum post on resuming a strategy after disabling and re-enabling.


    When enabling a strategy at any time, any data loaded before the current moment is now historical data.

    Orders are submitted in real-time when using Immediately Submit and there is no order matching a live historical order.

    From the help guide:
    "Any remaining active strategy orders that cannot be successfully paired will be submitted live and the strategy will begin managing your Strategy Position assuming your Account Position is in sync with it."
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Thank you, I will go over it, understand it better.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by NullPointStrategies, Yesterday, 05:17 AM
      0 responses
      55 views
      0 likes
      Last Post NullPointStrategies  
      Started by argusthome, 03-08-2026, 10:06 AM
      0 responses
      132 views
      0 likes
      Last Post argusthome  
      Started by NabilKhattabi, 03-06-2026, 11:18 AM
      0 responses
      73 views
      0 likes
      Last Post NabilKhattabi  
      Started by Deep42, 03-06-2026, 12:28 AM
      0 responses
      45 views
      0 likes
      Last Post Deep42
      by Deep42
       
      Started by TheRealMorford, 03-05-2026, 06:15 PM
      0 responses
      49 views
      0 likes
      Last Post TheRealMorford  
      Working...
      X