For Instance if you have diff= Donchian.Upper[1] - Donchian.Lower[1]; how do I "write something" that will Fill the Entire Color area which is 'diff'.
Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Color Fill the Distance Between Two Plots
Collapse
X
-
Color Fill the Distance Between Two Plots
Hello, Is it possible to Fill the Color Area Between Two Plots.
For Instance if you have diff= Donchian.Upper[1] - Donchian.Lower[1]; how do I "write something" that will Fill the Entire Color area which is 'diff'.Tags: None
-
Hello,
Thank you for your post.
You could color in the difference of two plots by using DrawRegion(). Please see the following link on DrawRegion() http://ninjatrader.com/support/helpG...drawregion.htm
There is an example of using DrawRegion to color between two plots on the Forum. This indicator is the SMARegions and colors in the differences of two SMAs. You can download this indicator from the following link, http://ninjatrader.com/support/forum...tid=4&lpage=9]
Please let us know if we can be of any other assistance.Cody B.NinjaTrader Customer Service
-
I have uploaded the Donchian Channel here:Originally posted by ginx10k View PostHello, Is it possible to Fill the Color Area Between Two Plots.
For Instance if you have diff= Donchian.Upper[1] - Donchian.Lower[1]; how do I "write something" that will Fill the Entire Color area which is 'diff'.
If you cannot download it from www.futures.io, please send me a private message with your e-mail and I will send it to you.
The Donchian Channel has the area between the bands filled. The indicator comes open source. You can easily study how it is done. Basically there are two ways of doing it
-> either use DrawRegion(), which is a NinjaScript command
-> alternatively code a custom plot which would be more accurate and faster
Comment
-
Hello,
I´m trying to draw a region from Donchian Upper to a certain distance in Ticks below the upper, but can´t get it working. From the forum and the samples I can draw regions between MA, DonchianUpper and lower.... but not from and indicator to a distance in ticks.
Thank you
Tony
Comment
-
Hello,
This could be accomplished using the overload set:
Code:DrawRegion(string tag, int startBarsAgo, int endBarsAgo, IDataSeries series, double y, Color outlineColor, Color areaColor, int areaOpacity)
You can supply the Indicators plot as the IDataSeries, and the a calculated value as the double value.
An example would be:
This would draw a region from the Upper line to two ticks below the Upper line.Code:protected override void OnBarUpdate() { if(CurrentBar < 1) return; DrawRegion("Region" + CurrentBar, 0, 1, DonchianChannel(12).Upper, DonchianChannel(12).Upper[0] - 2 * TickSize, Color.Red, Color.Red, 100); }
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by Geovanny Suaza, 02-11-2026, 06:32 PM
|
0 responses
599 views
0 likes
|
Last Post
|
||
|
Started by Geovanny Suaza, 02-11-2026, 05:51 PM
|
0 responses
345 views
1 like
|
Last Post
|
||
|
Started by Mindset, 02-09-2026, 11:44 AM
|
0 responses
103 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
558 views
1 like
|
Last Post
|
||
|
Started by RFrosty, 01-28-2026, 06:49 PM
|
0 responses
558 views
1 like
|
Last Post
by RFrosty
01-28-2026, 06:49 PM
|

Comment