Attaching a snippet of the code and the output for your reference. Please note in the output the region between the two plots doesn't color Gray. The mathematical condition and Draw region part of the code (referred to above) is from line 146 onwards in the code.
Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Draw Region not coloring between two %D lines (Stochastic Indicator)
Collapse
X
-
Draw Region not coloring between two %D lines (Stochastic Indicator)
Hi - I am using a custom script to plot two %D lines (from the %D of the Stochastic indicator). Everything works fine but I am not able to use "Draw Region()" to color the space between these %D line plots based on a mathematical condition, which is that if the difference between these two %D plots is >25 then it shades the region between the two using Gray color.
Attaching a snippet of the code and the output for your reference. Please note in the output the region between the two plots doesn't color Gray. The mathematical condition and Draw region part of the code (referred to above) is from line 146 onwards in the code.
Tags: None
-
Attaching the code as zip file so that it is easy to import and see in Ninjatrader.Attached Files
-
Hi - I figured that the draw on the price panel was set to true. I have set that to false so the gray shading happens but the shading is happening for the entire region between the plots irrespective of the condition. Hence, please can you advise on why that might be
Comment
-
Hi, thanks for posting. When I add the CurrentBar variable to the Tag parameter, I get unique draw objects in grey on the indicator plot:
Draw.Region(this, "HighGap"+CurrentBar, CurrentBar, 0, D2, D, null, Brushes.Gray, 50, 0);
If you want to shade in an area, we have an example of this here for reference:
https://ninjatraderecosystem.com/use...el-with-color/
The NinjaTrader Ecosystem website is for educational and informational purposes only and should not be considered a solicitation to buy or sell a futures contract or make any other type of investment decision. The add-ons listed on this website are not to be considered a recommendation and it is the reader's responsibility to evaluate any product, service, or company. NinjaTrader Ecosystem LLC is not responsible for the accuracy or content of any product, service or company linked to on this website.Chris L.NinjaTrader Customer Service
- Likes 1
Comment
-
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by rbeckmann05, Yesterday, 06:48 PM
|
1 response
11 views
0 likes
|
Last Post
by bltdavid
Today, 05:43 AM
|
||
Started by llanqui, Today, 03:53 AM
|
0 responses
6 views
0 likes
|
Last Post
by llanqui
Today, 03:53 AM
|
||
Started by burtoninlondon, Today, 12:38 AM
|
0 responses
10 views
0 likes
|
Last Post Today, 12:38 AM | ||
Started by AaronKoRn, Yesterday, 09:49 PM
|
0 responses
15 views
0 likes
|
Last Post
by AaronKoRn
Yesterday, 09:49 PM
|
||
Started by carnitron, Yesterday, 08:42 PM
|
0 responses
11 views
0 likes
|
Last Post
by carnitron
Yesterday, 08:42 PM
|
Comment