Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Backtest Difference Day and GTC

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

    Backtest Difference Day and GTC

    Hello

    Please i need help to understand the backtest on Day or GTC. Sample MA crossover. I annex two backtest of KHC the same date. 3-10-2019 3;52pm change the exit in Day or GTC, But these exits activates in regular hours, why the difference?

    If the exits of GTC happens before o after hours it is ok, But the exits happens in regular hours.

    Thanks
    Attached Files

    #2
    Hello, thanks for your note.

    I don't see a difference between the exit at 3:52. The entry price for both is 26.48 and the exit price is 26.42.
    Chris L.NinjaTrader Customer Service

    Comment


      #3
      Hello, please the entry to 3:52 it is the same in both prints, but the exits of this trade it is not. I send to you both prints with the same configuration except the TIF. I need understand why this exit is not equal if both active in regular hours.

      Thanks for your help

      Comment


        #4
        Hi, thanks for your reply.

        After some testing, I found that the order to reverse the position is being canceled because it submits a day order at the last bar of the session. The solution would be to either not have the strategy submit a day order on the last bar of the session or enable "Exit on session close" for DAY orders.
        Chris L.NinjaTrader Customer Service

        Comment


          #5
          Hello ChrisL, thanks for your testing

          1- The entry order is active 3:52 in bar the one minute, The last bar will be 3:59 o 4:00, please tell my if i wrong

          2-I not understand why the backtest in GTC show me exits in regular hour and it no same to the backtest of DAY

          I need understand why happens that. I believe the results of GTC only changes if the profit, stop o new order happens before or aftermarket.

          Sorry for my english

          Thanks for your time

          Comment


            #6
            Hi, thanks for your reply.

            1. The end of the bar will happen at 4, and the order will be processed at the first tick of the next bar. With a DAY order the order will be ignored, so the order must take place during the session or at the session close.

            2. The GTC order does not ignore any of the orders because its a GTC and it has no issue executing at the end of a session. DAY orders can not be submitted at the end of the session. You can make a copy of the strategy and add "TraceOrders = true" to see what NinjaTrader prints when this order is attempted.

            "Cancelled order due to end of session handling"

            The solution would be to submit the order before the session ends.
            Chris L.NinjaTrader Customer Service

            Comment


              #7
              Thank for your fast reply, I understand the crossover for the reversal position happen in the bar of 16.00, In that case for what reason no sent the reversal order in the 16:01.

              I question about that not only for this example in specific, I need understand the logic for mi backtest DAY o GTC ,

              Regards

              Comment


                #8
                Hi, thanks for your reply.

                If your strategy is using DAY TIF then you would need to make sure it does not submit a DAY TIF order outside of the session. In this case, the strategy calculated that it should submit the order but by the time it is submitted it's out of session. If you need orders submitted throughout the RTH and ETH session the TIF must be set to GTC.
                Chris L.NinjaTrader Customer Service

                Comment


                  #9
                  Sorry for the insistence, i understand your reply, maybe i not been speciific with the question.

                  In this paritcular case if i run the backtest with the strategy in GTC why reasons when the entry 3:52 bar if the signal of reverse happens in 16:00 bar not sent the reversal order to 16:01 ? the reversal order sent 9:31 of the next day

                  thanks for your patience

                  Comment


                    #10
                    Hi, thanks for your reply.

                    That is happening because the order submission happens on the first tick of the next bar. If you needed intrabar actions to occur, then the strategy will need to run OnEachTick instead of OnBarClose. Try this and it should close the trade on the last bar of the session instead of the next bar.

                    Kind regards.
                    Chris L.NinjaTrader Customer Service

                    Comment


                      #11
                      Hello ChrisL,

                      Thanks for your time, I see in the backtest maybe in GTC, but the hour of trading must be 24/5 for see operations after hour. It is more clear for me.

                      Thanks for help.

                      Comment

                      Latest Posts

                      Collapse

                      Topics Statistics Last Post
                      Started by DayTradingDEMON, Today, 09:28 AM
                      4 responses
                      21 views
                      0 likes
                      Last Post DayTradingDEMON  
                      Started by geddyisodin, Yesterday, 05:20 AM
                      9 responses
                      50 views
                      0 likes
                      Last Post NinjaTrader_Gaby  
                      Started by George21, Today, 10:07 AM
                      1 response
                      12 views
                      0 likes
                      Last Post NinjaTrader_ChristopherJ  
                      Started by Stanfillirenfro, Today, 07:23 AM
                      9 responses
                      24 views
                      0 likes
                      Last Post NinjaTrader_ChelseaB  
                      Started by navyguy06, Today, 09:28 AM
                      1 response
                      9 views
                      0 likes
                      Last Post NinjaTrader_Gaby  
                      Working...
                      X