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 Mindset, 04-21-2026, 06:46 AM
      0 responses
      90 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by M4ndoo, 04-20-2026, 05:21 PM
      0 responses
      137 views
      0 likes
      Last Post M4ndoo
      by M4ndoo
       
      Started by M4ndoo, 04-19-2026, 05:54 PM
      0 responses
      68 views
      0 likes
      Last Post M4ndoo
      by M4ndoo
       
      Started by cmoran13, 04-16-2026, 01:02 PM
      0 responses
      120 views
      0 likes
      Last Post cmoran13  
      Started by PaulMohn, 04-10-2026, 11:11 AM
      0 responses
      71 views
      0 likes
      Last Post PaulMohn  
      Working...
      X