My question is whether the approach used in TestIndChild (i.e. “ShortForm” operation) is in fact less efficient.
TestIndChild includes logic whereby depending where the Indicator is called from it calculates differently. Where TestIndChild is called from a Chart or TestStrategy, it will calculate “ShortForm” and “LongForm” components. Where TestIndChild is called from any other Indicator (e.g. TestIndHost), it will calculate “ShortForm” only (i.e. it will not calculate “LongForm”).
So, my question revolves around the behaviour where the cache is created in the NinjaScript auto-generated code under NinjaScript.Indicators and NinjaScript.Strategies. As I understand it, where TestStrategy is enabled, cacheTestIndChild would contain two elements, one where IsCalledFrom = “TestStrategy”, and one where IsCalledFrom = “TestIndHost”. This would result in both elements processing OnBarUpdate and thus being less efficient relative to the Indicator with “IsCalledFrom” and “ShortForm” logic removed. That is, where the argument and "ShortForm" logic is removed, cacheTestIndChild would only have one element processing OnBarUpdate.
Please confirm/correct my understanding.

Comment