NexusFi: Find Your Edge


Home Menu

 





Color Gradient for Candles in NinjaTrader


Discussion in NinjaTrader

Updated
      Top Posters
    1. looks_one aligator with 20 posts (29 thanks)
    2. looks_two ThatManFromTexas with 6 posts (1 thanks)
    3. looks_3 renvik with 2 posts (6 thanks)
    4. looks_4 Fat Tails with 2 posts (5 thanks)
      Best Posters
    1. looks_one renvik with 3 thanks per post
    2. looks_two Fat Tails with 2.5 thanks per post
    3. looks_3 aligator with 1.5 thanks per post
    4. looks_4 TheWizard with 1 thanks per post
    1. trending_up 13,363 views
    2. thumb_up 42 thanks given
    3. group 8 followers
    1. forum 29 posts
    2. attach_file 12 attachments




 
Search this Thread

Color Gradient for Candles in NinjaTrader

  #21 (permalink)
 
aligator's Avatar
 aligator 
Las Vegas, NV
Market Wizard
 
Experience: Advanced
Platform: Abacus, Slide Rule, HP-65
Trading: Futures, Stocks, Options
Posts: 3,615 since Aug 2010
Thanks Given: 1,071
Thanks Received: 5,988

T1 @ 91.23

Attached Thumbnails
Click image for larger version

Name:	CL 07-12 (12 Range)  5_22_2012-5.png
Views:	401
Size:	48.6 KB
ID:	74467  
Visit my NexusFi Trade Journal Started this thread Reply With Quote
Thanked by:

Can you help answer these questions
from other members on NexusFi?
New Micros: Ultra 10-Year & Ultra T-Bond -- Live Now
Treasury Notes and Bonds
Exit Strategy
NinjaTrader
Better Renko Gaps
The Elite Circle
Futures True Range Report
The Elite Circle
ZombieSqueeze
Platforms and Indicators
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Get funded firms 2023/2024 - Any recommendations or word …
61 thanks
Funded Trader platforms
39 thanks
NexusFi site changelog and issues/problem reporting
26 thanks
The Program
18 thanks
GFIs1 1 DAX trade per day journal
18 thanks
  #22 (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,348


aligator View Post
OK, I got more PMs. A copy of the basic working version is posted here:


@aligator

Congratulations ... now you can start taking some of the custom indicator load off of @Fat Tails....

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:
  #23 (permalink)
 
aligator's Avatar
 aligator 
Las Vegas, NV
Market Wizard
 
Experience: Advanced
Platform: Abacus, Slide Rule, HP-65
Trading: Futures, Stocks, Options
Posts: 3,615 since Aug 2010
Thanks Given: 1,071
Thanks Received: 5,988



ThatManFromTexas View Post
@aligator

Congratulations ... now you can start taking some of the custom indicator load off of @Fat Tails....

@ThatManFromTexas,

I figured.... One problem though, I am color blind and my coloring indicators print only in braille. Also, it is too late to be alerted by anything and no longer can catch arrows in the air.

Visit my NexusFi Trade Journal Started this thread Reply With Quote
  #24 (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,102


aligator View Post
T1 @ 91.23


I think that you candles are quite confusing, and that you should add a feature. :


The problem is that your candles do not allow to differentiate between an upclose and a downclose. The solution has already been found for black and white candle sticks. The downcloses are filled (black) and the upcloses are hollow (white).

Depending on the the candle color and the background selected, it can be difficult to see a hollow candle on a chart. The solution is to use an opacity for the upcloses which is used to calculate the fill color from the outline color.

For the code you could have a look at the MACDBBLinesV3 indicator. It allows the selection of an opacity for upcloses.

 
Code
protected override void OnStartUp()
{
       .......
	if (ChartControl != null && ChartControl.ChartStyleType == ChartStyleType.CandleStick)
	{
		candles = true;
		alpha = 25*opacity; // opacity can be between 0 and 10
	}
	else
		candles = false;
        ......
}


protected override void OnBarUpdate()
{
        .......
	if(candles && Close[0] > Open[0])
		BarColor = Color.FromArgb(alpha, BarColor);
        ......
}


Reply With Quote
Thanked by:
  #25 (permalink)
 
aligator's Avatar
 aligator 
Las Vegas, NV
Market Wizard
 
Experience: Advanced
Platform: Abacus, Slide Rule, HP-65
Trading: Futures, Stocks, Options
Posts: 3,615 since Aug 2010
Thanks Given: 1,071
Thanks Received: 5,988


Fat Tails View Post
I think that you candles are quite confusing, and that you should add a feature.

Thank you @Fat Tails.

I am more confused now than I ever was, I knew that task was out of my league.

I need to go back to my sand box and scoop up your script to make all the background/foreground color addicts (me included) happy .

Visit my NexusFi Trade Journal Started this thread Reply With Quote
  #26 (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,102


aligator View Post
Thank you @Fat Tails.

I am more confused now than I ever was, I knew that task was out of my league.

I need to go back to my sand box and scoop up your script to make all the background/foreground color addicts (me included) happy .


That's only a few lines. This is the logic.

(1) First check ChartControl for null. It is null, if your indicator is called from another indicator or strategy. In that case you are not allowed to check for Candlesticks (this would crash the indicator)

(2) Check Chart Control for Candlesticks, if it is not null. If your chart is a candlestick chart, set the boolean candles to true.
For OHLC bars there is nothing to be done, as you can differentiate between upclose and downclose bars without any colors.

(3) In case you have candles, use the candle color for
-> candle outline
-> candle fill color for downcloses

(4) For upcloses use a reduced alpha (somewhere between 0 and 100). As alpha range is 250 and users are used to 10 different values for the opacity, allow user to enter opacity and calculate alpha value from opacity. Use the modified color as fill color for upcandles.

Just an explanation in case that your response was serious. If it was not, somebody else will like the answer.

Reply With Quote
  #27 (permalink)
 renvik 
Boston MA
 
Experience: Intermediate
Platform: NinjaTrader
Broker: Ninja/CQG
Trading: ES, ZB, CL
Posts: 259 since Apr 2010
Thanks Given: 344
Thanks Received: 119


aligator View Post
Anyone for a ride?

@aligator

Thanks for the indicator - just great.

It gave me an idea to to paint the bars per RSI (and remove RSI from the chart).
I am not much of a coder, but with the help of Ninja Script Wizard was able to do the need full.


Thanks for the inspiration.

Cheers,
Kumar

Follow me on Twitter Reply With Quote
  #28 (permalink)
 
aligator's Avatar
 aligator 
Las Vegas, NV
Market Wizard
 
Experience: Advanced
Platform: Abacus, Slide Rule, HP-65
Trading: Futures, Stocks, Options
Posts: 3,615 since Aug 2010
Thanks Given: 1,071
Thanks Received: 5,988


renvik View Post
@aligator

Thanks for the indicator - just great.

It gave me an idea to to paint the bars per RSI (and remove RSI from the chart).
I am not much of a coder, but with the help of Ninja Script Wizard was able to do the need full.


Thanks for the inspiration.

Cheers,
Kumar

Thanks@Kumar

That was basically what I did. It makes a simple and elegant visual of an indicator without the clutter.

Cheers!

Visit my NexusFi Trade Journal Started this thread Reply With Quote
  #29 (permalink)
 renvik 
Boston MA
 
Experience: Intermediate
Platform: NinjaTrader
Broker: Ninja/CQG
Trading: ES, ZB, CL
Posts: 259 since Apr 2010
Thanks Given: 344
Thanks Received: 119


aligator View Post
Thanks@Kumar

That was basically what I did. It makes a simple and elegant visual of an indicator without the clutter.

Cheers!


Here is my version for RSI.

RSI-K period is selectable with an ability to reverse the gradient color scheme (some may not like up bars being painted red!).

Cheers,
Kumar

Attached Files
Elite Membership required to download: RSIGradientColorBars.zip
Follow me on Twitter Reply With Quote
Thanked by:
  #30 (permalink)
 
aligator's Avatar
 aligator 
Las Vegas, NV
Market Wizard
 
Experience: Advanced
Platform: Abacus, Slide Rule, HP-65
Trading: Futures, Stocks, Options
Posts: 3,615 since Aug 2010
Thanks Given: 1,071
Thanks Received: 5,988



renvik View Post
Here is my version for RSI.

RSI-K period is selectable with an ability to reverse the gradient color scheme (some may not like up bars being painted red!).

Cheers,
Kumar

Very Nice!

The reason I had Red color for the upper limits was to indicate a selling opportunity and buying for the green at the bottom. Whatever, one's eye pleases. However, the concept makes visual sense for color divergence.

Cheers!

Visit my NexusFi Trade Journal Started this thread Reply With Quote




Last Updated on June 18, 2012


© 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