Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Getting candle outline color via ChartControl

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

    Getting candle outline color via ChartControl

    Hello,

    I am currently having trouble getting the default color of the candle outline (the color set in the chart's 'Data Series' dialog). I'm fairly certain the following has worked for me in the past but it keeps returning an empty color (0, 0, 0) no matter what I try.

    I am attempting to store the candle outline color to colorvariable as the first few bars of the chart are plotted like so:

    if (CurrentBar < 3)
    {
    if (ChartControl != null)
    {
    colorvariable = ChartControl.CandleOutlineColorSeries[0];
    }
    return;
    }

    Does ChartControl.CandleOutlineColorSeries[0] return an empty color value for anyone else?

    #2
    Hello,

    Thank you for the post.

    Getting the Default value is not a documented property but is possible. The code you are currently using is only a Place Holder series meaning that a Color would need to be set for the bar being checked for the value to not be empty.

    For getting the default values from the ChartControl, you could see the following posts where users have used some of the various properties. For this specifically you would need to use the ChartControl.ChartStyle.Pen object.




    I look forward to being of further assistance.

    Comment


      #3
      Perfect, that's what I needed. Thanks!

      Updated code:
      if (CurrentBar < 3)
      {
      if (ChartControl != null)
      {
      colorvariable = ChartControl.ChartStyle.Pen.Color;
      }
      return;
      }

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by CarlTrading, 03-31-2026, 09:41 PM
      1 response
      82 views
      1 like
      Last Post NinjaTrader_ChelseaB  
      Started by CarlTrading, 04-01-2026, 02:41 AM
      0 responses
      43 views
      0 likes
      Last Post CarlTrading  
      Started by CaptainJack, 03-31-2026, 11:44 PM
      0 responses
      64 views
      2 likes
      Last Post CaptainJack  
      Started by CarlTrading, 03-30-2026, 11:51 AM
      0 responses
      68 views
      0 likes
      Last Post CarlTrading  
      Started by CarlTrading, 03-30-2026, 11:48 AM
      0 responses
      56 views
      0 likes
      Last Post CarlTrading  
      Working...
      X