Thank you in advance for any help.
Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Error on Reqesting Bars Series
Collapse
X
-
Error on Reqesting Bars Series
Hello - I am trying to build an indicator that plots the OBV with 3 smas. The attached code compiles (see attached txt file) but when I try to add it to a chart I get this message:
Any suggestions?
Thank you in advance for any help.Last edited by JohnS52; 11-07-2021, 12:23 PM.Tags: None
-
Hello JohnS52,
As a tip, to export a NinjaTrader 8 NinjaScript so this can be shared and imported by the recipient do the following:- Click Tools -> Export -> NinjaScript...
- Click the 'add' link -> check the box(es) for the script(s) and reference(s) you want to include
- Click the 'Export' button
- Enter a unique name for the file in the value for 'File name:'
- Choose a save location -> click Save
- Click OK to clear the export location message
- (My) Documents/NinjaTrader 8/bin/Custom/ExportNinjaScript/<export_file_name.zip>
http://ninjatrader.com/support/helpG...-us/export.htm
Does the chart load without the indicator?
What do you have the Load data based on set to in the Data Series?Chelsea B.NinjaTrader Customer Service
-
Hi Chelsea - Here's the Export - see attached.
I tried the indicator on both ES 12-21 and RTY 12-21, both pre-session (before 6 pm Sunday) and during session (after 6 pm) to no avail.
All the other indicators are working fine. The Charts load fine without this indicator. Mystified - I am probably overlooking something obvious.Attached Files
Comment
-
Hello Chelsea -
I moved the indicators to State.DateLoaded (see attached). I no longer get the Error on Requesting Bars message and it compiles fine but none of the lines actually plot. All I get is an empty box on the chart with the label attached. The AddPlots should be in State.SetDefaults, right? I tried setting DrawOnPricePanel to both true and false to no avail. Any suggestions? What am I doing wrong?Attached Files
Comment
-
Hello JohnS52,
In the script you have provided, no values are being set to the plots in OnBarUpdate().
My guess is you are wanting to set Values[0] to the value of the OBV1.
Values[0][0] = OBV1[0];
Values[1] you are probably wanting to set to the SMA1.
Values[1][0] = SMA1[0];
etc..
Below is a link to the help guide on the Values collection in the help guide.
https://ninjatrader.com/support/help...nt8/values.htm
As well as AddPlot() which has example code.
https://ninjatrader.com/support/help...t8/addplot.htm
Have a look at the MACD indicator which is a simple indicator that has multiple plots.Chelsea B.NinjaTrader Customer Service
Comment
-
Many thanks.That worked perfectly. Attached is the code, in case anyone wants to see it.Attached Files
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by Geovanny Suaza, 02-11-2026, 06:32 PM
|
0 responses
571 views
0 likes
|
Last Post
|
||
|
Started by Geovanny Suaza, 02-11-2026, 05:51 PM
|
0 responses
331 views
1 like
|
Last Post
|
||
|
Started by Mindset, 02-09-2026, 11:44 AM
|
0 responses
101 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
549 views
1 like
|
Last Post
|
||
|
Started by RFrosty, 01-28-2026, 06:49 PM
|
0 responses
549 views
1 like
|
Last Post
by RFrosty
01-28-2026, 06:49 PM
|

Comment