Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

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
    Paul H.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Perr0Grande, Today, 08:16 PM
    0 responses
    2 views
    0 likes
    Last Post Perr0Grande  
    Started by elderan, Today, 08:03 PM
    0 responses
    4 views
    0 likes
    Last Post elderan
    by elderan
     
    Started by algospoke, Today, 06:40 PM
    0 responses
    10 views
    0 likes
    Last Post algospoke  
    Started by maybeimnotrader, Today, 05:46 PM
    0 responses
    11 views
    0 likes
    Last Post maybeimnotrader  
    Started by quantismo, Today, 05:13 PM
    0 responses
    7 views
    0 likes
    Last Post quantismo  
    Working...
    X