I have a strategy I am developing and there are times I need to calculate the current (or last close) price of an instrument of which my strategy is not running on. Is there any way to get the current price of a stock without Add(instrument) to the BarsArray?
If I have to add instruments to BarsArray (and if theres no way to remove it later?) is there a way to determine which instrument is in which index?
For example, throughout my strategy a series of events such as:
do something...
Add("GOOG", PeriodType.Minute, 1);
do something...
Add("AAPL", PeriodType.Minute, 1);
do something...
Add("NFLX", PeriodType.Minute, 1);
do something...
but on my fourth iteration lets say I need to use AAPL again, is there a way i can determine through code that AAPL was added already in Bars[2]?
Bars[2].toString() perhaps?
Thanks!


Comment