Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Display Volumetric Code on Range Chart
Collapse
X
-
Display Volumetric Code on Range Chart
I created a custom indicator using volumetric bars. The code works fine on volumetric bar chart however I want the indicator to populate on the range chart instead. The indicator draws a blue box when a condition is met. To be able to get the volumetric indicator to populate on the range chart, I opened a chart and inputted two data series (4 range and 4 range volumetric). I added the indicator to the chart and assigned the Input Series to the 4 Range Volumetric (since the indicator code uses Volumetric bars) and assigned the Panel to 1 (the 4 range chart). Why wouldn't this work? See below for the snip of the code. See below snip of the chart and the indicator parameters. The blue box only seems to show up on the 4 Range Volumetric chart.
Tags: None
-
Hello algospoke,
To use volumetric data the script needs to add that data in its code, you can't access other bar series from the chart.
After adding the volumetric series by using AddVolumetric you would also need to change the code to BarsArray which is shown in the sample for using volumetric data.
https://ninjatrader.com/support/help...tric_bars2.htmprotected override void OnBarUpdate()
{
if (Bars == null)
return;
// script, you could call AddVolumetric() in State.Configure and then for example use
// NinjaTrader.NinjaScript.BarsTypes.VolumetricBarsTy pe barsType = BarsArray[1].BarsType as
// NinjaTrader.NinjaScript.BarsTypes.VolumetricBarsTy pe;
-
Jesse,
Awesome. Thanks for the feedback. Do I have to hard code the instrument and the BarsPeriodType in AddVolumetric? For example, once I add the indicator to the chart and if I want to change the instrument on the chart or the time frame, I don't want to have to always go back to the code to fix it.
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by Geovanny Suaza, 02-11-2026, 06:32 PM
|
0 responses
558 views
0 likes
|
Last Post
|
||
|
Started by Geovanny Suaza, 02-11-2026, 05:51 PM
|
0 responses
324 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
545 views
1 like
|
Last Post
|
||
|
Started by RFrosty, 01-28-2026, 06:49 PM
|
0 responses
547 views
1 like
|
Last Post
by RFrosty
01-28-2026, 06:49 PM
|

Comment