Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

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.
    JesseNinjaTrader Customer Service

    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 JonesJoker, 04-22-2024, 12:23 PM
      8 responses
      41 views
      0 likes
      Last Post JonesJoker  
      Started by timko, Today, 06:45 AM
      0 responses
      3 views
      0 likes
      Last Post timko
      by timko
       
      Started by Waxavi, 04-19-2024, 02:10 AM
      2 responses
      39 views
      0 likes
      Last Post poeds
      by poeds
       
      Started by chbruno, Yesterday, 04:10 PM
      1 response
      44 views
      0 likes
      Last Post NinjaTrader_Gaby  
      Started by Max238, Today, 01:28 AM
      1 response
      25 views
      0 likes
      Last Post CactusMan  
      Working...
      X