Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Color of Candle Body and Candle Outline?

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

    Color of Candle Body and Candle Outline?

    Hi,

    Can you show me the code to take the brushes of candle body (both up and down) and pens of candle outline (if possible, candle wick also)?

    These colors are ones that can be seen and set from Data Series dialog.

    Thanks.
    ninZa
    NinjaTrader Ecosystem Vendor - ninZa.co

    #2
    The CandleStyle, the Body would be:

    ChartBars.Properties.ChartStyle.UpBrush

    The CandleOutline:

    ChartBars.Properties.ChartStyle.Stroke

    The CandleWick:

    ChartBars.Properties.ChartStyle.Stroke2
    MatthewNinjaTrader Product Management

    Comment


      #3
      Originally posted by NinjaTrader_Matthew View Post
      The CandleStyle, the Body would be:

      ChartBars.Properties.ChartStyle.UpBrush

      The CandleOutline:

      ChartBars.Properties.ChartStyle.Stroke

      The CandleWick:

      ChartBars.Properties.ChartStyle.Stroke2
      Not to whine, but I'm curious about this as a general case. Wouldn't it take less than 60 seconds to add properties with meaningful names? And wouldn't that save you many hours of support time in the coming few years, not to mention time and frustration for users? Thanks.

      Comment


        #4
        The objects used for chart styles were made generically so they could be used among all chart styles, rather than have to code for specific chart styles, which we anticipate will only grow as 3rd party developers adapter their own chart styles.

        The properties are very easy to identify now that the ChartStyles are exposed:

        Code:
        			else if (State == State.Configure)
        			{
        				SetPropertyName("BarWidth",		Custom.Resource.NinjaScriptChartStyleBarWidth);
        				SetPropertyName("DownBrush",	Custom.Resource.NinjaScriptChartStyleCandleDownBarsColor);
        				SetPropertyName("UpBrush",		Custom.Resource.NinjaScriptChartStyleCandleUpBarsColor);
        				SetPropertyName("Stroke",		Custom.Resource.NinjaScriptChartStyleCandleOutline);
        				SetPropertyName("Stroke2",		Custom.Resource.NinjaScriptChartStyleCandleWick);
        			}
        MatthewNinjaTrader Product Management

        Comment


          #5
          Originally posted by NinjaTrader_Matthew View Post
          The CandleStyle, the Body would be:

          ChartBars.Properties.ChartStyle.UpBrush

          The CandleOutline:

          ChartBars.Properties.ChartStyle.Stroke

          The CandleWick:

          ChartBars.Properties.ChartStyle.Stroke2
          Thanks. But now the next problem prevents me from conditionally setting colors for candles (after a user clicks a custom toolbar button):

          ninZa
          NinjaTrader Ecosystem Vendor - ninZa.co

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by RubenCazorla, Today, 09:07 AM
          0 responses
          1 view
          0 likes
          Last Post RubenCazorla  
          Started by BarzTrading, Today, 07:25 AM
          2 responses
          28 views
          1 like
          Last Post BarzTrading  
          Started by devatechnologies, 04-14-2024, 02:58 PM
          3 responses
          20 views
          0 likes
          Last Post NinjaTrader_BrandonH  
          Started by tkaboris, Today, 08:01 AM
          0 responses
          6 views
          0 likes
          Last Post tkaboris  
          Started by EB Worx, 04-04-2023, 02:34 AM
          7 responses
          165 views
          0 likes
          Last Post VFI26
          by VFI26
           
          Working...
          X