Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Very useful suggestion about indicators and workspaces... if possible!

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

    Very useful suggestion about indicators and workspaces... if possible!

    I understand that workspaces consume resources if they are open and present in the menu list, even if they are not currently displayed. This is because indicator calculations are occurring in the background for all charts, even if they are not actually shown onscreen.

    I was thinking that it should be possible to have a method call in NinjaScript that allows us to detect if an indicator is running in the currently "open" workspace. You could build this in as a flag in each indicator, which, if it was set, would cause the indicator to just return whenever it was triggered without actually executing any code.

    Even if that is not possible, it should be possible to make a generic NinjaScript call to return the name of the workspace that is currently "active" onscreen. Even if you don't want to provide a call that indicates if the current indicator is in the currently displayed workspace, just allowing us to query the name of the current workspace would allow us to create indicators that only calculated when the actual chart was being displayed, by doing a check ourselves in the OnBarUpdate call.

    This simple change would allow us to run more workspaces without consuming additional resources. Would this be possible?

    Secondly, on a more general note, if an indicator is running in a workspace that is not currently displayed, then am I correct in assuming that an overridden Plot() method will NOT in fact ever execute for this indicator? Since there is nothing to plot, it should never run, and therefore whatever calculations are occurring in that call should never happen - correct?

    It should be relatively simple for us to query which workspace is open in any case - this could save a LOT on CPU usage if we could program our indicators to only run in a certain workspace if it was being shown onscreen, which would help in improving NT's overall performance at minimal cost.

    #2
    Thank you for your suggestion for the improvement of NinjaTrader. I have submitted it into our tracking system with the unique ID # 165.

    Correct - When overriding the plot method when the workspace is hidden, then Plot() will not trigger.
    Ryan M.NinjaTrader Customer Service

    Comment


      #3
      Will the overridden Plot() method trigger if the workspace is open, but the chart is hidden?

      Comment


        #4
        Originally posted by CriticalTrader View Post
        Will the overridden Plot() method trigger if the workspace is open, but the chart is hidden?
        Any response to this? One would think that Windows code would be smart enough not to try to Plot() a window that is minimized... any confirmation?

        Comment


          #5
          JS999 and CriticalTrader,

          Sorry for the late reply here. Correct - if the window is minimized, Plot() will not be called.
          Ryan M.NinjaTrader Customer Service

          Comment


            #6
            Thanks Ryan....That's good to know.

            Comment


              #7
              now, what if the window is "open" but hidden behind another?

              Comment


                #8
                If the window is open (not minimzed), it will call Plot(), even if there are other windows on top.
                Ryan M.NinjaTrader Customer Service

                Comment


                  #9
                  got it. thanks you for the additional clarity

                  Comment

                  Latest Posts

                  Collapse

                  Topics Statistics Last Post
                  Started by terofs, Today, 04:18 PM
                  0 responses
                  5 views
                  0 likes
                  Last Post terofs
                  by terofs
                   
                  Started by nandhumca, Today, 03:41 PM
                  0 responses
                  5 views
                  0 likes
                  Last Post nandhumca  
                  Started by The_Sec, Today, 03:37 PM
                  0 responses
                  3 views
                  0 likes
                  Last Post The_Sec
                  by The_Sec
                   
                  Started by GwFutures1988, Today, 02:48 PM
                  1 response
                  9 views
                  0 likes
                  Last Post NinjaTrader_Clayton  
                  Started by ScottWalsh, 04-16-2024, 04:29 PM
                  6 responses
                  33 views
                  0 likes
                  Last Post ScottWalsh  
                  Working...
                  X