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

Simple Indicator seems to be a Resource Hog

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

    Simple Indicator seems to be a Resource Hog

    Hello, can someone look at this simple indicator and tell me why it is such a resource hog? And how to improve it? Are 6 plots too many? It is using almost as many resources as the Volume Profile.
    Attached Files

    #2
    It seems probable you're applying this to too small/fast of a time frame or on too many symbols and charts at a time. Is it running as a column in Market Analyzer? Or, is it on 20 charts all of which are small bars?

    Or, after adding it to the chart, are you changing it from its default OnBarClose to OnEachTick or OnPriceChange?
    Bruce DeVault
    QuantKey Trading Vendor Services
    NinjaTrader Ecosystem Vendor - QuantKey

    Comment


      #3
      Actually, this is on only one 30 minute MES chart, and not on Market Analyzer. I should have mentioned that.
      Last edited by JohnS52; 12-03-2023, 07:33 AM.

      Comment


        #4
        Just out of curiosity, how many days have you been running NT? I use 2-3 NQ range charts and I have almost never seen any indicator have more than 1 million ms of CPU time.

        Comment


          #5
          Hello JohnS52,

          Thanks for your post.

          I do not see anything specific in the code you shared that would cause the indicator to use a large number of resources.

          Do you have Tick Replay enabled?

          As Leeroy_Jenkins stated, how many days have you been running NinjaTrader?

          For best performance, we suggest resetting NinjaTrader daily as noted in the help guide page below.

          Performance Tips: https://ninjatrader.com/support/help...ance_tips2.htm

          As a test, please restart NinjaTrader, then close any workspaces you have open, create a New > Chart window in the blank workspace, add the indicator to the chart, open the NinjaScript Utilization Monitor, and note the number of resources being used.

          Do you see the same behavior occur after running this test?

          Further, you could find performance tips from our help guide linked above. These tips will help optimize the performance of your platform.
          Brandon H.NinjaTrader Customer Service

          Comment


            #6
            Thanks for your interest and your replies. That was about 24 hours of NT data. No Tick Replay enabled. It's doing it again today. Already 400,000+ms in about 2 hours, running On Price Change on two 30 minute charts. I usually do restarts of NT8 and my computer everyday. I will try and delete the cache and see if that helps.
            Last edited by JohnS52; 12-04-2023, 09:10 AM.

            Comment


              #7
              Do you call this indicator within other indicators/strategies? It seems like it recalculates for all bars on each price change. It happened to me once with my own indicator.

              Comment


                #8
                Hello Leeroy, I will have to look into that with a Print function. That could possibly be what's happening. But why would it do that?


                But no, I am not using it in any strategies, just the two 30 minute charts. I originally made it because the Lizard amaMacdBB indicator seemed to not work properly with the Markers Plus system: I was trying to simplify it.

                Comment


                  #9
                  Hello JohnS52,

                  Thanks for your notes.

                  When working with any issue, it is important to take steps to isolate the issue so that the exact line causing the behavior can be found.

                  This is a process of elimination and a process of debugging by adding prints.​

                  To see what section of code in the script is causing a large number of resources to be used you could reduce the code of the script and debug by adding prints.

                  Comment out one section of code at a time and test the script in a blank workspace on a single blank chart with no other indicators, strategies, or custom bar types applied to the chart. If at some point you comment out a section of code and see the behavior stopped, you could debug the script further by adding prints and uncommenting lines of code from the commented out section of code to narrow in on the offending code.
                  Brandon H.NinjaTrader Customer Service

                  Comment

                  Latest Posts

                  Collapse

                  Topics Statistics Last Post
                  Started by fx.practic, 10-15-2013, 12:53 AM
                  5 responses
                  5,404 views
                  0 likes
                  Last Post Bidder
                  by Bidder
                   
                  Started by Shai Samuel, 07-02-2022, 02:46 PM
                  4 responses
                  95 views
                  0 likes
                  Last Post Bidder
                  by Bidder
                   
                  Started by DJ888, Yesterday, 10:57 PM
                  0 responses
                  8 views
                  0 likes
                  Last Post DJ888
                  by DJ888
                   
                  Started by MacDad, 02-25-2024, 11:48 PM
                  7 responses
                  160 views
                  0 likes
                  Last Post loganjarosz123  
                  Started by Belfortbucks, Yesterday, 09:29 PM
                  0 responses
                  9 views
                  0 likes
                  Last Post Belfortbucks  
                  Working...
                  X