Announcement
Collapse
Looking for a User App or Add-On built by the NinjaTrader community?
Visit NinjaTrader EcoSystem and our free User App Share!
Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less
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? -
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
-
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
-
-
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?BertrandNinjaTrader Customer Service
Comment
-
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.
-Brett
Comment
-
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?
-Brett
Comment
-
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.
-Brett
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 warpinator, Today, 10:44 AM
|
1 response
5 views
0 likes
|
Last Post Today, 11:10 AM | ||
Started by kevinenergy, 02-17-2023, 12:42 PM
|
121 responses
2,861 views
1 like
|
Last Post
by RedRock
Today, 11:09 AM
|
||
Started by AlgoDreamer, Today, 10:39 AM
|
1 response
11 views
0 likes
|
Last Post Today, 11:01 AM | ||
Started by Brillo, Today, 10:35 AM
|
1 response
4 views
0 likes
|
Last Post Today, 10:51 AM | ||
Started by FAQtrader, 04-25-2024, 12:00 PM
|
13 responses
208 views
0 likes
|
Last Post Today, 10:42 AM |
Comment