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

Memory usage/performance for OnRender of array of double arrays

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

    Memory usage/performance for OnRender of array of double arrays

    Hello -

    I calculate a metric in real-time and store each value of that metric.
    I want to set all the values I capture in a C# collection. There will be one collection for each bar.

    I then use OnRender to show the metric values in an indicator panel below the main price panel, for each real-time bar.

    I usually leave NT 8 running throughout the week, so for example, if I have 3000 real-time bars, I will have 3000 collection objects, each with a metric value equal to or less than the # of ticks for that bar.

    I have a high-end box with plenty of memory, a high-end video card and a high-performance CPU.

    A couple of questions:
    1) Will this type of implementation cause NT to perform poorly? Can it handle storing and rendering large amounts of data?
    2) I was thinking of using an Array of double arrays to store the values for each bar for the total # of real-time bars that this metric is calculated for. Do you have another suggestion for the implementation for optimal performance?

    Thanks,
    Mark

    #2
    Hello mmeninger,

    Thank you for your post.

    I would not expect to see a large performance hit taken due to this concept. In fact, calculations stored in arrays is really what most plots are for indicators.

    I would ask though why you would not use the Series<double> for this instead? You can find details on Series<T> at the following link: https://ninjatrader.com/support/help...us/seriest.htm

    I look forward to your response.

    Comment


      #3
      Hi Patrick,

      The problem with using the Series<Type> data structure is that it contains the latest value for each bar - so a single value for bar.

      I am going to record ALL the values for a given bar on a tick by tick basis for that bar and store those. The only exclusion I make for storing is if the current value is equal to the previous value, then it won't get added.

      The rendering will then display ALL the values saved for that bar.

      So, I need to use an Array.

      Thanks,
      Mark

      Comment


        #4
        Hello mmeninger,

        Thank you for your response.

        I understand what you mean now. I would suspect this could be heavy on performance due to storing each tick (if not the same as the prior tick). However, it would be similar to running an indicator on a 1 tick chart with Calculate.OnEachPriceChange. What I mean by that is that I suspect performance will take a hit but I do not expect it to be too large based on the concept as you have presented it.

        Please let me know if you have any questions.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Waxavi, Today, 02:10 AM
        0 responses
        6 views
        0 likes
        Last Post Waxavi
        by Waxavi
         
        Started by TradeForge, Today, 02:09 AM
        0 responses
        11 views
        0 likes
        Last Post TradeForge  
        Started by Waxavi, Today, 02:00 AM
        0 responses
        2 views
        0 likes
        Last Post Waxavi
        by Waxavi
         
        Started by elirion, Today, 01:36 AM
        0 responses
        4 views
        0 likes
        Last Post elirion
        by elirion
         
        Started by gentlebenthebear, Today, 01:30 AM
        0 responses
        5 views
        0 likes
        Last Post gentlebenthebear  
        Working...
        X