Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

exit on close on weekend

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

    exit on close on weekend

    I had two questions regarding Exit on Close. Suppose I want to ES (e-mini) which trade nearly 24 hours.

    1. If I have ExitOnClose = true in my strategy code, would the strategy close at NY time 16:15 EST, and reopen at NY time 16:30 EST when the contract starts trading on Globex, OR does it close at NY time 16:15 EST and reopens at NY time 8:30 EST?

    2. Suppose I want to do ExitOnClose =true only on the weekend, i.e. 16:15 EST on Friday (or Thursday if Friday is a holiday, or Wednesday if both Thursday and Friday are holdidays) and want the strategy to start again at 6:00 pm EST NY on Sunday.

    More specifically, in general, I want to implement ExitOnClose such that it does an ExitOnClose for the weekend - not just for ES, but also for other markets such as CL (Crude) - while also recognizing holiday schedules. How can I implement / code this?

    #2
    Hello uday12,

    Thanks for your post.

    The answer to all of the questions you have asked are depending on the session template in use for the instrument. The session template is what has the hours listed and would be what ExitOnClose uses to know when the end of session time is. Here is the helpguide definition of session template:

    Session Templates
    A Session Template is a collection of session definitions that can be used anywhere NinjaTrader utilizes data. (See the "Where Session Templates can be Applied" sub-section below). When a template is applied, any data outside of the times in the session definitions will be ignored. NinjaTrader comes pre-loaded with the most common Session Templates; however, custom Session Templates can also be created to suit your needs.


    Here is a link to the helpguide on the session manager: http://ninjatrader.com/support/helpG...on_manager.htm

    To be clear, ExitOnClose means that any open position, in that strategy, will be closed at the time specified as the end of session minus the exitonclose seconds. You strategy would continue running and if coded to would place orders when the next session opens (or thereafter).

    Note that in addition to using the session template you can always code time constraints directly with in your code, here is our reference sample for that: http://ninjatrader.com/support/forum...ead.php?t=3226

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Geovanny Suaza, 02-11-2026, 06:32 PM
    0 responses
    633 views
    0 likes
    Last Post Geovanny Suaza  
    Started by Geovanny Suaza, 02-11-2026, 05:51 PM
    0 responses
    364 views
    1 like
    Last Post Geovanny Suaza  
    Started by Mindset, 02-09-2026, 11:44 AM
    0 responses
    105 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by Geovanny Suaza, 02-02-2026, 12:30 PM
    0 responses
    567 views
    1 like
    Last Post Geovanny Suaza  
    Started by RFrosty, 01-28-2026, 06:49 PM
    0 responses
    568 views
    1 like
    Last Post RFrosty
    by RFrosty
     
    Working...
    X