Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Draw Region with two data series
Collapse
X
-
Draw Region with two data series
Bollinger bands with draw region filled works fine with one data series, but if I add a second data series, the plots shift but the draw region filled zone does not shift. Is there a way to correct this or is it just a limitation of draw region? -
Maybe a result of the loss of equidistant spacing?Originally posted by ThatManFromTexas View PostBollinger bands with draw region filled works fine with one data series, but if I add a second data series, the plots shift but the draw region filled zone does not shift. Is there a way to correct this or is it just a limitation of draw region?
-
-
Comment
-
You would need to update this drawing object to have new values. Each drawing object has a "tag" that identifies it, and is used to reference that object.Originally posted by ThatManFromTexas View PostThanks for your reply.
That causes the plots to shift.
My question is .... is there a way to have the DrawRegion filled zone shift with the plots.
DrawRegion(string tag, DateTime startTime, DateTime endTime, IDataSeries series1, IDataSeries series2, Color outlineColor, Color areaColor, int areaOpacity)
If the string "tag" is the same, calling this method can be used to overwrite an existing drawn object with a new one.
Please let me know if I may assist further.Adam P.NinjaTrader Customer Service
Comment
-
-
ThatManFromTexas, do you draw those regions based on indicator plots or custom data series objects?Originally posted by ThatManFromTexas View PostBollinger bands with draw region filled works fine with one data series, but if I add a second data series, the plots shift but the draw region filled zone does not shift. Is there a way to correct this or is it just a limitation of draw region?
Comment
-
I originally plotted the bollinger bands and used DrawRegion to color the zones between the bands.That worked fine except it wouldn't show up when I used custom graphics in the background.Originally posted by NinjaTrader_Bertrand View PostThatManFromTexas, do you draw those regions based on indicator plots or custom data series objects?
I rewrote it plotting the bollinger bands and replaced the DrawRegion with FillPolygon to color the zones between the bands. That solved the problem with the graphics conflict and worked correctly with one data series, but not with two data series.
So I can get 2 out of 3 things I want on one chart with more than one data series and 3 out 3 if I only use 1 data series.
I don't normally use two data series so my standard chart looks like the attached images. It adjusts the background and shading colors according to the trend.
Thanks for your support!
Comment
-
Hello,
I must say the background on your charts is quite stunning, well done and can't say I have ever seen that done before.
Unfortunately any custom drawing method is unsupported as you're aware. If I had a hint for you here I would supply it but without getting deep into it I would not have a worthwhile suggestion for you here.
Am I correct these 3 screenshots are all working correctly? Perhaps if you supplied a screenshot of the problem scenario I might be able to give you something to work on or define in these screenshots where the exact problem is.
-BrettBrettNinjaTrader Product Management
Comment
-
As long as I only use 1 data series, everything works correctly. When the trend changes the background and the shading change in sync with the trend.Originally posted by NinjaTrader_Brett View PostHello,
I must say the background on your charts is quite stunning, well done and can't say I have ever seen that done before.
Unfortunately any custom drawing method is unsupported as you're aware. If I had a hint for you here I would supply it but without getting deep into it I would not have a worthwhile suggestion for you here.
Am I correct these 3 screenshots are all working correctly? Perhaps if you supplied a screenshot of the problem scenario I might be able to give you something to work on or define in these screenshots where the exact problem is.
-Brett
When I add a second data series the plots shift due to Equidistant = False, but the shading from FillPolygon does not shift.
If I use DrawRegion instead of FillPoly , the shading will shift with the plots, but won't show up with the graphical background.
Unless you have a suggestion , I will stick with just one data series.
Thanks for your efforts.
Comment
-
Hello,
Only idea I might have is to revisit this setup:
If I use DrawRegion instead of FillPoly , the shading will shift with the plots, but won't show up with the graphical background.
Specifically is it not displaying due to z axis? Perhaps move the background to paint before the DrawRegion does?
-BrettBrettNinjaTrader Product Management
Comment
-
I'm not familiar with Z axis.Originally posted by NinjaTrader_Brett View PostHello,
Only idea I might have is to revisit this setup:
If I use DrawRegion instead of FillPoly , the shading will shift with the plots, but won't show up with the graphical background.
Specifically is it not displaying due to z axis? Perhaps move the background to paint before the DrawRegion does?
-Brett
Comment
-
That is the 3rd dimension for 3d.
Such as a desk with a pile of papers on it, you cant see the papers that are below other papers due to z axis.
Thus you either program to put the last piece of paper you ant displayed last on the desk or specify the z axis manually which we don't support. If you I believe you you change the background to be drawn first before the DrawRegion it could work.
-BrettBrettNinjaTrader Product Management
Comment
-
I have had the same problem. I use DrawRegion() a lot because it always stays behind the bars, whereas other draw methods draw on top of the line.
(1) Example: Pivot indicator with pivot range. ZOrder affects all plots of the indicator including DrawRectangle(), but DrawRectangle() always plots on top of the pivot lines and hides them. If I use DrawRegion() instead it politely plots behind.
(2) If I use an image file for the background of the plot, I have the same problem as ThatManFromTexas, that is the background plot hides all regions drawn, because DrawRegion() will plot behind the background plot.
(3) If I have two indicators on a chart that use DrawRegion() the region will be plotted behind the image drawn by the third indicator. ZOrder is completely ignored, as DrawRegion() always plots behind.
There should be a way to tell NinjaTrader, in which order the layers shall be plotted. ZOrder simply does not work for DrawRegion().
Originally posted by NinjaTrader_Brett View PostHello,
Only idea I might have is to revisit this setup:
If I use DrawRegion instead of FillPoly , the shading will shift with the plots, but won't show up with the graphical background.
Specifically is it not displaying due to z axis? Perhaps move the background to paint before the DrawRegion does?
-Brett
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by Geovanny Suaza, 02-11-2026, 06:32 PM
|
0 responses
576 views
0 likes
|
Last Post
|
||
|
Started by Geovanny Suaza, 02-11-2026, 05:51 PM
|
0 responses
334 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
553 views
1 like
|
Last Post
|
||
|
Started by RFrosty, 01-28-2026, 06:49 PM
|
0 responses
551 views
1 like
|
Last Post
by RFrosty
01-28-2026, 06:49 PM
|

Comment