Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

20GB of memory for slope?

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

    20GB of memory for slope?

    Hi all,

    I am programming in NT for 2 years, I came up with a strange problem recently.

    I am backtesting a portfolio of 20 stocks for a time interval of 1 year using 1 Min data. In a strategy I also use the slope of 1 day VIX as:

    Slope(Closes[1], 3,0). I have included VIX timeseries with Add(etc) correctly.

    The problem is that the calculation seems eternal and the memory utilization exceeds 20 even 30GB! (33.4 now) The same strategy without the slope completes in 2 mins with minimal memory utilization.

    I imported VIX timeseries on 1 Min basis and I clicked on "Generate Daily data from Min data" since I need slope of 3 days for my algo purposes.

    Ninja version is: 7.0.1000.16

    Any ideas?

    #2
    Hello Jim_Feyn,

    Thank you for your post.

    What is the time frame that you are running this strategy to and from?

    Are you printing, logging, or drawing anything?
    Cal H.NinjaTrader Customer Service

    Comment


      #3
      update: 52GB now.

      timeframes:
      1/1/2013 to 1/1/2014, 1 Min timeframe in stock timeseries
      1/1/2013 to 1/1/2013, daily timeframe in VIX timeseries (and getting the slope of 3 days)


      No, I do not print anything in the output window. I do draw however and use this indicator plot as input for my strategy's signals. That's what I always do.

      I run this problematic backtest of 20 stocks through Strategy Analyzer, I do not use charts. When I backtest only 1 stock through Strategy Analyzer, it works. Slowly though, due to many calculations, but it works and completes the run.

      I am thinking of feeding VIX once in a custom way, through StreamReader, and calculate the slope myself.

      Comment


        #4
        Jim_Feyn,

        I believe the issue you are running into here is the number of items that you are testing at once.

        When you run one test how much does your RAM climb up to?

        Would you be willing to send me the strategy and indicator so that I can test and investigate this on my end?
        Cal H.NinjaTrader Customer Service

        Comment


          #5
          Thanks for your prompt reply.

          Unfortunately I cannot send it since it's proprietary. I am puzzled as well by this.

          I run backtests in SP500, 500 stocks at once and 6 years back instead of 1 year (always in 1 min timeframe), with simpler versions of the strategy, without VIX slope, 32GB of RAM are always enough. For Nasdaq 100, 16GB are enough.

          Comment


            #6
            Jim,

            Can you share the portion of what you are doing with the Slope implementation?

            If you are not getting the same problems with one stock or with the SampleMACross on the same basket test, then it has to be something in the code is taking up the memory and not either disposing() properly or too many draw objects.
            Cal H.NinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by RubenCazorla, Today, 09:07 AM
            2 responses
            13 views
            0 likes
            Last Post NinjaTrader_ChelseaB  
            Started by i019945nj, 12-14-2023, 06:41 AM
            7 responses
            82 views
            0 likes
            Last Post NinjaTrader_ChelseaB  
            Started by timmbbo, 07-05-2023, 10:21 PM
            4 responses
            158 views
            0 likes
            Last Post NinjaTrader_Gaby  
            Started by tkaboris, Today, 08:01 AM
            1 response
            8 views
            0 likes
            Last Post NinjaTrader_Gaby  
            Started by Lumbeezl, 01-11-2022, 06:50 PM
            31 responses
            820 views
            1 like
            Last Post NinjaTrader_Adrian  
            Working...
            X