NinjaTrader Support Forum  
X

Attention!

This website will be down for maintenance from Friday May 24th at 6PM MDT until Saturday May 25th at 11AM MDT. We apologize for the inconvenience. If you need assistance during this time, please email sales@ninjatrader.com


Go Back   NinjaTrader Support Forum > NinjaScript Development Support > Indicator Development

Indicator Development Support for the development of custom indicators using NinjaScript.

Reply
 
Thread Tools Display Modes
Old 04-28-2010, 06:05 PM   #1
Stevo
Junior Member
 
Join Date: Jan 2010
Posts: 19
Thanks: 0
Thanked 0 times in 0 posts
Default Variable color shading of histogram bars

Hi Everyone,
I'm trying to figure out how to make histogram bars colour shade. I've searched the forum for ideas and found Dave's good work for variable shading of chart bars:

http://www.ninjatrader-support2.com/...ght=add+colour

Any clues on how to apply this technique to a histogram plot would be greatly apreciated.

Cheers,
Stevo
Stevo is offline  
Reply With Quote
Old 04-29-2010, 02:57 AM   #2
mountainclimber
Senior Member
 
Join Date: Jun 2008
Posts: 112
Thanks: 0
Thanked 0 times in 0 posts
Send a message via Skype™ to mountainclimber
Default

What do you mean by "shading"? Changing the color of the histogram? If so I wrote an indicator that does this called BollingerPrecentB2 and you can find it here as an example:
http://www.ninjatrader-support2.com/...N&pp=15&page=2

However if you are using NT7 there is a new PlotColors[][] method that is better to use, and you can find an example of how to use it here by looking for indicator Bollinger_TripleState_v4NT7:
http://www.ninjatrader-support2.com/...catid=1&sort=d

These will help also:
NT7:
http://www.ninjatrader.com/support/h...sub=plotcolors
NT6.5:
http://www.ninjatrader-support2.com/...ead.php?t=3227
mountainclimber is offline  
Reply With Quote
Old 04-29-2010, 03:52 AM   #3
Stevo
Junior Member
 
Join Date: Jan 2010
Posts: 19
Thanks: 0
Thanked 0 times in 0 posts
Default Histogram / oscillator shading

Hi Mountainclimber,
Apologies for not being clear enough. By "shading" I mean color shading each bar of a volume histogram, for example from light to dark red or light to dark green depending on the result of a calculation between trades at bid Vs ask.

by using something like:

HistoBarColor = Color.FromArgb(255, colorValue, colorValue)

Where the 'colourValue' is in this example a ratio of traded volume at Bid Vs Ask that determines the color.

'DaveS' used this in the below example to paint the price bars in this way.

The bit I'm stuck with is to get this to work within the Add() method to plot an indicator / ocillator.

Thanks very much for your sugestions, I'll have a good look at them. And yes I'm using NT7

Cheers,
Stevo
Stevo is offline  
Reply With Quote
Old 04-29-2010, 06:37 AM   #4
NinjaTrader_Bertrand
NinjaTrader Customer Service
 
NinjaTrader_Bertrand's Avatar
 
Join Date: Sep 2008
Location: Germany
Posts: 22,404
Thanks: 252
Thanked 974 times in 957 posts
Default

Stevo, unfortunately this is not supported per default - would you have snippet perhaps I can test, check into for you?
NinjaTrader_Bertrand is offline  
Reply With Quote
Old 04-29-2010, 07:42 PM   #5
mountainclimber
Senior Member
 
Join Date: Jun 2008
Posts: 112
Thanks: 0
Thanked 0 times in 0 posts
Send a message via Skype™ to mountainclimber
Default

Yeah, bert is correct. Post a bit of code that works that you have seen and show us how you are trying adapt it for your purposes. I haven't done something like that, but it sounds interesting.

I found this link, but don't have time to look into it unless you pay me!

http://www.flounder.com/csharp_color_table.htm
mountainclimber is offline  
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
EMA Slope Histogram - Help with Color Changes dwalls Indicator Development 10 10-01-2009 09:06 AM
Change cell color in Market Analyzer based on variable that is not used for display tomtom Indicator Development 1 07-13-2009 03:52 PM
color price bars and volume bars the same mikeytrader General Programming 1 05-11-2009 07:52 AM
Color variable not being initialized if Indicator is included in a Template GaryAlbers Suggestions And Feedback 3 04-15-2008 07:10 AM
Shading areas of chart? higler Charting 3 05-01-2007 07:58 AM


All times are GMT -6. The time now is 12:40 AM.