Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Exit On Close

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

    Exit On Close

    I have a problem with a trade entering after the exit on close but before the session end. Is there a quick way to tell if within the exitoncloseseconds window for the current session, or if not, is there a quick way to detect how far I am from the end of the session.

    (or should I override exitonclose, call the base one, set a flag and reset it start of next session?)

    thanks
    Dave

    #2
    Hello Dave,

    Unfortunately I am not sure if I completely follow. When 'Exit on close' is enabled in your strategy, all open positions will be closed on the last bar of the session.

    Are you referring to NinjaScript - a way to display the remaining time using custom coding?


    Unfortunately there is no default option that will display the remaining time.
    JasonNinjaTrader Customer Service

    Comment


      #3
      Thanks Jason,

      Yes, I understand exactly what exit on close does. AFTER it has fired however, my strategy enters a trade which does not get closed on session close, presumably because exit on close does not fire again right at the end, which is expected since I have exitoncloseseconds set to 600. I need to know somehow to stop that trade from entering.

      Comment


        #4
        dave1992,

        ExitOnClose does not prevent you from re-entering your position again. You should program a time filter into your strategy that effective says "no more trading" at the same time your ExitOnClose triggers. For an example of setting up a time filter, please see here: http://www.ninjatrader.com/support/f...ead.php?t=3226
        Josh P.NinjaTrader Customer Service

        Comment


          #5
          Josh,

          I understand all that. Exit on Close and the seconds variable are useful because they are related to a session, which may change. Time filters do not.

          Looking back at the questions in my OP, can you override exitonclose? Is there any way of obtaining the session end time?

          thanks
          Dave

          Comment


            #6
            Hi Dave, you could program your own ExitOnClose handling and grab the applied template begin / end time with this - http://www.ninjatrader.com/support/h...xtbeginend.htm
            BertrandNinjaTrader Customer Service

            Comment


              #7
              Thanks, that's exactly what I need. I just call that and subtract the seconds from the session end time.

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by 1001111, Today, 01:35 AM
              0 responses
              5 views
              0 likes
              Last Post 1001111
              by 1001111
               
              Started by ETFVoyageur, Yesterday, 07:05 PM
              1 response
              16 views
              0 likes
              Last Post ETFVoyageur  
              Started by MarianApalaghiei, Today, 12:35 AM
              1 response
              8 views
              0 likes
              Last Post MarianApalaghiei  
              Started by Rogers101, 05-05-2024, 11:30 AM
              17 responses
              57 views
              0 likes
              Last Post Rogers101  
              Started by haas88, 03-21-2024, 02:22 AM
              13 responses
              156 views
              0 likes
              Last Post haas88
              by haas88
               
              Working...
              X