• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

ExitOnClose Seconds not working

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

    ExitOnClose Seconds not working

    Hi,

    I'm backtesting an intraday strategy and I would like it to flatten all open positions at a specific time. I am trying to do this by running the strategy with ExitOnClose turned on, and ExitOnClose Seconds set to 6300. The trading session ends at 4:15PM CST and I would like to exit all open positions at 2:30PM CST.

    When I backtest however the strategy exits all open positions at 4:15PM. It doesn't seem to matter what value I put for ExitOnClose Seconds, it always exits at 4:15PM. Why is this happening?

    Is there a better way to handle a timed exit?

    #2
    Hello PhillyD,

    Thank you for your post.

    This would be the correct setting for ExitOnClose, ExitOnCloseSeconds and the proper number for 45 minutes.

    What bar type are you testing the strategy on and what value? Example: 1 Minute

    Can you attach a screenshot of the settings used for your backtest?
    Patrick H.NinjaTrader Customer Service

    Comment


      #3
      Hi Patrick,

      I'm using a 5 minute bar on the ES contract. See attached screenshot for the settings.

      Phil
      Attached Files

      Comment


        #4
        Phil, to clarify : we would expect that since ExitOnCloseSeconds is applicable real-time only, not in backtesting. If you want an earlier exit you could consider coding a custom timecheck for example to the bars time (Time[0]) to decide when to exit timebased.

        http://www.ninjatrader.com/support/h...s/nt7/time.htm
        BertrandNinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by sun0781, Today, 05:02 PM
        0 responses
        6 views
        0 likes
        Last Post sun0781
        by sun0781
         
        Started by ronhb107, 09-12-2019, 10:09 AM
        4 responses
        41 views
        0 likes
        Last Post Mr.Trader  
        Started by rwilliam, Today, 03:55 PM
        0 responses
        3 views
        0 likes
        Last Post rwilliam  
        Started by asmmbillah, Today, 03:42 PM
        2 responses
        8 views
        0 likes
        Last Post asmmbillah  
        Started by NT-Roland, Today, 03:25 PM
        0 responses
        7 views
        0 likes
        Last Post NT-Roland  
        Working...
        X