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 CarlTrading, 03-31-2026, 09:41 PM
                  1 response
                  153 views
                  1 like
                  Last Post NinjaTrader_ChelseaB  
                  Started by CarlTrading, 04-01-2026, 02:41 AM
                  0 responses
                  89 views
                  1 like
                  Last Post CarlTrading  
                  Started by CaptainJack, 03-31-2026, 11:44 PM
                  0 responses
                  133 views
                  2 likes
                  Last Post CaptainJack  
                  Started by CarlTrading, 03-30-2026, 11:51 AM
                  0 responses
                  128 views
                  1 like
                  Last Post CarlTrading  
                  Started by CarlTrading, 03-30-2026, 11:48 AM
                  0 responses
                  107 views
                  0 likes
                  Last Post CarlTrading  
                  Working...
                  X