Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Backtest problems/error versus live/replay

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

    Backtest problems/error versus live/replay

    Hello,
    If my indicator is based on a 5 minute chart, and trade on a 30 seconds chart I see this:

    Situation: NT7 RC1: I added a 5 minute chart (barsArray=1) and a 30 seconds chart (barsArray=2)
    entry is triggered based on indicator (based on the 5 minute (barsArray=1))
    entry is executed on the 30 second chart (barsArray=2)
    EnterLong(2,1,"Lname");
    EnterShort(2,1,"Sname");

    Every entry LIVE and REPLAY is 5 minutes later than in backtest.
    In live trading, it makes no difference what the main chartTimePeriode is, in backtest it makes a difference (it should not)!.
    (I checked entry price and they are really different)

    This explains the huge difference in results between backtest and live,
    and makes backtesting useless until this is fixed.

    In another thread I showed another problem related to this, I copy that message here too:
    QUOTE
    Unfortunately, I work this way. But I can prove it to you something is wrong.

    As you can see in the image,

    I add 2 bartypes;
    I enter long/short on barsarray == 1 (based on values of barsarray ==2)
    So, the tradelogic does NOT have anything to do with the main chart.

    In optimize, I ONLY optimize on dataserie, in this case from 1 to 5 minutes,
    and you see the differences.... (period = 6 weeks)
    from 700 to 10.000 profit

    In my view all must be the same.
    None of these results equal by far the replay results.
    END QUOTE
    Attached Files
    Last edited by mart331; 11-17-2010, 07:09 AM.

    #2
    Hello,

    Thanks for your note.

    Please see this guide I believe this is what you are facing, this is how the backtest is specifically designed.



    Let me know if I can be of further assistance.
    BrettNinjaTrader Product Management

    Comment


      #3
      Originally posted by NinjaTrader_Brett View Post
      Hello,

      Thanks for your note.

      Please see this guide I believe this is what you are facing, this is how the backtest is specifically designed.



      Let me know if I can be of further assistance.
      I know, but that doesnot explain,that i see ALL trades to execute 5 minutes later, so the indicator should always?? be 5 minutes wrong??
      I use CalculateOnBarClose=true, so things are being done at the end of each bar.
      So, at the end of the 5min bar the conditions are set. That should be about equal live/backtest.

      So I only can make the conclusion that the algorithm(NT) is wrong,

      Otherwise, please explain in detail what I oversee.
      Thnx

      Comment


        #4
        Mart,

        What occurs is this, based off what you mentioned.

        entry is triggered based on indicator (based on the 5 minute (barsArray=1))
        entry is executed on the 30 second chart (barsArray=2)


        When your entry conditions can only be enabled or disabled every 5 minutes since your running a 5 minute bar as the secondary series. As soon as the secondary series bool turns to true(At the end of the bar always!) to execute a trade it would execute 30 seconds later on the 30 open of the next 30 second bar. Your secondary series will not be COBC=False, it will be COBC=True in backtesting always.

        If you are saying the above is not working as I mention but instead and entry is 10 minutes delayed(Assuming an entry condition would become true at the beginning of the signal bar), I would need a reproducible scenario with either your strategy or the SampleMultiInstrument Strategy. Please send your strategy to support at ninjatrader dot com and reference this forum post and I will run the strategy on my side and see if this in fact occurs and if it does get it over to development if this is not expected.

        Thank You.
        BrettNinjaTrader Product Management

        Comment


          #5
          I uploaded the script, with 2 images that show the entry times.
          All are 5 min later (or more)

          instrument FDAX 12-10


          Maybe the problem is in the Kagi bars?
          Attached Files
          Last edited by mart331; 11-17-2010, 12:48 PM.

          Comment


            #6
            Hello,

            I did a quick test on my side:

            I replaced AddKagi with Add(Intrument.FullName, PeriodType.Minute, 5);

            This brings the results back into expected results. Therefor its something going on with the Kagi during backtest. It is unclear at this time if this is expected or not expected.

            I have contact development to verify.
            BrettNinjaTrader Product Management

            Comment


              #7
              Originally posted by NinjaTrader_Brett View Post
              Hello,

              I did a quick test on my side:

              I replaced AddKagi with Add(Intrument.FullName, PeriodType.Minute, 5);

              This brings the results back into expected results. Therefor its something going on with the Kagi during backtest. It is unclear at this time if this is expected or not expected.

              I have contact development to verify.
              Thanks,
              You make me very happy if you could tell me asap when the Kagi bars are working right at this moment, in backtest or in replay/live?

              Comment


                #8
                mart331, I'm seeing it here in realtime / replay only - we're looking into matters.

                Comment


                  #9
                  Originally posted by NinjaTrader_Bertrand View Post
                  mart331, I'm seeing it here in realtime / replay only - we're looking into matters.
                  I think the problem also exist with Point en Figure........... maybe too with LineBreak?
                  Renko?

                  Comment


                    #10
                    We'll review those barstypes, too for the issues you raised - thanks for your patience and support.

                    Comment


                      #11
                      Originally posted by NinjaTrader_Bertrand View Post
                      We'll review those barstypes, too for the issues you raised - thanks for your patience and support.
                      Hi Bertrand,
                      Can you tell me or this Kagi issue also exists in NT 6.5 (I have that not installed)?
                      Thanks.

                      Comment


                        #12
                        Mart331, those charttypes are new to NT7 as such you would not find them in NT 6.5 unfortunately.

                        Comment


                          #13
                          Originally posted by NinjaTrader_Bertrand View Post
                          We'll review those barstypes, too for the issues you raised - thanks for your patience and support.
                          Hi Bertrand,
                          Has anything become more clear about the KagiBars?

                          Comment


                            #14
                            Unfortunately we were not able to reproduce on our latest custom builds, please recheck your issue on the next NT7 update - thanks.

                            Comment

                            Latest Posts

                            Collapse

                            Topics Statistics Last Post
                            Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                            0 responses
                            636 views
                            0 likes
                            Last Post Geovanny Suaza  
                            Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                            0 responses
                            366 views
                            1 like
                            Last Post Geovanny Suaza  
                            Started by Mindset, 02-09-2026, 11:44 AM
                            0 responses
                            107 views
                            0 likes
                            Last Post Mindset
                            by Mindset
                             
                            Started by Geovanny Suaza, 02-02-2026, 12:30 PM
                            0 responses
                            569 views
                            1 like
                            Last Post Geovanny Suaza  
                            Started by RFrosty, 01-28-2026, 06:49 PM
                            0 responses
                            571 views
                            1 like
                            Last Post RFrosty
                            by RFrosty
                             
                            Working...
                            X