NexusFi: Find Your Edge


Home Menu

 





Make Charts Pretty!


Discussion in NinjaTrader

Updated
      Top Posters
    1. looks_one ThatManFromTexas with 39 posts (74 thanks)
    2. looks_two Fat Tails with 25 posts (69 thanks)
    3. looks_3 lolu with 21 posts (9 thanks)
    4. looks_4 Mindset with 18 posts (38 thanks)
      Best Posters
    1. looks_one Fat Tails with 2.8 thanks per post
    2. looks_two Mindset with 2.1 thanks per post
    3. looks_3 ThatManFromTexas with 1.9 thanks per post
    4. looks_4 Big Mike with 1.3 thanks per post
    1. trending_up 79,520 views
    2. thumb_up 263 thanks given
    3. group 48 followers
    1. forum 202 posts
    2. attach_file 66 attachments




 
Search this Thread

Make Charts Pretty!

  #61 (permalink)
 
Fat Tails's Avatar
 Fat Tails 
Berlin, Europe
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,103


josh View Post
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.

Reply With Quote
Thanked by:

Can you help answer these questions
from other members on NexusFi?
NT7 Indicator Script Troubleshooting - Camarilla Pivots
NinjaTrader
How to apply profiles
Traders Hideout
Pivot Indicator like the old SwingTemp by Big Mike
NinjaTrader
ZombieSqueeze
Platforms and Indicators
REcommedations for programming help
Sierra Chart
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
What is Markets Chat (markets.chat) real-time trading ro …
72 thanks
Spoo-nalysis ES e-mini futures S&P 500
55 thanks
Just another trading journal: PA, Wyckoff & Trends
28 thanks
Bigger Wins or Fewer Losses?
24 thanks
The Program
16 thanks
  #62 (permalink)
 
ThatManFromTexas's Avatar
 ThatManFromTexas 
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,355


Fat Tails View Post
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!"
Reply With Quote
Thanked by:
  #63 (permalink)
 
Mindset's Avatar
 Mindset 
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);
        }

Started this thread Reply With Quote
  #64 (permalink)
 
ThatManFromTexas's Avatar
 ThatManFromTexas 
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,355


Mindset View Post

 
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!"
Reply With Quote
Thanked by:
  #65 (permalink)
 
Fat Tails's Avatar
 Fat Tails 
Berlin, Europe
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,103

@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);
        }

Reply With Quote
  #66 (permalink)
 
Mindset's Avatar
 Mindset 
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?

Started this thread Reply With Quote
Thanked by:
  #67 (permalink)
 
josh's Avatar
 josh 
Georgia, US
Legendary Market Wizard
 
Experience: None
Platform: SC
Broker: Denali+Rithmic
Trading: ES, NQ, YM
Posts: 6,243 since Jan 2011
Thanks Given: 6,781
Thanks Received: 18,249

Mindset and Fat Tails, thank you for your help. However, is there a way to make this shaded area a gradient color?

Reply With Quote
Thanked by:
  #68 (permalink)
 
Lornz's Avatar
 Lornz 
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?

Visit my NexusFi Trade Journal Reply With Quote
  #69 (permalink)
 
Fat Tails's Avatar
 Fat Tails 
Berlin, Europe
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,103


Mindset View Post
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.

Reply With Quote
Thanked by:
  #70 (permalink)
 
ThatManFromTexas's Avatar
 ThatManFromTexas 
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,355



josh View Post
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
Reply With Quote
Thanked by:




Last Updated on December 17, 2018


© 2024 NexusFi™, s.a., All Rights Reserved.
Av Ricardo J. Alfaro, Century Tower, Panama City, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada)
All information is for educational use only and is not investment advice. There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
About Us - Contact Us - Site Rules, Acceptable Use, and Terms and Conditions - Privacy Policy - Downloads - Top
no new posts