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

Saving CPU cycles

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

    Saving CPU cycles

    In my config, it seems the "indicators" are running the CPU at a steady 40-50% without any strategies running. One CPU running much heavier than the other.

    I have my "strategies" set to cycle OnBarUpdate every few seconds; so when they do run it is not that noticeable.

    I don't not wish to update my "indicators" at the End of the Bar. If I "return" without setting a value for the indicators; they disappear.

    Is there a way to periodically update my "indicators"?

    Thanks!

    #2
    Unfortunately not. It is every tick or at end of bar. You can use your own logic to try and filter away ticks, but that would still be using return.
    Josh P.NinjaTrader Customer Service

    Comment


      #3
      Might I suggest...if my code does not change indicator values; that NT just do nothing? Why do values need to be re"Set" so the indicator does not disappear?
      Last edited by SteveB; 09-18-2008, 02:57 PM.

      Comment


        #4
        You can program it yourself that way. Instead of simply "returning" use a .Set() before the return. Set it to its last known value and bypass all the calculations. That should save you CPU cycles.
        Josh P.NinjaTrader Customer Service

        Comment


          #5
          That's what I was planning; but does NT redraw the identical image? Don't know resources/cycles used to calc vs redraw...

          Comment


            #6
            Drawing is not something you can control. Since you don't want calculate on close, but you don't want on every single tick the only place you can save cycles is filter out calculations on most ticks.
            Josh P.NinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by WHICKED, Today, 12:45 PM
            2 responses
            18 views
            0 likes
            Last Post WHICKED
            by WHICKED
             
            Started by GussJ, 03-04-2020, 03:11 PM
            15 responses
            3,276 views
            0 likes
            Last Post xiinteractive  
            Started by Tim-c, Today, 02:10 PM
            1 response
            8 views
            0 likes
            Last Post NinjaTrader_ChelseaB  
            Started by Taddypole, Today, 02:47 PM
            0 responses
            5 views
            0 likes
            Last Post Taddypole  
            Started by chbruno, 04-24-2024, 04:10 PM
            4 responses
            51 views
            0 likes
            Last Post chbruno
            by chbruno
             
            Working...
            X