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 Mindset, Today, 06:46 AM
    0 responses
    8 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by M4ndoo, Yesterday, 05:21 PM
    0 responses
    13 views
    0 likes
    Last Post M4ndoo
    by M4ndoo
     
    Started by M4ndoo, 04-19-2026, 05:54 PM
    0 responses
    15 views
    0 likes
    Last Post M4ndoo
    by M4ndoo
     
    Started by cmoran13, 04-16-2026, 01:02 PM
    0 responses
    82 views
    0 likes
    Last Post cmoran13  
    Started by PaulMohn, 04-10-2026, 11:11 AM
    0 responses
    47 views
    0 likes
    Last Post PaulMohn  
    Working...
    X