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 CarlTrading, 03-31-2026, 09:41 PM
|
1 response
81 views
1 like
|
Last Post
|
||
|
Started by CarlTrading, 04-01-2026, 02:41 AM
|
0 responses
42 views
0 likes
|
Last Post
by CarlTrading
04-01-2026, 02:41 AM
|
||
|
Started by CaptainJack, 03-31-2026, 11:44 PM
|
0 responses
64 views
2 likes
|
Last Post
by CaptainJack
03-31-2026, 11:44 PM
|
||
|
Started by CarlTrading, 03-30-2026, 11:51 AM
|
0 responses
68 views
0 likes
|
Last Post
by CarlTrading
03-30-2026, 11:51 AM
|
||
|
Started by CarlTrading, 03-30-2026, 11:48 AM
|
0 responses
55 views
0 likes
|
Last Post
by CarlTrading
03-30-2026, 11:48 AM
|

Comment