This works fine under most circumstances however there is one problem:
For example I have an open chart with one data series displayed. The indicator is then loaded. (there are 10 series in BarsArray). The data series displayed on the chart (BarsInProgress=0, primary) has 5000 days (bars) loaded with bars visible going back to 1999. However some of the other data series start at later dates.
If I select a date when all data series have bars on the screen then everything works. However when the date is such that some of the data series do not have any bars on the screen yet then my check (BarsInProgress == BarsArray.Length-1) fails.
Basically there are 10 series in BarsArray but OnBarUpdate() will be called for example with BarsInProgress == 0,1,4,7,8 corresponding to the series with bars actually present by the chosen date.
I need to run the calculations for the series in BarsArray (in this case 0,1,4,7,8) and once the last series has been processed, display the output. That is what I was trying to achieve by BarsInProgress == BarsArray.Length-1.
Can someone please help me figure out how to do this with BarsInProgress not incrementing by 1 each time until it equals the BarsArray Length?
Any help would be greatly appreciated.
Thanks,
Peter
Comment