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 Hwop38, 05-04-2026, 07:02 PM
              0 responses
              155 views
              0 likes
              Last Post Hwop38
              by Hwop38
               
              Started by CaptainJack, 04-24-2026, 11:07 PM
              0 responses
              307 views
              0 likes
              Last Post CaptainJack  
              Started by Mindset, 04-21-2026, 06:46 AM
              0 responses
              244 views
              0 likes
              Last Post Mindset
              by Mindset
               
              Started by M4ndoo, 04-20-2026, 05:21 PM
              0 responses
              345 views
              0 likes
              Last Post M4ndoo
              by M4ndoo
               
              Started by M4ndoo, 04-19-2026, 05:54 PM
              0 responses
              176 views
              0 likes
              Last Post M4ndoo
              by M4ndoo
               
              Working...
              X