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 GLFX005, Today, 03:23 AM
    0 responses
    0 views
    0 likes
    Last Post GLFX005
    by GLFX005
     
    Started by XXtrader, Yesterday, 11:30 PM
    2 responses
    11 views
    0 likes
    Last Post XXtrader  
    Started by Waxavi, Today, 02:10 AM
    0 responses
    6 views
    0 likes
    Last Post Waxavi
    by Waxavi
     
    Started by TradeForge, Today, 02:09 AM
    0 responses
    11 views
    0 likes
    Last Post TradeForge  
    Started by Waxavi, Today, 02:00 AM
    0 responses
    2 views
    0 likes
    Last Post Waxavi
    by Waxavi
     
    Working...
    X