As you might think I have a little Problem.

I have programmed a NTStrategy that collects Data from multiple Indicators and different Timeframes (10 at the moment) that I added via Add(PeriodType) and saves this data to a csv table. All timeframes are based on daily data (eg. 1D,2D,3D,4D,...).
After this table is created (this means that all timeframes are on the last bar) I want to call some functions that use the data in this table to create further tables and do some more calculations.
The main algorithms work and I can create and collect my data and also create further tables without problems. This part works flawless.
My main Problem is that my further functions are not called on the last bar when all previous calculations are finished and the table is created over the full data in the chart. eg. I have data from 2000 to 2014 on the chart and the timeperiods i load but the generated table stops at 2004 because the if clause (see below) seems to get triggered.
I know that this is the problem because without this if clause the table is generated and saved complete from 2000-2014.
I already tried a couple of things but without success.
e.g.
if ((Count - 2) != CurrentBars[lastBarArrayIndex]) return; // wait to last bar;
or
if ((Count - 2) != CurrentBars[0]) return; // wait to last bar;
{
MyFunctionCalls
}
Is there any way (function or code) to wait in OnBarUpdate() till we are on the last Bar in all timeperiods that are added to the strategy?
Thanks in Advance

Comment