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 Taddypole, 04-26-2024, 02:47 PM
          1 response
          12 views
          0 likes
          Last Post NinjaTrader_Eduardo  
          Started by futtrader, 04-21-2024, 01:50 AM
          6 responses
          58 views
          0 likes
          Last Post futtrader  
          Started by sgordet, Today, 11:48 AM
          0 responses
          4 views
          0 likes
          Last Post sgordet
          by sgordet
           
          Started by Trader146, Today, 11:41 AM
          0 responses
          5 views
          0 likes
          Last Post Trader146  
          Started by jpapa, 04-23-2024, 07:22 AM
          2 responses
          22 views
          0 likes
          Last Post rene69851  
          Working...
          X