Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Candle Body Outline Colour

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Candle Body Outline Colour

    Hi,

    Is it possible to set the candle body to be the same colour as the bar body, e.g. green for an up bar and red for a down bar without effecting the wick of the candle? I've managed to change the whole candle colour to match the body but this also effects the wick, ideally the wick would remain the colour set in the chart options or be configurable within the Ninjascript (I can't find references to it within the help pages).

    Indicator I've used is attached.

    Thanks
    Attached Files

    #2
    I believe BarBrush is the property you are looking for. This is the NT8 replacement for BarColor

    Code:
    		protected override void OnBarUpdate()
    		{
    			if (Close[0]>Open[0])
    			{
    				CandleOutlineBrush = Brushes.Green;
    				BarBrush = Brushes.Green;
    			}
    			if (Close[0]<Open[0])
    			{
    				CandleOutlineBrush    = Brushes.Red;
    				BarBrush	= Brushes.Red;
    			}
    			if (Close[0]==Open[0])
    			{
    				CandleOutlineBrush   = Brushes.White;
    				BarBrush = Brushes.White;
    			}
    		}
    	}
    edit: The CandleOutlineBrush will change both the outline and the wick. If you're looking to keep the wick, but only color the candle body and outline, you will need to develop your own custom bar type. There is a similar chart style another beta user developed here which I think will help achieve your goal:

    Last edited by NinjaTrader_Matthew; 07-07-2015, 03:31 PM.
    MatthewNinjaTrader Product Management

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Jonafare, 12-06-2012, 03:48 PM
    5 responses
    3,986 views
    0 likes
    Last Post rene69851  
    Started by Fitspressorest, Today, 01:38 PM
    0 responses
    2 views
    0 likes
    Last Post Fitspressorest  
    Started by Jonker, Today, 01:19 PM
    0 responses
    2 views
    0 likes
    Last Post Jonker
    by Jonker
     
    Started by futtrader, Today, 01:16 PM
    0 responses
    8 views
    0 likes
    Last Post futtrader  
    Started by Segwin, 05-07-2018, 02:15 PM
    14 responses
    1,792 views
    0 likes
    Last Post aligator  
    Working...
    X