Strategy:
// Strategy code // These defined above OnStateChange(); private AdvancedSRZones ASRZ; // defined above OnStateChange(); private SMA sma1; // defined above OnStateChange(); else if (State == State.DataLoaded) // inside OnStateChange() { ASRZ = AdvancedSRZones(AreaStrengthMultiplier, TimeThreshold, ProxyStrengthMultiplier, NewZoneStrength, ZoneTimeoutStrength, NewZoneTopMultiplier, NewZoneBottomMultiplier, ResZoneColor, SupZoneColor); AddChartIndicator(ASRZ); }
I have already tried calling the indicator in the strategy OnBarUpdate(), it just throws an error that the index is out of bounds, like so: (assume ... is args)
protected override void OnBarUpdate() // Strategy code { var temp = AdvancedSRZones( ... )[0]; // Out of bounds error }
Thank you
edit: I should mention the indicator appears perfectly fine on its own, when not hosted by a strategy.
Comment