Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Combining multiple indicators into one

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

    Combining multiple indicators into one

    Hi,

    I run 16 custom-type charts, i.e. non-standard charts type that come with NT8.

    Each chart runs 8 indicators which are mostly tick-based. So, I am running 128 indicators currently. I do not use tick replay.

    In order to improve performance, does it make sense for me to combine the indicators into say 2 or 3 on each chart?

    Will it improve performance significantly, or it does not matter since the indicators are compiled.

    Appreciate your assistance.



    #2
    Hello Rainmakersg,

    It would reduce some overhead of having to generate instances and trigger the OnBarUpdate() in those.

    However, the logic itself being run is what is consuming CPU and memory resources.

    If you have some scripts running with Calculate OnBarClose and some with Calculate OnEachTick, the ones on OnBarClose are using significantly less CPU and possibly memory (depending on what the script is doing).
    If you were to move all of that into one script and all the logic is running OnEachTick, that will increase the CPU usage, as some of that logic used to only run OnBarClose, but now is run on every received tick.

    Your logic could only run some code when IsFirstTickOfBar is true and reduce some of that resources use.
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Hi Chelsea,

      Thanks for your reply. I intend to put all Calculate.OnBarClose indicators into one and all Calculate.OneEachTick indicators into one.

      As for your IsFirstTickOfBar suggestion. Let's say if my indicator is set to Calculate.OneEachTick, and the logic only runs when IsFirstTickOfBar is true, then what is the difference between this vs setting the indicator to Calculate.OnBarClose? Is there any practical difference?

      Also, is there a difference in CPU and memory resource consumption between the two?

      Comment


        #4
        Hello Rainmakersg,

        The event running OnBarUpdate on every tick takes CPU. Even if the logic were to return and do nothing. Its not a lot. But if there are a huge amount of class instances it can add up.
        OnBarClose would be less CPU, again even if the script did nothing.

        If the indicator is running OnEachTick anyway, because some logic does need to process each tick, then having further code that the logic only runs on the first tick of a new bar would only be adding a single branching operation (the if statement) for each tick (to decide if its the first tick or not), which is minimal.
        Chelsea B.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        574 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        333 views
        1 like
        Last Post Geovanny Suaza  
        Started by Mindset, 02-09-2026, 11:44 AM
        0 responses
        101 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by Geovanny Suaza, 02-02-2026, 12:30 PM
        0 responses
        553 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        551 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X