Please find attached two scripts TestIndicator and TestStrategy.
TestIndicator identifies the BarPeriodType in State.Configure. Adding TestIndicator to a chart works as expected.
public class TestIndicator : Indicator { protected override void OnStateChange() { if (State == State.SetDefaults) { ... } else if (State == State.Configure) { BarsPeriodType _barsPeriodType = BarsPeriod.BarsPeriodType; Print(_barsPeriodType); } } protected override void OnBarUpdate() { } }
public class TestStrategy : Strategy { private TestIndicator _testIndicator; protected override void OnStateChange() { if (State == State.SetDefaults) { ... } else if (State == State.Configure) { _testIndicator = TestIndicator(); } } protected override void OnBarUpdate() { } }
As always thanks and regards
Shannon
Comment