Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

exit on close missing in backTest

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

    exit on close missing in backTest

    Hello,

    as you can see in the attached pic exit on close is not shown in Historical, BackTest mode, while in real time trading exit on Close was working as it should (no pic attached, but worked well).

    Is this normal that exit on close is missing in backtest in case you are running strategy just after market closing and before midnight or next day market opening ?

    If I run the backtest not till today but till some days before exit on close works well too.

    Found something similar ?

    best regards
    Kittyan
    Attached Files

    #2
    Hi Kittyan,

    If there are any open positions in a backtest, they're automatically closed at the last bar. This is when using the strategy analyzer feature to backtest and applies if you are using ExitOnClose or not - any open positions are closed.

    This handling isn't available with a standard chart historically. For the most recent session: You won't see the exit on close handling until there has been one bar for the next session.
    Last edited by NinjaTrader_RyanM1; 07-06-2011, 03:59 PM.
    Ryan M.NinjaTrader Customer Service

    Comment


      #3
      Thanks,

      Now it is 3:14 AM and the Exit on close works well on historical chart even though no new session has yet begun, but we are over midnight.

      This is rather strange, it would be best if exit on close would work on chart historically as it works real time or as you said it works in strategy analyzer.

      best regards
      Kittyan

      Comment


        #4
        Hello,

        What are you using for your exit on close settings when you start the strategy?

        I look forward to assisting you further.

        Comment


          #5
          Finally from the screenshot itself its unclear that you were in a position that needed to be closed. Can you clarify on this?

          Comment


            #6
            Hello,

            it is

            exit on close = true
            exit on close seconds = 30
            one stake


            In real time I was in position from B0 enrty signal, at the end of the frist Bar of the session and exit on close worked OK just 30 sec before market closing at 15:14:30. In real time IT IS WORKING (as it did always for me in real time)

            After market closed( for example at 15: 30 ) I run the strategy once again and no Exit On Close appeared at the end of the day ( you can see on the attached pic).

            After midnight I run the strategy once again ( for example at 03:15 AM ) and the Exit On Close appeared.

            So after market closing before midnight on chart histroical exit on close works not in my practise.

            Kittyan

            Comment


              #7
              Hello,

              I just did some testing on this.

              This is working as it runs in the back test. Exit on Close does work different live as it will exit per the time specified. # of seconds before hand or whatever you set for exit before seconds to is when it will exit.

              However when run in historical NinjaTrader does not have access to this only the OHLC of the bars. Therefor just like you would on backtest ExitOnClose will occur when the next bar starts of the new session to trigger the ExitOnClose handling. Therefor if you have some time between where the next session start for example a lot of templates have 30 minutes after them where there is no session in play this would be expected. However once the next session starts and a new bar is running the logic will run and place the ExitOnClose order on.

              Let me know if I can be of further assistance.

              Comment


                #8
                Hello,

                if I put exit on close seconds = 0 in backtest mode, this is going to show the exit ?

                Well if yes, it wont help me, becaues in this case it wont leave the market next day in real time just at the very closing hence once again exit on close is needed.

                I think I will have to rerun the strategy next day before opening to check if session begin will be ok in case exit on close was used and I made a rerun after market closed.

                No best solution as far as I see.

                Kittyan

                Comment


                  #9
                  Hello,

                  There should be no need to rerun to check it. The next session open it should process the event before other events. If your saying your not seeing that please let me know and I would want to look into further then.

                  Comment

                  Latest Posts

                  Collapse

                  Topics Statistics Last Post
                  Started by andrewtrades, Today, 04:57 PM
                  1 response
                  5 views
                  0 likes
                  Last Post NinjaTrader_Manfred  
                  Started by chbruno, Today, 04:10 PM
                  0 responses
                  4 views
                  0 likes
                  Last Post chbruno
                  by chbruno
                   
                  Started by josh18955, 03-25-2023, 11:16 AM
                  6 responses
                  436 views
                  0 likes
                  Last Post Delerium  
                  Started by FAQtrader, Today, 03:35 PM
                  0 responses
                  7 views
                  0 likes
                  Last Post FAQtrader  
                  Started by rocketman7, Today, 09:41 AM
                  5 responses
                  19 views
                  0 likes
                  Last Post NinjaTrader_Jesse  
                  Working...
                  X