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
    LanceNinjaTrader 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.



        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.
        LanceNinjaTrader 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.
            LanceNinjaTrader 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.
                LanceNinjaTrader 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 funk10101, Today, 09:43 PM
                  0 responses
                  2 views
                  0 likes
                  Last Post funk10101  
                  Started by pkefal, 04-11-2024, 07:39 AM
                  11 responses
                  36 views
                  0 likes
                  Last Post jeronymite  
                  Started by bill2023, Yesterday, 08:51 AM
                  8 responses
                  44 views
                  0 likes
                  Last Post bill2023  
                  Started by yertle, Today, 08:38 AM
                  6 responses
                  25 views
                  0 likes
                  Last Post ryjoga
                  by ryjoga
                   
                  Started by algospoke, Yesterday, 06:40 PM
                  2 responses
                  24 views
                  0 likes
                  Last Post algospoke  
                  Working...
                  X