Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Close order next day at specific time

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

    Close order next day at specific time

    Hi,

    Been trying to figure out how to close a filled order the next day at a specific time.

    Any ideas?

    Cheers

    #2
    Hello,

    You could do it this way:


    if(ToDay(Time[0]) != my_date && ToTime(Time[0]) == 100000)
    {
    ExitLong();
    my_date = ToDay(Time[0]);
    }

    if( ...your order criteria here....)
    {
    EnterLong();
    my_date = ToDay(Time[0]);
    }
    DenNinjaTrader Customer Service

    Comment


      #3
      Thanks.

      Is there a way to make this resiliant?

      by that i mean if NT crashes and i restart the strategy, it'll detect the trades associated with this strategy and continue to manage them accordingly.

      Comment


        #4
        Hello,


        When you restart NT the strategy automatically tries to figure out what your strategy position should be. You should sync up your strategy position and account position. This link will help with this:
        DenNinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        574 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        332 views
        1 like
        Last Post Geovanny Suaza  
        Started by Mindset, 02-09-2026, 11:44 AM
        0 responses
        101 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by Geovanny Suaza, 02-02-2026, 12:30 PM
        0 responses
        553 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        551 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X