"This method should ONLY be called from the OnStateChange() method during State.Configure
Arguments supplied to AddDataSeries() should be hardcoded and NOT dependent on run-time variables which cannot be reliably obtained during State.Configure (e.g., Instrument, Bars, or user input)."
So, while I can read and understand what has been said there, I am still looking for a way to enable the user of my indicator to specify the instrument symbol and the time frame, like "MSFT", Minute and 10.
I created three properties, SecondaryInstrument, SecondaryPeriodType, and SecondaryPeriod so my user can set the values. I then put this line of code in State.Configure of the OnStateChange() method:
AddDataSeries(SecondaryInstrument, SecondaryPeriodType, SecondaryPeriod, Data.MarketDataType.Last);
So I have two questions:
1) Is this approach really inappropriate; will it cause problems?
2) If this approach is not supported, how can I enable my indicator user to specify the instrument and time frame for my indicator?
Thanks!
Comment