NT 7 Behavior:
1) i.e. you have indicator X (NT7), and in Initialize it's set to CalculateOnBarClose=true;
2) if you call X indicator in Y indicator, it doesnt matter to if Y is set to COBC or not, and X will still show CalculateOnBarClose=true
3) if the X doesnt have the CalculateOnBarClose=... lineinside Initialize (so, not setting it to anything), then X will always get the same COBC as parent Y
4) even, in parent class, you can override the called indicator's COBC from OnStartUp:
var instance= X(..);
instance.CalculateOnBarClose = true/false ; // will set to whatever you choose
However, NT 8 Behavior seemed to be different, and i think you have to address that, or at least, note that on DOCS page.
in NT8, it doesnt matter. X will always get same Calculate as the caller (parent) Y indicator has. EVEN DOESN'T MATTER IF YOU SET IT IN PARENT, LIKE:
( State==State.DataLoaded ) // or any state you want
var instance= X(..);
instance.Calculate = Calculate.OnBarClose/OnEachTick ; // doesnt matter... it will still work with PARENT's Calculate .
To avoid that, I used a "trick". in X indi, i have to set:
Calculate _calculate; // stand up parent inclusions, to imitate to NT7 protected override void OnStateChange() { if (State == State.SetDefaults) { ..... } else if (State == State.Configure) { _calculate = Calculate; } else if (State == State.DataLoaded) { Calculate = _calculate; } }
the other "workaround" (but the above workaround is better) seemed to be changing the caller Y indicator's property temporarily:
_temp = Calculate; Calculate = C..OnEachTick/OnBarClose; //set any desired value for [B]X[/B] indi var instance = X(...); Calcualte = _temp; //re-set back
Comment