Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Anomaly doing backtesting

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

    Anomaly doing backtesting

    Hi Ninjas,

    This could be a little hard to explain well. I´ll try to put it as simple as possible.

    I was doing my typical optimization and backtesting for EURUSD, daily, for several given days, all was going smoothly until I see that for a couple of days the backtesting results give a big anomaly: When it should be there certain trades for a complete day ( in Forex time: from 5.15pm till 5pm next day) there´s none, the system simply did a "Exit Close" at 23:59 ( Without any reason cause configuration for Flatten all is at 5.00pm ) and then it was flat...I must say that for the rest of daily backtesting everything was just fine, but I couldn´t solved this issue.

    I´ve closed and opened again my NT, I´ve revised the data base, The configuration, and I haven´t found anything.

    Will it be a problem of corrupted database?

    1. What must I check?
    2. How can I be sure that my database is ok?
    3. What others configuration should I see?

    Thanks for your attention

    #2
    I´ve found the problem, I think: in the session manager there was a session called "24/5", from 00.00 till 00.00 next day, I deleted it and doing again my backtesting and the problem is gone, so by coincidence I imagine that this could be, please ignore the issue.

    Thanks

    Comment


      #3
      Despite I´ve solved for some days, it continues to happen for a couple of next ones, I don´t really understand this issue, please let me know some tip to solve it

      Thanks

      Comment


        #4
        Hello,

        There are a couple potential causes that you will need to look into.

        First, do you want it to exit at the session close?
        You can hard code this preference or manually set this on the strategies properties section: http://www.ninjatrader.com/support/h...xitonclose.htm

        Next, as it sounds you've already looked into, is the session template. You will want to ensure the session template you're using is correct of the chosen instrument.
        By default the EURUD uses the Forex template. For detail on when this template runs go to tools -> session manager -> select Forex from the dropdown

        Please let me know if I can be of further assistance.
        LanceNinjaTrader Customer Service

        Comment


          #5
          What is really happening is that for some days, the backtesting simply doesn´t read the session template selected for it, how come? and what can i do?

          Comment


            #6
            Hello,

            Originally posted by pstrusi View Post
            What is really happening is that for some days, the backtesting simply doesn´t read the session template selected for it, how come? and what can i do?
            When you backtest the strategy SampleMACrossOver do you also experience this error or is only with your custom script?
            LanceNinjaTrader Customer Service

            Comment


              #7
              Hi Lance,

              Yep, those two basic steps i´ve already done it, but nonetheless it continues to happen, it´s just as simple as it doesn´t take the selected session template. I´ve tried to change it again and again but same results

              Comment


                #8
                I want to make a test.

                How can I code the manually exit in my code, so I can disable in the options from NT?

                Comment


                  #9
                  This is what happens:
                  The optimization goes good, right exit to close, the backtesting from coming next day, correct trades until 23.59.59, the system goes "Exit to Close" with no reason, and after that, it doesn´t resume till past 5:15 pm, so from 00:00 until 5:00 there´s no any trade...pretty weird, I don´t know what to do, cause for the majority of the days it goes pretty good

                  Comment


                    #10
                    Hello,

                    Can you please attach a your code (or simplified version that replicates the results) and provide me with the exact dates tested, session template used, and any other settings I may need to be aware of so that I can replicate your results?

                    Also, please point out some sample dates where you encounter errors.

                    Located in: (my)Documents\NinjaTrader 7\bin\Custom\Strategy

                    I look forward to assisting you further.
                    LanceNinjaTrader Customer Service

                    Comment


                      #11
                      Lance,

                      I did the test the SampleMACrossOver and for Range of 7 and for that day May 9,2012 did the same thing, unexpectedly exit to close at 23.59.59. I think it must be an error in my database for that date.

                      Don´t worry, I let it go, if this was happened again I´ll post it.

                      I´m sorry for the inconvenience, and thanks for your quick attention

                      Comment


                        #12
                        Hello,

                        No worries, I'm here to help.

                        You can check your available historical data through the Historical data manager (tools -> historical data manager -> edit tab)
                        From there you will be able to see the data that has been downloaded and download more data if some is missing.



                        Please be aware not all data providers will provide accurate data this far back.

                        Please let me know if I can be of further assistance.
                        LanceNinjaTrader Customer Service

                        Comment


                          #13
                          Lance, a final note. Continuing with my backtesting i was days ahead to get once again correct evaluations, when I got it right, I began to go backward day by day doing the optimization and backtesting, and for some "days with the issue" now I have no problem. My main worry is this could be happening real time when my Algo goes online. I´m a user with a solid level of systems and this is really a weird issue.

                          Comment


                            #14
                            I´ve just checked that the issue happens with Range 7 only, for Range 8, 9 all goes perfect, why do u think of this?

                            Comment


                              #15
                              Lance I´d like to share what I've found to solve my problem. Viewing 2 different charts for Range 8 and 7, I could see how Range 7 was abruptly interrupted with no reason...so after Changing several factors, I decided to change the session template from "Forex" to "Default 24/7", which I have them exactly the same in my NT, the result amazing, being exactly the same, with default 24/7 I have no issues. I hope this can contribute with further similar problems.

                              Thanks for your attention

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by Tim-c, Today, 03:54 AM
                              0 responses
                              3 views
                              0 likes
                              Last Post Tim-c
                              by Tim-c
                               
                              Started by FrancisMorro, Today, 03:24 AM
                              0 responses
                              2 views
                              0 likes
                              Last Post FrancisMorro  
                              Started by Segwin, 05-07-2018, 02:15 PM
                              10 responses
                              1,770 views
                              0 likes
                              Last Post Leafcutter  
                              Started by Rapine Heihei, 04-23-2024, 07:51 PM
                              2 responses
                              31 views
                              0 likes
                              Last Post Max238
                              by Max238
                               
                              Started by Shansen, 08-30-2019, 10:18 PM
                              24 responses
                              945 views
                              0 likes
                              Last Post spwizard  
                              Working...
                              X