Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Retrieve color of bar

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

    Retrieve color of bar

    Hi,

    Is there a function call to retrieve the color of a particular bar?

    I'm using a third-party indicator which paints the bars different colors and I want to make decisions based on those colors - unfortunatley there is no direct access via the indicator properties to determine this but if I can detect the color of the bar that's all I need.

    Thanks for any help!

    #2
    Hello oz-dog,

    If the indicator assigns color with the BarColor property, then you can use this.

    Ryan M.NinjaTrader Customer Service

    Comment


      #3
      Hi Ryan,

      Thanks for the quick reply.

      Just tried this and I get a return of "Color[Empty]", the same goes for the outline color.

      Looking at the documentation it suggests that the color can only be retrieved if it has been explicitly overwritten - or at least that is my interpretation.

      Does this mean that it is not possible to retrieve the bar/outline color of the current bar unless I have explicitly already changed the color?

      Thanks again for your help.

      Comment


        #4
        Yes, exactly. If the indicator doesn't use this technique for coloring, then it would just print empty. Unfortunately there aren't additional supported properties for identifying color.
        Ryan M.NinjaTrader Customer Service

        Comment


          #5
          Thanks, not what I wanted to hear but at least I know to stop now!!

          Thanks for your help.

          Comment


            #6
            Is is possible in NinjaTrader 7.0 to access the default colors for up bars and down bars via NinjaScript, as they are specified under the DataSeries?

            Want to color the bars intrabar, but reset them to the original up and down color, when the condition is no longer true.

            Or shall I just set the BarColor to Color.Empty to display the original colors?

            Comment


              #7
              Originally posted by Harry View Post
              Is is possible in NinjaTrader 7.0 to access the default colors for up bars and down bars via NinjaScript, as they are specified under the DataSeries?

              Want to color the bars intrabar, but reset them to the original up and down color, when the condition is no longer true.

              Or shall I just set the BarColor to Color.Empty to display the original colors?
              ChartControl.UpColor and ChartControl.DownColor might help.

              Comment


                #8
                Hello Harry,

                Unfortunately there aren't supported properties for accessing the chart colors directly.

                bukkan offers a nice tip for accessing this with unsupported properties.
                Ryan M.NinjaTrader Customer Service

                Comment


                  #9
                  Thanks a lot.

                  Originally posted by bukkan View Post
                  ChartControl.UpColor and ChartControl.DownColor might help.

                  Comment

                  Latest Posts

                  Collapse

                  Topics Statistics Last Post
                  Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                  0 responses
                  612 views
                  0 likes
                  Last Post Geovanny Suaza  
                  Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                  0 responses
                  355 views
                  1 like
                  Last Post Geovanny Suaza  
                  Started by Mindset, 02-09-2026, 11:44 AM
                  0 responses
                  105 views
                  0 likes
                  Last Post Mindset
                  by Mindset
                   
                  Started by Geovanny Suaza, 02-02-2026, 12:30 PM
                  0 responses
                  561 views
                  1 like
                  Last Post Geovanny Suaza  
                  Started by RFrosty, 01-28-2026, 06:49 PM
                  0 responses
                  564 views
                  1 like
                  Last Post RFrosty
                  by RFrosty
                   
                  Working...
                  X