• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

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:

    http://ninjatrader.com/support/forum...1&postcount=18
    Last edited by NinjaTrader_Matthew; 07-07-2015, 02:31 PM.
    MatthewNinjaTrader Product Management

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Gav_G, Today, 01:41 PM
    1 response
    8 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by kweiss, Today, 01:21 PM
    1 response
    6 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by cutzpr, Today, 08:44 AM
    1 response
    4 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by Burak, Yesterday, 10:40 PM
    1 response
    3 views
    0 likes
    Last Post NinjaTrader_ChrisL  
    Started by AdmiralUptick, Today, 05:35 AM
    1 response
    15 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Working...
    X