JCL,
I want to correctly construct bars and higher "timeframe" bars - this feeds all system calculations.

For a portfolio of systems with different bar periods, I need to set the BarPeriod to the "largest common divisor" of all systems and simulate the needed ones with timeframes. All my systems also need a secondary time frame (daily) in their calculations.

Now, for FX (IB), there are M1 bars from 1715 to 1700 ET, but I only want to base my calculations on data from 1716 to 1645(-58) ET.

After 2.5 days of trying, I am still unable to achieve what I want:

1) TF>1 just counts *TF number of bars*.
But because there are no M1 bars from 1700-1715 and because there is a bug with Weekend>2+ (it still creates a weekend bar) - all Frames get continuously shifted and are incorrect.

Also, there is still a bug with StartWeek: with Weekend=2-3, setting StartWeek<2200 does not work - week starts from 2200+ in any case

2) BarPeriod=5 - frameSync(4) almost works.
But there is an unneeded frame ending 1716 which covers 1656-1716. Skipping bars to avoid is not helping - frameSync somehow behaves unpredictably..
Quote:
[855: Wed 16-05-11 20:56] (123.88)n FrameOffset: 3, SkipBars: 0, AssetFrame=-3 ET Time=1656, O= 123.89500, C= 123.87600
[856: Wed 16-05-11 21:01] (123.90) Skiping.. Time= 1701, skipBars= -1
[857: Wed 16-05-11 21:16] (123.87) Skiping.. Time= 1716, skipBars= -2
[858: Wed 16-05-11 21:21] (123.93) Skiping.. Time= 1721, skipBars= -3
[859: Wed 16-05-11 21:26] (123.88) Skiping.. Time= 1726, skipBars= -4
[860: Wed 16-05-11 21:31] (123.92) Skiping.. Time= 1731, skipBars= -5

[861: Wed 16-05-11 21:36] (123.93)n FrameOffset: 3, SkipBars: -5, AssetFrame=-3 ET Time=1736, O= 123.87400, C= 123.93200

[862: Wed 16-05-11 21:41] (123.90)n FrameOffset: 3, SkipBars: 0, AssetFrame=-5 ET Time=1741, O= 123.95000, C= 123.90500- ?? WHY?

[863: Wed 16-05-11 21:46] (123.91)
[864: Wed 16-05-11 21:51] (123.91)
[865: Wed 16-05-11 21:56] (123.91)n FrameOffset: 3, SkipBars: 0, AssetFrame=-3 ET Time=1756, O= 123.93200, C= 123.91200


3) AssetFrame requires setting BarPeriod=desired TF, but can be suitable.
But AssetFrame doesnt work as expected. Start/EndMarket are just variables and changing them is ok and practically works.
Please review my previous message.

4) "Skipping bars mechanism does not work as intended

- Skipping bars only works when TF=1(BarPeriod).
Higher TF do not work in practice - see p1, nor using frameSync - see p2.

- there is a key bug with frame formation.
Open/highs/lows of skipped bars are not really skipped, still counted in the veeery long TF.
Please, answer my other post.

- most importantly and critically, setting a TF to a negative value after skipping bars technically creates a new frame (frame(0)=1). which has
open= close of previous frame (current,incorrect) or open of 'TimeFrame' minutes ago (correct)
close=current bar close;
High/Low = within the period from Open to close;

What shall one do with this extra Frame which covers unneeded hours? How can it be skipped?

May I suggest that setting TimeFrame to a negative number just starts the Frame and at this moment frame(0) returns 0?

Daily TF.
Assuming there are M1 data 24/5, what's the way to construct a series of *Daily* bars (as a secondary TF in a system with BarPeriod=5) which only cover Regular Trading Hours, say, from 8:30 to 15:30ET?

Your advise is highly appreciated.