Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Draw.Region slow when scrolling mouse wheel
Collapse
X
-
Draw.Region bug for negative replacements
When a negative displacement is used (pretty unusual), there are increased gaps in the fill area, see chart below.
-
RC2 - Draw.Region bug not fixed
With RC2 Draw.Region still does not work properly when the overload providing for a displacement is used.
The area is not filled when the bar to which Draw.Region() is attached is within the first N bars on the visible section of the chart, where N is the displacement.
For example the chart below has 9 bearish bars and the area is not filled with a displacement of 10 bars.
Leave a comment:
-
Here is the answer:
Code:Up_Zone.EndAnchor.DrawnOnBar = 0; Up_Zone.StartAnchor.DrawnOnBar = CurrentBar;
Leave a comment:
-
When You put Draw.Region in OnBarUpdate() method - You creating new Region object on each bar again and again.
Regions work march more faster in NT7 in this implementation:
Now I searching way to do same in NT8.Code:IRegion Up_Zone; void override OnStartUp() { Up_Zone = DrawRegion("Up_Zone", 0, 0, LineUp1, LineUp2, Color.Empty, Color.Blue, 10 ); } void override OnBarUpdate() { Up_Zone.EndBarsAgo = 0; }
Leave a comment:
-
Hi Harry and kognam,
This bug is being tracked with ID #NTEIGHT-9927.
(I think we just needed to get the terminology right to make sure everyone is on the same page.)
Leave a comment:
-
I am glad that you have finally decided that this is a bug after all, but, with all due respect, this was first pointed out more than 6 months ago.Originally posted by NinjaTrader_ChelseaB View PostHi Harry,
I'm actually just now understanding what you were trying to point out.
The region is not being displaced from the first actual bar (as in bar 0), it is being displaced from the left side of the rendered area, which would be a bug.
When you mentioned in post #11 "For example if a displacement of 20 bars is selected, the region will not be plotted for the first 20 bars on the chart.", I understood this as the first 20 bars from bar 0 will not be plotted, which is the expected behavior.
I've put in a bug report about this. Once I have a tracking ID for this bug report I will post this ID in this thread.
Thank you for your clarification to get me pointed in the right direction.
ref: http://ninjatrader.com/support/forum...ad.php?t=80674
I have coded around it, and my implementation shows the cloud from the start of the chart. Still, it is a bug.
Leave a comment:
-
Hi Harry,
I'm actually just now understanding what you were trying to point out.
The region is not being displaced from the first actual bar (as in bar 0), it is being displaced from the left side of the rendered area, which would be a bug.
When you mentioned in post #11 "For example if a displacement of 20 bars is selected, the region will not be plotted for the first 20 bars on the chart.", I understood this as the first 20 bars from bar 0 will not be plotted, which is the expected behavior.
I've put in a bug report about this. Once I have a tracking ID for this bug report I will post this ID in this thread.
Thank you for your clarification to get me pointed in the right direction.Last edited by NinjaTrader_ChelseaB; 05-27-2016, 12:54 PM.
Leave a comment:
-
Originally posted by NinjaTrader_ChelseaB View PostHello Harry,
Are you using displacement on the Draw.Region call itself?
(This would cause the first bars up to the displacement to not be plotted)
Draw.Region(this, "region", CurrentBar, 0, Values[0], Values[1], Brushes.Transparent, Brushes.Blue, 9, 20);
Draw.Region(NinjaScriptBase owner, string tag, int startBarsAgo, int endBarsAgo, ISeries<double> series1, ISeries<double> series2, Brush outlineBrush, Brush areaBrush, int areaOpacity, [int displacement])
If so, this would be the expected behavior when using displacement on the Draw.Region() object. The bars up to the displacement number are not plotted and the slots after the last bar will be plotted up to the displacement number.
Or are you setting the Displacement of the entire indicator and not using the displacement overload on the draw region?
Draw.Region(this, "region", CurrentBar, 0, Values[0], Values[1], Brushes.Transparent, Brushes.Blue, 9);
With the entire indicator set with Displacement this should not cause the region to be displaced. This should only displace the plots.
Thank you for your quick answer. Actually there are two different cases.
(1) First case (BollingerBands): When I am displacing the Bollinger Bands, I also wish to displace DrawRegion along with it. This is obvious, as otherwise the region would not match the plots. For that purpose I use the displacement feature or DarwRegion. The result is not satisfactory, as part of the area between the plots remains empty.
(2) Second case (Ichimoku): In this case it is not the entire indicator which is displaced, but the DrawRegion() is used to plot the cloud forward. But also in this case part of the cloud is missing and as you see from my screenshot, there is a big hole in the middle of the chart.
I want to point out that the way the displacement feature has been implemented for DrawRegion(), it is entirely useless. It is NOT working as expected and cannot be used as needed for correctly implementing indicators.
Leave a comment:
-
Hello Harry,
Are you using displacement on the Draw.Region call itself?
(This would cause the first bars up to the displacement to not be plotted)
Draw.Region(this, "region", CurrentBar, 0, Values[0], Values[1], Brushes.Transparent, Brushes.Blue, 9, 20);
Draw.Region(NinjaScriptBase owner, string tag, int startBarsAgo, int endBarsAgo, ISeries<double> series1, ISeries<double> series2, Brush outlineBrush, Brush areaBrush, int areaOpacity, [int displacement])
If so, this would be the expected behavior when using displacement on the Draw.Region() object. The bars up to the displacement number are not plotted and the slots after the last bar will be plotted up to the displacement number.
Or are you setting the Displacement of the entire indicator and not using the displacement overload on the draw region?
Draw.Region(this, "region", CurrentBar, 0, Values[0], Values[1], Brushes.Transparent, Brushes.Blue, 9);
With the entire indicator set with Displacement this should not cause the region to be displaced. This should only displace the plots.
Leave a comment:
-
DrawRegion with Displacement Bug
When DrawRegion() is used with a displacement, the region is not properly filled.
For example if a displacement of 20 bars is selected, the region will not be plotted for the first 20 bars on the chart.
Below are two samples that show the problem.
First chart: Multiple Bollinger Bands with a displacement of 20 bars
Second chart: An Ichimoku indicator which uses DrawRegion to plot the Kumo (cloud) forward. When there are less than 26 bars on the chart, the forward section of the cloud is incomplete. (The code only uses the displacement for the forward section of the cloud, but not for the main cloud, which is created from a displaced DataSeries.)Last edited by Harry; 05-27-2016, 05:40 AM.
Leave a comment:
-
Thanks Harry - we'll be applying some optimizations to the @Reigion class in B6 - NTEIGHT-8867
Leave a comment:
-
In fact it was not a crash. It just had that turning symbol instead of the mouse arrow, but I was still able to click the button and it worked.Originally posted by NinjaTrader_Matthew View PostThanks I'll have a look, I appreciate it.
Regarding the crash, is that always reproducible? Was there an existing bug report on that in B5?
Leave a comment:
-
Thanks I'll have a look, I appreciate it.Originally posted by Harry View PostI have basically taken the Bollinger indicator, added two more channels and then used Draw.Region() to fill the segments between the channels.
I have used one tag for the entire series. Otherwise it would take over a minute to load the indicator, and CPU load would be further increased.
I cannot attach the indicator script, because NinjaTrader 8 hangs (crash) when I try to export an indicator file.Code:if(Opacity3 > 0) { Draw.Region(this,"UB3", CurrentBar , 0, Upper3, Upper2, transparentBrush, OuterAreaBrush, Opacity3); Draw.Region(this,"LB3", CurrentBar , 0, Lower2, Lower3, transparentBrush, OuterAreaBrush, Opacity3); } if(Opacity2 > 0) { Draw.Region(this,"UB2", CurrentBar , 0, Upper2, Upper1, transparentBrush, MidAreaBrush, Opacity2); Draw.Region(this,"LB2", CurrentBar , 0, Lower1, Lower2, transparentBrush, MidAreaBrush, Opacity2); } if(Opacity1 > 0) { Draw.Region(this,"UB1", CurrentBar , 0, Upper1, Middle, transparentBrush, InnerAreaBrush, Opacity1); Draw.Region(this,"LB1", CurrentBar , 0, Middle, Lower1, transparentBrush, InnerAreaBrush, Opacity1); }
Regarding the crash, is that always reproducible? Was there an existing bug report on that in B5?
Leave a comment:
-
I have basically taken the Bollinger indicator, added two more channels and then used Draw.Region() to fill the segments between the channels.Originally posted by NinjaTrader_Matthew View PostThanks for the detailed report. There are definitely some performance improvements in this area we have scheduled as we do ongoing maintenance throughout beta. I'm going to check with development on your scenario to see where we are.
Just so we're looking at apples to apples, can you provide the script you are testing with?
Or can you clarify how you've implemented Draw.Region? When you say that you are drawing the areas between the bands, is this through one instance (e.g., using one tag) for the whole series? Or are you drawing on multiple bars and creating new instances?
I have used one tag for the entire series. Otherwise it would take over a minute to load the indicator, and CPU load would be further increased.
Indicator is attached.Code:if(Opacity3 > 0) { Draw.Region(this,"UB3", CurrentBar , 0, Upper3, Upper2, transparentBrush, OuterAreaBrush, Opacity3); Draw.Region(this,"LB3", CurrentBar , 0, Lower2, Lower3, transparentBrush, OuterAreaBrush, Opacity3); } if(Opacity2 > 0) { Draw.Region(this,"UB2", CurrentBar , 0, Upper2, Upper1, transparentBrush, MidAreaBrush, Opacity2); Draw.Region(this,"LB2", CurrentBar , 0, Lower1, Lower2, transparentBrush, MidAreaBrush, Opacity2); } if(Opacity1 > 0) { Draw.Region(this,"UB1", CurrentBar , 0, Upper1, Middle, transparentBrush, InnerAreaBrush, Opacity1); Draw.Region(this,"LB1", CurrentBar , 0, Middle, Lower1, transparentBrush, InnerAreaBrush, Opacity1); }Attached FilesLast edited by Harry; 09-25-2015, 02:51 PM.
Leave a comment:
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by Mindset, Yesterday, 06:46 AM
|
0 responses
14 views
0 likes
|
Last Post
by Mindset
Yesterday, 06:46 AM
|
||
|
Started by M4ndoo, 04-20-2026, 05:21 PM
|
0 responses
25 views
0 likes
|
Last Post
by M4ndoo
04-20-2026, 05:21 PM
|
||
|
Started by M4ndoo, 04-19-2026, 05:54 PM
|
0 responses
16 views
0 likes
|
Last Post
by M4ndoo
04-19-2026, 05:54 PM
|
||
|
Started by cmoran13, 04-16-2026, 01:02 PM
|
0 responses
82 views
0 likes
|
Last Post
by cmoran13
04-16-2026, 01:02 PM
|
||
|
Started by PaulMohn, 04-10-2026, 11:11 AM
|
0 responses
51 views
0 likes
|
Last Post
by PaulMohn
04-10-2026, 11:11 AM
|


Leave a comment: