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

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 AaronKoRn, Today, 09:49 PM
        0 responses
        6 views
        0 likes
        Last Post AaronKoRn  
        Started by carnitron, Today, 08:42 PM
        0 responses
        9 views
        0 likes
        Last Post carnitron  
        Started by strategist007, Today, 07:51 PM
        0 responses
        10 views
        0 likes
        Last Post strategist007  
        Started by StockTrader88, 03-06-2021, 08:58 AM
        44 responses
        3,977 views
        3 likes
        Last Post jhudas88  
        Started by rbeckmann05, Today, 06:48 PM
        0 responses
        9 views
        0 likes
        Last Post rbeckmann05  
        Working...
        X