I have a problem with BarsSinceEntry returning values that are way too high (like 3700 instead of 2)
I've tried to replicate the behaviour, and I do seem to see something odd. I ran the following strategy on 02 dec 2009 for future 6A 03-10, primary series 60 min.
protected override void Initialize()
{
Add(PeriodType.Minute, 1);
}
protected override void OnBarUpdate()
{
EnterLong();
Print("Bars0 = "+"("+BarsInProgress+") "+BarsSinceEntry(0,"",0));
Print("Bars1 = "+"("+BarsInProgress+") "+BarsSinceEntry(1,"",0));
if (Time[0].Hour == 17) {ExitLong();}
}
In the output, I see odd values, like
Bars1 = (1) 14
Bars0 = (1) 14
Bars1 = (1) 14
Bars0 = (0) 15
Bars1 = (0) 15
Bars0 = (1) 15
Bars1 = (1) 15
Bars0 = (1) 1036
Bars1 = (1) 1036
Bars0 = (1) 15
Bars1 = (1) 15
Bars0 = (1) 1038
Bars1 = (1) 1038
Bars0 = (1) 15
Bars1 = (1) 15
Bars0 = (1) 1040
Bars1 = (1) 1040
Bars0 = (1) 15
Bars1 = (1) 15
Bars0 = (1) 1042
Bars1 = (1) 1042
and
Bars1 = (1) 3
Bars0 = (1) 3
Bars1 = (1) 3
Bars0 = (1) 1316
Bars1 = (1) 1316
Bars0 = (1) 1317
and
Bars0 = (1) 2372
Bars1 = (1) 2372
Bars0 = (0) 2373
Bars1 = (0) 2373
Bars0 = (1) 21
Bars1 = (1) 21
Bars0 = (1) 2356
Eventually all output is in the thousands, until the position is flattened.
Please advise
thanks
Dave

Comment