Dark Theme
Light Theme
Trading Articles
Article Categories
Article Tools
Welcome to NexusFi: the best trading community on the planet, with over 150,000 members Sign Up Now for Free
Genuine reviews from real traders, not fake reviews from stealth vendors
Quality education from leading professional traders
We are a friendly, helpful, and positive community
We do not tolerate rude behavior, trolling, or vendors advertising in posts
We are here to help, just let us know what you need
You'll need to
register in order to view the content of the threads and start contributing to our community.
It's free for basic access, or support us by becoming an Elite Member -- see if you qualify for a discount below.
-- Big Mike, Site Administrator
(If you already have an account, login at the top of the page)
Updated December 17, 2018
Top Posters
looks_one
ThatManFromTexas
with 39 posts (74 thanks)
looks_two
Fat Tails
with 25 posts (69 thanks)
looks_3
lolu
with 21 posts (9 thanks)
looks_4
Mindset
with 18 posts (38 thanks)
Best Posters
looks_one
Fat Tails
with 2.8 thanks per post
looks_two
Mindset
with 2.1 thanks per post
looks_3
ThatManFromTexas
with 1.9 thanks per post
looks_4
Big Mike
with 1.3 thanks per post
trending_up
89,323 views
thumb_up
263 thanks given
group
48 followers
forum
202 posts
attach_file
66 attachments
May 10th, 2012, 03:38 AM
Berlin, Europe
Legendary Market Wizard
Experience: Advanced
Platform: NinjaTrader, MultiCharts
Broker: Interactive Brokers
Trading: Keyboard
Posts: 9,888 since Mar 2010
Thanks Given: 4,242
Thanks Received: 27,104
josh
Is there a way to build a line on close chart in NT with the area under the line shaded, particularly shaded with a gradient? See the attached picture for an idea of what I'm trying to do.
You need to code a little indicator, which shades the area. You can use the NinjaScript method DrawRegion() to do that.
Can you help answer these questions from other members on NexusFi?
Best Threads (Most Thanked) in the last 7 days on NexusFi
May 10th, 2012, 03:43 AM
Houston,Tx
Experience: Advanced
Platform: NinjaTrader
Broker: Mirus Futures/Zen-Fire
Trading: TF
Posts: 2,265 since Feb 2010
Thanks Given: 1,206
Thanks Received: 4,356
Fat Tails
You need to code a little indicator, which shades the area. You can use the NinjaScript method DrawRegion() to do that.
@Fat Tails
What do you use for the lower boundary?
I can shade between two ema's without a problem so I attempted to use EMA(1) for the upper series and "0" for the lower series but could not get it to work. Also tried CurrentDayOHL().CurrentLow[0] as the lower series, no luck.
Any suggestions would be appreciated.
Thanks!
I'm just a simple man trading a simple plan.
My daddy always said, "Every day above ground is a good day!"
May 10th, 2012, 05:27 AM
Singapore
Experience: Intermediate
Platform: NT
Broker: ib
Trading: MES
Posts: 365 since Sep 2009
Thanks Given: 90
Thanks Received: 291
Code
protected override void Initialize()
{
Add(new Plot(Color.FromKnownColor(KnownColor.Transparent), PlotStyle.Line, "Plot0"));
Add(new Plot(Color.FromKnownColor(KnownColor.Transparent), PlotStyle.Line, "Plot1"));
Overlay = true;
}
protected override void OnBarUpdate()
{
Plot0.Set(Close[0]);
Plot1.Set(ChartControl.CanvasBottom);
DrawRegion("myRegion", CurrentBar, 0, Plot0, Plot1, Color.Blue, Color.Blue, 5);
}
May 10th, 2012, 05:41 AM
Houston,Tx
Experience: Advanced
Platform: NinjaTrader
Broker: Mirus Futures/Zen-Fire
Trading: TF
Posts: 2,265 since Feb 2010
Thanks Given: 1,206
Thanks Received: 4,356
Mindset
Code
protected override void Initialize()
{
Add(new Plot(Color.FromKnownColor(KnownColor.Transparent), PlotStyle.Line, "Plot0"));
Add(new Plot(Color.FromKnownColor(KnownColor.Transparent), PlotStyle.Line, "Plot1"));
Overlay = true;
}
protected override void OnBarUpdate()
{
Plot0.Set(Close[0]);
Plot1.Set(ChartControl.CanvasBottom);
DrawRegion("myRegion", CurrentBar, 0, Plot0, Plot1, Color.Blue, Color.Blue, 5);
}
@Mindset
Thanks!
I wasn't familiar with (ChartControl.CanvasBottom). (See... I told ya'll I wasn't a programmer... )
Is there documentation on ChartControl variables?
I'm just a simple man trading a simple plan.
My daddy always said, "Every day above ground is a good day!"
May 10th, 2012, 05:49 AM
Berlin, Europe
Legendary Market Wizard
Experience: Advanced
Platform: NinjaTrader, MultiCharts
Broker: Interactive Brokers
Trading: Keyboard
Posts: 9,888 since Mar 2010
Thanks Given: 4,242
Thanks Received: 27,104
@Mindset : This can be done in a simpler way.
Code
protected override void Initialize()
{
Add(new Plot(Color.FromKnownColor(KnownColor.Transparent), PlotStyle.Line, "Plot0"));
Overlay = true ;
}
protected override void OnBarUpdate()
{
Values[0].Set(Close[0]);
DrawRegion("myRegion", CurrentBar, 0, Values[0], 0, Color.Blue, Color.Blue, 5);
}
May 10th, 2012, 06:03 AM
Singapore
Experience: Intermediate
Platform: NT
Broker: ib
Trading: MES
Posts: 365 since Sep 2009
Thanks Given: 90
Thanks Received: 291
Is there documentation on ChartControl variables?
No - NT refuse to provide any documentation on their code variables that would be useful.
Fat Tails
Neat - but your method entails another data series and I thought that would be less resource efficient - or am I incorrect in that assumption?
May 10th, 2012, 06:05 AM
Georgia, US
Legendary Market Wizard
Experience: None
Platform: SC
Broker: Denali+Rithmic
Trading: ES, NQ, YM
Posts: 6,312 since Jan 2011
Thanks Given: 6,873
Thanks Received: 18,515
Mindset and Fat Tails, thank you for your help. However, is there a way to make this shaded area a gradient color?
May 10th, 2012, 06:13 AM
Oslo, Norway
Experience: Advanced
Platform: CQG, Excel
Trading: CL
Posts: 1,193 since Apr 2010
I find it almost unfathomable that this isn't a built-in function?
May 10th, 2012, 06:42 AM
Berlin, Europe
Legendary Market Wizard
Experience: Advanced
Platform: NinjaTrader, MultiCharts
Broker: Interactive Brokers
Trading: Keyboard
Posts: 9,888 since Mar 2010
Thanks Given: 4,242
Thanks Received: 27,104
Mindset
Is there documentation on ChartControl variables?
No - NT refuse to provide any documentation on their code variables that would be useful.
Fat Tails
Neat - but your method entails another data series and I thought that would be less resource efficient - or am I incorrect in that assumption?
@Mindset :
No, my method uses a single plot, yours two. Value.Set() or Values[0].Set() is just the correct way setting the values for that single plot.
I bet you introduced additional variables Plot0 and Plot1. My code does not use any variables or properties.
May 10th, 2012, 08:55 AM
Houston,Tx
Experience: Advanced
Platform: NinjaTrader
Broker: Mirus Futures/Zen-Fire
Trading: TF
Posts: 2,265 since Feb 2010
Thanks Given: 1,206
Thanks Received: 4,356
josh
Mindset and Fat Tails, thank you for your help. However, is there a way to make this shaded area a gradient color?
@josh
Here is the single color version. A gradient version will require assistance from the guru's.
You have an option to draw a line on close as well as dot on close.
You have an option to show price bars along with the colored line on close/dot on close, or hide the bars or show just the line or dot.
I'm just a simple man trading a simple plan.
My daddy always said, "Every day above ground is a good day!"
Attached Files
Elite Membership required to download: PriceMountain.zip
Last Updated on December 17, 2018