• 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

Unexpected interruption running backtest

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

    Unexpected interruption running backtest

    Hi Ninjas,

    I have a rare event while doing backtest, it appears some kind of out of memory, I'd like to know what´s happening, which one are my limits in the Algo. The script is pretty simple in its calculations but then, depending on results, the Algo must choose a decision among 17576 cases to trigger a command; for this I use "SWITCH" and so far so good. The Algo still is "learning", therefore not all 17576 cases has a command, in fact the total cases with final commands are 28% of total. This script with 28% of cases filled is about 1355 Kb size. But now I decided to make some changes in order to filled all 17.576 cases, then the script became into 3400 Kb. So far, not problem; the issue comes when I do a backtest with this 3400 Kb Algo, that NT crashes, and I'd like to know why, if is there any memory issue or something that I can address.

    In order to speed the thread, I attached here the trace and log files

    Looking forward for your help
    Last edited by NinjaTrader_Matthew; 09-24-2013, 11:58 AM.

    #2
    Hello,

    there is a .cs source file max number of lines that can be used. This number is 65535
    Are you exceeding this max?

    If not do you have a sample script that I could test on my end? If you can't post it here you can send it to support at ninjatrader dot com
    Lance B.NinjaTrader Customer Service

    Comment


      #3
      The script has no more than 18.000 lines, so I'm well below limit

      Comment


        #4
        In this case further debugging will need to be done.

        http://www.ninjatrader.com/support/f...ead.php?t=3418

        I'd be happy to take a look at the script and test on my end but as this is a rather complex script I may not be able to assist with the debugging.
        Lance B.NinjaTrader Customer Service

        Comment


          #5
          The Algo is debugged cause it works pretty right. The problem is when I feed with more commands the SWITCH-CASE that actually are blank. So it might be a memory problem. That's why I'd like at least you could see the trace and log files and see what was the cause for the crash.

          I appreciate your help

          Comment


            #6
            There wasn't anything in the trace that would signify an error.

            When talking about size are you talking about the physical file size or NinjaTrader memory usage?

            For more info about memory usage: http://blogs.msdn.com/b/tom/archive/...processes.aspx

            I don't believe the size of the file should come into play but I would be able to test on my end if you'd like.
            Lance B.NinjaTrader Customer Service

            Comment


              #7
              It had to do something with the command "SendMail" after the order. Despite it works with low cases, when I have all cases filled, this command gives problem, may be some memory issue. I did the trial without the "SendMail" and the backtest was just fine.

              Thanks

              Comment


                #8
                Thanks for the update and I'm glad to hear it's working for you.

                If you think you've found a bug or something that can be improved for the next major release of NinjaTrader please send in a simplified script that replicates the error and I would be happy to look further into this.
                Lance B.NinjaTrader Customer Service

                Comment


                  #9
                  It's pretty simple. The script calculates a value, then with that value it must choose one case from 17.576, when it chooses the case, through SWITCH - CASE, then either one of these commands follows:

                  EnterShort(100000, "SELL"); SendMail ("[email protected]", "[email protected]", "ALGO SHORT 100K", "RLZD PnL " + GetAccountValue(AccountItem.RealizedProfitLoss).To String());

                  OR

                  EnterLong(100000, "SELL"); SendMail ("[email protected]", "[email protected]", "ALGO LONG 100K", "RLZD PnL " + GetAccountValue(AccountItem.RealizedProfitLoss).To String());

                  So, the problem is solved when I leave only the EnterLong or EnterShort command.

                  This issue to me is now solved.

                  Thanks again

                  Comment

                  Latest Posts

                  Collapse

                  Topics Statistics Last Post
                  Started by claxxical, Today, 10:00 PM
                  0 responses
                  5 views
                  0 likes
                  Last Post claxxical  
                  Started by ct, Today, 08:13 PM
                  0 responses
                  6 views
                  0 likes
                  Last Post ct
                  by ct
                   
                  Started by Lumbeezl, Today, 05:17 PM
                  0 responses
                  6 views
                  0 likes
                  Last Post Lumbeezl  
                  Started by wishing, Today, 03:33 PM
                  0 responses
                  10 views
                  0 likes
                  Last Post wishing
                  by wishing
                   
                  Started by ATMtrader0001, Today, 01:48 PM
                  1 response
                  8 views
                  0 likes
                  Last Post NinjaTrader_PaulH  
                  Working...
                  X