It means that I have session times :
StartTime EndTime Session 1 25/10/2010 06:00:00 26/10/2010 06:00:00 Session 2 26/10/2010 06:00:00 27/10/2010 06:00:00 etc
I get
BeginTime=25/10/2010 06:00:00
EndTime=26/10/2010 06:00:00
Where I think the correct answer is
BeginTime=26/10/2010 06:00:00
EndTime=27/10/2010 06:00:00
The tick happening at 26/10/2010 06:00:00 should actually first tick of 26/10 session, not last tick of 25/10 session, meaning EndTime in session templates should be excluded from the session times.
The same kind of problems happens with Volume[0].
I have session data on the ES that has a tick of volume 1 happening exactly at 06:00:00
For testing purposes I made an indicator that cumulated volume of the day
protected override void Initialize()
{
Add(new Plot(Color.FromKnownColor(KnownColor.Orange), PlotStyle.Line, "CumVol"));
Overlay = false;
Print(" ");
Print(BarsPeriod.Id+" "+ BarsPeriod.Value);
}
/// <summary>
/// Called on each bar update event (incoming tick)
/// </summary>
protected override void OnBarUpdate()
{
// Use this method for calculating your indicator values. Assign a value to each
// plot below by replacing 'Close[0]' with your own formula.
if (Bars.FirstBarOfSession)
{
if (CurrentBar>0)
Print(Time[1]+" "+cumvol);
cumvol=0;
}
cumvol += (int)Volume[0];
CumVol.Set(cumvol);
}
(session in question is the last one: volume is either 1757247 either 1757246)
10/11/2010 05:59:54 2323115
11/11/2010 05:59:54 2514853
12/11/2010 06:00:00 1757247
Second 26
10/11/2010 05:59:58 2323115
11/11/2010 05:59:58 2514853
12/11/2010 05:59:58 1757247
Second 34
10/11/2010 05:59:54 2323115
11/11/2010 05:59:54 2514853
12/11/2010 06:00:00 1757247
Second 38
09/11/2010 06:00:00 3
10/11/2010 06:00:00 2323115
11/11/2010 06:00:00 2514853
12/11/2010 06:00:00 1757246
Second 39
10/11/2010 06:00:00 2323115
11/11/2010 06:00:00 2514853
12/11/2010 06:00:00 1757247
Second 30
09/11/2010 06:00:00 3
10/11/2010 06:00:00 2323115
11/11/2010 06:00:00 2514853
12/11/2010 06:00:00 1757246
Second 15
10/11/2010 06:00:00 2323115
11/11/2010 06:00:00 2514853
12/11/2010 06:00:00 1757247
Second 20
10/11/2010 06:00:00 2323115
11/11/2010 06:00:00 2514853
12/11/2010 06:00:00 1757247
Second 10
10/11/2010 05:59:50 2323115
11/11/2010 06:00:00 2514853
12/11/2010 06:00:00 1757247
Second 32
09/11/2010 06:00:00 3
10/11/2010 06:00:00 2323115
11/11/2010 06:00:00 2514853
12/11/2010 06:00:00 1757246
Comment