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.
Comment