protected override void OnStateChange()
{
if (State == State.SetDefaults)
{
Description = @"Enter the description for your new custom Indicator here.";
Name = "sjTestXLB";
Calculate = Calculate.OnBarClose;
IsOverlay = false;
DisplayInDataBox = true;
DrawOnPricePanel = true;
DrawHorizontalGridLines = true;
DrawVerticalGridLines = true;
PaintPriceMarkers = true;
BarsRequiredToPlot = 0;
ScaleJustification = NinjaTrader.Gui.Chart.ScaleJustification.Right;
IsSuspendedWhileInactive = true;
AddPlot(new Stroke(Brushes.RoyalBlue, 2), PlotStyle.Bar, "TestVal");
}
else if (State == State.Configure)
{
AddDataSeries("XLB", Data.BarsPeriodType.Minute, 1, Data.MarketDataType.Last);
}
}
protected override void OnBarUpdate()
{
if (CurrentBars[0] < 0) return;
if(BarsInProgress == 1){
TestVal[0] += 1;
};
}
Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
AddDataSeries missing data?
Collapse
X
-
AddDataSeries missing data?
I am trying to understand processing multiple bars arrays and I am reading the help guide section on that topic. I've built a simple example script to demonstrate an issue I am having. In my case, I am adding an additional 1 minute bars object and each time OnBarUpdate processes this additional bars array, I am adding a 1 count to a plot. I am expecting that the plot will show me 390 updates per day but it is very inconsistent which makes me think I am not understanding something. Here is the code as well as a short video to show my results:
Here is a quick video demonstrating by results:Code:
Tags: None
-
Hello swcooke,
Thank you for your note.
This looks like a data issue, possibly to do with bar caching - I'm seeing it return 390 every day on my end. Let's have you delete your cache and test again.
To delete the cache, follow the steps below.- Shut down NinjaTrader.
- Open the Documents > NinjaTrader 8 > db folder.
- Delete the sub-folder named 'cache'.
- Restart NinjaTrader and test.
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by Geovanny Suaza, 02-11-2026, 06:32 PM
|
0 responses
671 views
0 likes
|
Last Post
|
||
|
Started by Geovanny Suaza, 02-11-2026, 05:51 PM
|
0 responses
379 views
1 like
|
Last Post
|
||
|
Started by Mindset, 02-09-2026, 11:44 AM
|
0 responses
111 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
575 views
1 like
|
Last Post
|
||
|
Started by RFrosty, 01-28-2026, 06:49 PM
|
0 responses
582 views
1 like
|
Last Post
by RFrosty
01-28-2026, 06:49 PM
|

Comment