Make Charts Pretty! - NinjaTrader Programming | futures.io
futures.io futures trading


Make Charts Pretty!
Started: by Mindset Views / Replies:37,104 / 191
Last Reply: Attachments:67

Welcome to futures.io.

Welcome, Guest!

This forum was established to help traders (especially futures traders) by openly sharing indicators, strategies, methods, trading journals and discussing the psychology of trading.

We are fundamentally different than most other trading forums:
  • We work extremely hard to keep things positive on our forums.
  • We do not tolerate rude behavior, trolling, or vendor advertising in posts.
  • We firmly believe in openness and encourage sharing. The holy grail is within you, it is not something tangible you can download.
  • We expect our members to participate and become a part of the community. Help yourself by helping others.


You'll need to register in order to view the content of the threads and start contributing to our community. It's free and simple, and we will never resell your private information.

-- Big Mike

Reply
 67  
 
Thread Tools Search this Thread
 

Make Charts Pretty!

  #61 (permalink)
Elite Member
Berlin, Europe
 
Futures Experience: Advanced
Platform: NinjaTrader, MultiCharts
Broker/Data: Interactive Brokers
Favorite Futures: Keyboard
 
Fat Tails's Avatar
 
Posts: 9,538 since Mar 2010
Thanks: 4,215 given, 24,939 received


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
The following 2 users say Thank You to Fat Tails for this post:
 
  #62 (permalink)
Elite Member
Houston,Tx
 
Futures Experience: Advanced
Platform: NinjaTrader
Broker/Data: Mirus Futures/Zen-Fire
Favorite Futures: TF
 
ThatManFromTexas's Avatar
 
Posts: 2,302 since Feb 2010
Thanks: 1,208 given, 4,281 received


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
The following user says Thank You to ThatManFromTexas for this post:
 
  #63 (permalink)
Elite Member
UK
 
Futures Experience: Intermediate
Platform: NT
Broker/Data: ib
Favorite Futures: Electric Guitar
 
Mindset's Avatar
 
Posts: 355 since Sep 2009
Thanks: 88 given, 284 received

Simple solution?


Please register on futures.io to view futures trading content such as post attachment(s), image(s), and screenshot(s).

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


Last edited by Mindset; May 10th, 2012 at 06:31 AM. Reason: add pic
Reply With Quote
The following 6 users say Thank You to Mindset for this post:
 
  #64 (permalink)
Elite Member
Houston,Tx
 
Futures Experience: Advanced
Platform: NinjaTrader
Broker/Data: Mirus Futures/Zen-Fire
Favorite Futures: TF
 
ThatManFromTexas's Avatar
 
Posts: 2,302 since Feb 2010
Thanks: 1,208 given, 4,281 received


Mindset View Post
Please register on futures.io to view futures trading content such as post attachment(s), image(s), and screenshot(s).

 
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
The following user says Thank You to ThatManFromTexas for this post:
 
  #65 (permalink)
Elite Member
Berlin, Europe
 
Futures Experience: Advanced
Platform: NinjaTrader, MultiCharts
Broker/Data: Interactive Brokers
Favorite Futures: Keyboard
 
Fat Tails's Avatar
 
Posts: 9,538 since Mar 2010
Thanks: 4,215 given, 24,939 received

Futures Edge on FIO
@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
The following 4 users say Thank You to Fat Tails for this post:
 
  #66 (permalink)
Elite Member
UK
 
Futures Experience: Intermediate
Platform: NT
Broker/Data: ib
Favorite Futures: Electric Guitar
 
Mindset's Avatar
 
Posts: 355 since Sep 2009
Thanks: 88 given, 284 received

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?

Reply With Quote
The following user says Thank You to Mindset for this post:
 
  #67 (permalink)
Elite Member
Georgia, US
 
Futures Experience: None
Platform: Various
Favorite Futures: Various
 
josh's Avatar
 
Posts: 4,898 since Jan 2011
Thanks: 5,143 given, 11,198 received

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
The following user says Thank You to josh for this post:
 
  #68 (permalink)
Membership Revoked
Oslo, Norway
 
Futures Experience: Advanced
Platform: CQG, Excel
Favorite Futures: CL
 
Lornz's Avatar
 
Posts: 1,198 since Apr 2010
Thanks: 500 given, 1,223 received

I find it almost unfathomable that this isn't a built-in function?

Reply With Quote
 
  #69 (permalink)
Elite Member
Berlin, Europe
 
Futures Experience: Advanced
Platform: NinjaTrader, MultiCharts
Broker/Data: Interactive Brokers
Favorite Futures: Keyboard
 
Fat Tails's Avatar
 
Posts: 9,538 since Mar 2010
Thanks: 4,215 given, 24,939 received


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
The following 2 users say Thank You to Fat Tails for this post:
 
  #70 (permalink)
Elite Member
Houston,Tx
 
Futures Experience: Advanced
Platform: NinjaTrader
Broker/Data: Mirus Futures/Zen-Fire
Favorite Futures: TF
 
ThatManFromTexas's Avatar
 
Posts: 2,302 since Feb 2010
Thanks: 1,208 given, 4,281 received



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.

Please register on futures.io to view futures trading content such as post attachment(s), image(s), and screenshot(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
Register to download File Type: zip PriceMountain.zip (2.9 KB, 57 views)
Reply With Quote
The following 4 users say Thank You to ThatManFromTexas for this post:

Reply



futures.io > > > > > Make Charts Pretty!

Thread Tools Search this Thread
Search this Thread:

Advanced Search



Upcoming Webinars and Events (4:30PM ET unless noted)

2016 True Edge Awards: Voting is open until Jan 21!

Now
 

Bookmap New Indicator Panel, Cumulative Delta, Order Flow demo

Jan 17
 

An Afternoon with FIO member Massive l

Elite only

Leo Murphy: Making sense of Technical Analysis and Random Walk

Elite only
 

FuturesTrader71: Ask Me Anything

Elite only
     

Similar Threads
Thread Thread Starter Forum Replies Last Post
What is the difference in the regular Renko charts and the Median Renko charts PamH NinjaTrader 17 February 21st, 2012 08:16 PM
Wish to make a 1st Post TradewithMoe Traders Hideout 3 February 4th, 2011 02:45 PM
PLEASE! Need assist to make this plot Trader.Jon NinjaTrader Programming 4 September 27th, 2010 01:42 PM
Help make 2 indicators of same name coexist please dandxg NinjaTrader Programming 4 January 29th, 2010 09:18 PM


All times are GMT -4. The time now is 05:38 PM.

no new posts
Page generated 2017-01-17 in 0.13 seconds with 20 queries on phoenix via your IP 174.129.120.155