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 AveryFlynn, Today, 04:57 AM
      1 response
      10 views
      0 likes
      Last Post NinjaTrader_Erick  
      Started by Max238, Today, 01:28 AM
      4 responses
      37 views
      0 likes
      Last Post Max238
      by Max238
       
      Started by r68cervera, Today, 05:29 AM
      1 response
      8 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Started by geddyisodin, Today, 05:20 AM
      1 response
      11 views
      0 likes
      Last Post NinjaTrader_Gaby  
      Started by timko, Today, 06:45 AM
      2 responses
      14 views
      0 likes
      Last Post NinjaTrader_ChristopherJ  
      Working...
      X