if(BarsInProgress == 0)
{
DebugPrint(debugSection.OnBarUpdate,"OnBarUpdate getSignalPackage 1");
thisSignalPackage = getSignalPackage();
}
Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
BarsInProgress == 0 does execute in live, 1 does
Collapse
X
-
BarsInProgress == 0 does execute in live, 1 does
In my strategy analyzer, i'm able to separate actions across barsinprogress 0 (5min) and 1 (1min). When I run the strategy live, this doesn't work. In fact, BarsInProgress == 0 seems to not execute at all. This attachments contains my onbarupdate code, it's not usable as standalone but this section should execute every 5 min but it doesnt
stranger yet, index 0 seems to not exist?Code:Tags: None
-
Hello Skifree,
Try the adding the following to the very top of OnBarUpdate() (as the first line), exactly as shown here with no modifications.
Temporarily comment out all other comments.Code:Print(string.Format("{0} | BarsInProgress: {1}, State: {2}, {3} {4} {5} -- BIP 0: {6} {7} {8}", Time[0], BarsInProgress, State, Instrument.FullName, BarsArray[BarsInProgress].BarsPeriod.Value, BarsArray[BarsInProgress].BarsPeriod.BarsPeriodType, Instruments[0].FullName, BarsArray[0].BarsPeriod.Value, BarsArray[0].BarsPeriod.BarsPeriodType));
Reload the script, save the output from the output window to a text file (right-click the output window > select Save as), and attach the text file to your reply.Chelsea B.NinjaTrader Customer Service
Comment
-
I had to trim a few days to meet the file size req, but it looks like both bars are here?Attached Files
Comment
-
Hello Skifree,
The output is showing BarsInProgress 0 is definitely updating OnBarUpdate() every 5 minutes.
4/18/2024 8:45:00 PM | BarsInProgress: 0, State: Historical, MGC JUN24 5 Minute -- BIP 0: MGC JUN24 5 Minute
4/18/2024 8:50:00 PM | BarsInProgress: 0, State: Historical, MGC JUN24 5 Minute -- BIP 0: MGC JUN24 5 Minute
Now that this is confirmed, and we know the script is processing the data, you can comment out this print and focus on the conditions of your logic.
Start at the first condition you don't think BarsInProgress 0 is making it past. Print the time of the bar and all values used in the condition.Chelsea B.NinjaTrader Customer Service
Comment
-
Ok, I figured this out - There was an original filter to skip some bars that wasn't working with multi-time series, and at the same time there was not enough bars to continue the entire loading of the strategy. Thank you for the help - that's a useful output to have on hand.
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by NullPointStrategies, Yesterday, 05:17 AM
|
0 responses
56 views
0 likes
|
Last Post
|
||
|
Started by argusthome, 03-08-2026, 10:06 AM
|
0 responses
133 views
0 likes
|
Last Post
by argusthome
03-08-2026, 10:06 AM
|
||
|
Started by NabilKhattabi, 03-06-2026, 11:18 AM
|
0 responses
73 views
0 likes
|
Last Post
|
||
|
Started by Deep42, 03-06-2026, 12:28 AM
|
0 responses
45 views
0 likes
|
Last Post
by Deep42
03-06-2026, 12:28 AM
|
||
|
Started by TheRealMorford, 03-05-2026, 06:15 PM
|
0 responses
49 views
0 likes
|
Last Post
|

Comment