Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

ExitOnClose

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

    ExitOnClose

    Is there a way to "exit on close" that is only in terms of the regular session? The situation is this: I have a strategy that can enter in the ETH and I want to always close in the RTH. I first tried to use the "exit on close" property, but that closed my ETH session contract at the start of the RTH as well as at the end of the RTH for contracts opened in the RTH. I realize I'll probably have to code this myself, but I thought I'd ask. Also, if there is an example code snippet that would be great.

    #2
    Hello tradetree,

    ExitOnClose will use the session template defined in the strategy. Unfortunately there is no way to define a different exit on close template than is used for the strategy.

    You can custom code end of session handling, by working with time objects. A sample trading filter is available here:


    You can use that to help you restrict trading during specific hours, and add to it exit statements to flatten your position.
    Ryan M.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by argusthome, Yesterday, 10:06 AM
    0 responses
    18 views
    0 likes
    Last Post argusthome  
    Started by NabilKhattabi, 03-06-2026, 11:18 AM
    0 responses
    17 views
    0 likes
    Last Post NabilKhattabi  
    Started by Deep42, 03-06-2026, 12:28 AM
    0 responses
    14 views
    0 likes
    Last Post Deep42
    by Deep42
     
    Started by TheRealMorford, 03-05-2026, 06:15 PM
    0 responses
    9 views
    0 likes
    Last Post TheRealMorford  
    Started by Mindset, 02-28-2026, 06:16 AM
    0 responses
    38 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Working...
    X