Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Mixed minute/daily time frames?
Collapse
X
-
I have IB and OpenTick. Looks like OnBarUpdate is not being called. I have a Print statement in Iniialize and one in OnBarUpdate, I get the Print form Initialize, but not the one from OnbarUpdate
Originally posted by NinjaTrader_Ray View PostAssuming your data provider supports daily bars then, yes it should be fine.
If this is still not the case, can you elaborate on what you mean by not running? Error messages in the log? No OnBarUpdate() being called etc..
Comment
-
Please check your logs for any errors and ensure you do in fact get daily data.
I just ran a quick test using code below on an eSignal connection and I got the output I expected.
protectedoverridevoid Initialize()
{
Add("DELL", PeriodType.Day, 1);
CalculateOnBarClose = true;
BarsRequired = 0;
}
///<summary>
/// Called on each bar update event (incoming tick)
///</summary>
protectedoverridevoid OnBarUpdate()
{
Print(BarsInProgress + " " + Time[0]);
}
RayNinjaTrader Customer Service
Comment
-
I am getting the following behavior that I do not expect
Using DAILY chart
--------------
protected override void Initialize()
{
CalculateOnBarClose = false;
Add(PeriodType.Day, 1);
}
protected override void OnBarUpdate() {
Print("BarsInProgress " + BarsInProgress);
}
BarsInProgress 0
BarsInProgress 1
BarsInProgress 0
BarsInProgress 1
BarsInProgress 0
BarsInProgress 1
...and so on
Using DAILY chart
--------------
protected override void Initialize()
{
CalculateOnBarClose = false;
Add(PeriodType.Minute, 10);
Add(PeriodType.Day, 1);
}
protected override void OnBarUpdate() {
Print("BarsInProgress " + BarsInProgress);
}
BarsInProgress 1
BarsInProgress 1
BarsInProgress 1
BarsInProgress 1
BarsInProgress 1
BarsInProgress 1
...and so on
Using 10min chart
--------------
protected override void Initialize()
{
CalculateOnBarClose = false;
Add(PeriodType.Day, 1);
}
protected override void OnBarUpdate() {
Print("BarsInProgress " + BarsInProgress);
}
No Print output
Using 10min chart
--------------
protected override void Initialize()
{
CalculateOnBarClose = false;
Add(PeriodType.Minute, 10);
Add(PeriodType.Day, 1);
}
protected override void OnBarUpdate() {
Print("BarsInProgress " + BarsInProgress);
}
No Print output
Comment
-
-
I suspect not enough data issues on your end? I get prints just fine.
Case3:
5/22/2007 4:20:00 PM BarsInProgress 0
5/22/2007 4:30:00 PM BarsInProgress 0
5/22/2007 4:40:00 PM BarsInProgress 0
5/22/2007 4:50:00 PM BarsInProgress 0
5/22/2007 5:00:00 PM BarsInProgress 0
5/22/2007 12:00:00 AM BarsInProgress 1
Case4:
5/9/2007 4:30:00 PM BarsInProgress 0
5/9/2007 4:30:00 PM BarsInProgress 1
5/9/2007 4:50:00 PM BarsInProgress 0
5/9/2007 4:50:00 PM BarsInProgress 1
5/9/2007 5:00:00 PM BarsInProgress 0
5/9/2007 5:00:00 PM BarsInProgress 1
5/9/2007 12:00:00 AM BarsInProgress 2Josh P.NinjaTrader Customer Service
Comment
-
Problem is caused by multiple time frames
Hi, I just came across this and I was having the same problem. The way that I solved it was to set my session template to "Default 24/7". For some reason if you use "US Equities RTH" or something restricting the strategy won't run if you have both PeriodType.Minute and PeriodType.Day bars.
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by Geovanny Suaza, 02-11-2026, 06:32 PM
|
0 responses
650 views
0 likes
|
Last Post
|
||
|
Started by Geovanny Suaza, 02-11-2026, 05:51 PM
|
0 responses
370 views
1 like
|
Last Post
|
||
|
Started by Mindset, 02-09-2026, 11:44 AM
|
0 responses
109 views
0 likes
|
Last Post
by Mindset
02-09-2026, 11:44 AM
|
||
|
Started by Geovanny Suaza, 02-02-2026, 12:30 PM
|
0 responses
574 views
1 like
|
Last Post
|
||
|
Started by RFrosty, 01-28-2026, 06:49 PM
|
0 responses
577 views
1 like
|
Last Post
by RFrosty
01-28-2026, 06:49 PM
|

Comment