Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Exit on close

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

    Exit on close

    Hey guys,

    I'm making a daily strategy that is supposed to exit on the close of trade for the day, I have ExitOnClose = true in my Initialize() method but it doesn't seem to be doing it, does ExitOnClose only work on intra-day strategies?

    How would I exit on the close on a daily strategy/chart?

    Thanks!

    #2
    Hello Jumper,

    Thank you for your post.

    You would not be able to use ExitOnClose for daily data as it would not be able to determine the end of the session this way through the data.
    You would need to use an intraday bar for this to work.
    Cal H.NinjaTrader Customer Service

    Comment


      #3
      Okay, so using intra-day data, how can I exit on the close of the next bar? Can't seem to use Close[0] like so, as it can't convert to a bool.

      if (Close[0])
      {
      ExitLong();
      }
      Last edited by Jumper; 08-23-2014, 10:40 PM.

      Comment


        #4
        Hello Jumper,

        Thank you for your response.

        So you want the entry on the same bar as the close, correct? Meaning you are entering on a daily bar and want to close when that bar closes? Are you connecting to an EOD (End Of Day) only data feed, such as Kinetick EOD?

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by CarlTrading, 03-31-2026, 09:41 PM
        1 response
        81 views
        1 like
        Last Post NinjaTrader_ChelseaB  
        Started by CarlTrading, 04-01-2026, 02:41 AM
        0 responses
        41 views
        0 likes
        Last Post CarlTrading  
        Started by CaptainJack, 03-31-2026, 11:44 PM
        0 responses
        64 views
        2 likes
        Last Post CaptainJack  
        Started by CarlTrading, 03-30-2026, 11:51 AM
        0 responses
        66 views
        0 likes
        Last Post CarlTrading  
        Started by CarlTrading, 03-30-2026, 11:48 AM
        0 responses
        54 views
        0 likes
        Last Post CarlTrading  
        Working...
        X