Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Getting default candle outline brush

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

    Getting default candle outline brush

    I'm almost certain that I used to be able to store the default candle outline brush that's set from the Data Series window like this using CandleOutlineBrush when the indi first loads:

    if (State == State.DataLoaded)
    {
    outlineColorDefault = (SolidColorBrush)CandleOutlineBrush;
    }

    Now CandleOutlineBrush and CandleOutlineBrushes return null until set.

    How do I access the candle outline color set from the Data Series window?

    Thanks!

    #2
    Hello deltaZ,

    Trying using the ChartControl.ChartStyle.Pen.

    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Looks like there is no longer a ChartControl.ChartStyle.

      Comment


        #4
        Hello deltaZ,

        Thanks for your reply.

        Have you tried ChartBars.Properties.ChartStyle.Stroke? While this is undocumented, this was working for me a couple months back.



        Please let us know if this helps resolve your inquiry.

        Comment


          #5
          Thanks for your suggestion.

          ChartBars.Properties.ChartStyle.Stroke.Brush is a System.Windows.Media.LinearGradientBrush and I'm unable to cast it to System.Windows.Media.SolidColorBrush.

          Can you provide an example of how this would work please?

          Comment


            #6
            Hello deltaZ,

            If you are assigning a LinearGriadientBrush for the ChartStyle's Stroke in the Data Series window, you should expect to run into a LinearGradientBrush in code. Since this cannot be converted directly to a SloidColorBrush, you would have to use the Colors of the LinearGradientBrush's GradientStops to create a new SolidColorBrush.

            Please consider the following as a rough example.
            Code:
            if(ChartBars.Properties.ChartStyle.Stroke.Brush is LinearGradientBrush)
            {
            	LinearGradientBrush myBrush = ChartBars.Properties.ChartStyle.Stroke.Brush as LinearGradientBrush;
            	BarBrush = new SolidColorBrush(myBrush.GradientStops[0].Color);
            }
            Please let us know if you have any additional questions.

            Comment


              #7
              Thanks much for your help Jim, this will work.

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by Geovanny Suaza, 02-11-2026, 06:32 PM
              0 responses
              582 views
              0 likes
              Last Post Geovanny Suaza  
              Started by Geovanny Suaza, 02-11-2026, 05:51 PM
              0 responses
              338 views
              1 like
              Last Post Geovanny Suaza  
              Started by Mindset, 02-09-2026, 11:44 AM
              0 responses
              103 views
              0 likes
              Last Post Mindset
              by Mindset
               
              Started by Geovanny Suaza, 02-02-2026, 12:30 PM
              0 responses
              554 views
              1 like
              Last Post Geovanny Suaza  
              Started by RFrosty, 01-28-2026, 06:49 PM
              0 responses
              552 views
              1 like
              Last Post RFrosty
              by RFrosty
               
              Working...
              X