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

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 Jon17, Today, 04:33 PM
                  0 responses
                  1 view
                  0 likes
                  Last Post Jon17
                  by Jon17
                   
                  Started by Javierw.ok, Today, 04:12 PM
                  0 responses
                  4 views
                  0 likes
                  Last Post Javierw.ok  
                  Started by timmbbo, Today, 08:59 AM
                  2 responses
                  10 views
                  0 likes
                  Last Post bltdavid  
                  Started by alifarahani, Today, 09:40 AM
                  6 responses
                  41 views
                  0 likes
                  Last Post alifarahani  
                  Started by Waxavi, Today, 02:10 AM
                  1 response
                  20 views
                  0 likes
                  Last Post NinjaTrader_LuisH  
                  Working...
                  X