Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Ninja Automatic Trading on small tick periods

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

    #16
    When I run a strategy with CalculateOnBarClose false, BasePeriod = 60 min, it doesn't gain memory as fast as running a strategy with CalculateOnBarClose true, BasePeriod = 1s. Hope this can give some clue. Perfview points to these 2 objects as culprits
    1) ArrayList
    2) NinjaTrader.Data.Chunk

    Comment


      #17
      Hi androiduser14916,

      The second data is comprised of tick data, while minute data is minute data.
      This means that the 1 second chart is going to be using a much larger source of data than the minute chart.

      However, with the second data script instance this running in COBC true, would lead me to think that this would process less than any script running with COBC false. If the scripts runs less then it would be expected that any data collection would happen less as well as long as this is happening in OnBarUpdate.

      Are you setting any items in OnMarketData or OnMarketDepth in the script?

      If you comment out the array's does the memory size stop growing?
      Chelsea B.NinjaTrader Customer Service

      Comment


        #18
        Hi Chelsea,

        to see this issue all you need is create a strategy, run it on second period

        protected override void OnBarUpdate()
        {
        myInput0 = CurrentBar;
        }

        Nothing OnMarketData, OnMarketDepth.

        ArrayList and NinjaTrader.Data.Chunk are all ninjatrader data structures.

        This is what I think Ninja is doing, correct me if I'm wrong
        I'm thinking I can access Close[1000], Close[10000] which means that in memory, Ninjatrader is storing a bar array with 10000 items, 1 for each second.
        Can someone please enlighten on when NinjaTrader ever frees this? Is there restriction on how far back you can access Close [x]?

        Comment


          #19
          Hi androiduser14916,

          For the primary dataseries, there is not a limit to the amount of bars back that you can access.

          So even on bar 1001 you can call Close[1000].

          Yes, this does mean that the primary data series is accumulating in memory.

          If the chart is closed, the memory is cleaned up by the .NET garbage collection. This can take a while before the memory is released.
          Chelsea B.NinjaTrader Customer Service

          Comment


            #20
            Hi Chelsea, I'm not using any chart. This is a real time strategy that is fully automated. Are you saying that there is no choice but to restart a real time strategy at intervals if I'm understanding you correctly because the primary series will always accumulate in memory? What if I make the Period.Type Second a secondary series by adding it later and make my Period.Type 60 Minutes the primary series? Will that help?

            Comment


              #21
              Hello androiduser14916,

              That is correct, and adding the second interval as the secondary series will not correct the issue.

              The 256 bars maximum lookback is applied to data series that are custom added data series and does not affect price data from the feed.
              Chelsea B.NinjaTrader Customer Service

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by Rapine Heihei, Today, 08:19 PM
              1 response
              8 views
              0 likes
              Last Post NinjaTrader_Manfred  
              Started by Rapine Heihei, Today, 08:25 PM
              0 responses
              6 views
              0 likes
              Last Post Rapine Heihei  
              Started by f.saeidi, Today, 08:01 PM
              1 response
              9 views
              0 likes
              Last Post NinjaTrader_Manfred  
              Started by Rapine Heihei, Today, 07:51 PM
              0 responses
              8 views
              0 likes
              Last Post Rapine Heihei  
              Started by frslvr, 04-11-2024, 07:26 AM
              5 responses
              98 views
              1 like
              Last Post caryc123  
              Working...
              X