Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Enter Order on Close of the Session

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

    Enter Order on Close of the Session

    Hi

    I need to automate an order entry at the close of the session, which ideally would be right the opposite of the "ExitOnClose" instruction.

    I am not finding a solution that effectively triggers the order everyday at the (close - n) seconds.

    I am wondering if you can shed some light on what is the best approach to handle this?

    The code runs in 10 minute bar aggregation and I want the order to be sent in the last few seconds of the session end, exactly in the same way the "ExitOnClose" instruction handles it.

    Thanks

    #2
    Hi zerosum666,

    Unfortunately there is nothing built in to monitor for end of session. It must all be custom coded. You could work with time. If you are working historically, you can refer to bar's time stamp with Time[0]. For real time, the C# property DateTime.Now gets the time for your PC clock. Either of these can be checked for an entry condition.

    Ryan M.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by DannyP96, 05-18-2026, 02:38 PM
    1 response
    25 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 05-11-2026, 05:56 AM
    0 responses
    115 views
    0 likes
    Last Post CarlTrading  
    Started by CarlTrading, 05-10-2026, 08:12 PM
    0 responses
    69 views
    0 likes
    Last Post CarlTrading  
    Started by Hwop38, 05-04-2026, 07:02 PM
    0 responses
    226 views
    0 likes
    Last Post Hwop38
    by Hwop38
     
    Started by CaptainJack, 04-24-2026, 11:07 PM
    0 responses
    411 views
    0 likes
    Last Post CaptainJack  
    Working...
    X