I add an additional 1 tick time frame using: Add(PeriodType.Tick, 1); Works fine.
My code wasn't working correctly so I put in a Print to see the values.
protected override void OnBarUpdate()
{
Print("TimeFrame3 " + BarsInProgress + " " + BarsPeriod.Id + " " + BarsPeriod.Value);
.. user code
I added the time frame as 1 tick in "Initialize" but BarsPeriod.Id shows as "Range".
Below is the log from the Print. The "0" BarsInProgress is the chart timeframe and the "1'" BarsInProgress is my added timeframe.
TimeFrame3 0 Range 1
TimeFrame3 1 Range 1
TimeFrame3 0 Range 1
TimeFrame3 1 Range 1
TimeFrame3 0 Range 1
TimeFrame3 1 Range 1
TimeFrame3 0 Range 1
TimeFrame3 1 Range 1
TimeFrame3 0 Range 1
TimeFrame3 1 Range 1
TimeFrame3 0 Range 1
Question:
Why does my added timeframe show as "Range"? Does tick not support "BarsPeriod.Id"? How can I tell if a tick was from my 1 added tick timeframe? It works fine on just 1 chart time frame but if the user adds an additional chart time frame (which I have no control over) the BarsInProgress changes to 2 for my added time frame and "0" and "1" are used by the chart time frames.
Cheers
Comment