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 CarlTrading, 03-31-2026, 09:41 PM
    1 response
    63 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 04-01-2026, 02:41 AM
    0 responses
    35 views
    0 likes
    Last Post CarlTrading  
    Started by CaptainJack, 03-31-2026, 11:44 PM
    0 responses
    54 views
    1 like
    Last Post CaptainJack  
    Started by CarlTrading, 03-30-2026, 11:51 AM
    0 responses
    61 views
    0 likes
    Last Post CarlTrading  
    Started by CarlTrading, 03-30-2026, 11:48 AM
    0 responses
    48 views
    0 likes
    Last Post CarlTrading  
    Working...
    X