Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Getting the current bar color

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

    Getting the current bar color

    Hi,
    I am using a Kagi chart for one of my strategies and I want to get the current color (green or red) in order to signal my entry.

    How can I get the current bar color?

    #2
    Hello,

    Thank you for the question.

    I am currently reviewing this to see if the base color of each bar can be checked. Currently the property that controls the bar colors BarBrush only gets or sets a custom brush but not the base bar color. Because of this I will need to review if there is a more specific way to get the base brush colors.

    I look forward to being of further assistance.
    JesseNinjaTrader Customer Service

    Comment


      #3
      Hello,

      Thank you for the question.

      I am currently reviewing this to see if the base color of each bar can be checked. Currently the property that controls the bar colors BarBrush only gets or sets a custom brush but not the base bar color. Because of this I will need to review if there is a more specific way to get the base brush colors.

      I look forward to being of further assistance.
      Thanks Jesse. I already tried with no luck checking if the BarBrush is equal to Brushes.Red and Brushes.DarkGreen but I got an empty object in OnBarUpdate. Also I tried the same with BarBrushes[0] and got a null object.

      Comment


        #4
        Hello,

        Yes BarBrush is only a place holder property for a custom brush, if it is not null, that brush is used to override the base color for that bar.

        Currently you could only get the default brushes for up or down, rather than for each individual bar. I have put in a question regarding getting the base color of each individual bar which may be useful, but otherwise you could equate if the current bar is a up or down bar your self to do logic.

        You can get the base colors set in the data series window by using the following: ChartBars.Properties.ChartStyle.DownBrush or UpBrush but again this is not per bar just in general for the whole series.

        I look forward to being of further assistance.
        JesseNinjaTrader Customer Service

        Comment


          #5
          Thanks Jesse. The whole idea behind the Kagi bars is using the color it generates during the bar creation so I think you should be able to access such property.

          Currently I will just estimate myself where should it be red or green.

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by RubenCazorla, Today, 09:07 AM
          2 responses
          11 views
          0 likes
          Last Post NinjaTrader_ChelseaB  
          Started by i019945nj, 12-14-2023, 06:41 AM
          7 responses
          81 views
          0 likes
          Last Post NinjaTrader_ChelseaB  
          Started by timmbbo, 07-05-2023, 10:21 PM
          4 responses
          158 views
          0 likes
          Last Post NinjaTrader_Gaby  
          Started by tkaboris, Today, 08:01 AM
          1 response
          7 views
          0 likes
          Last Post NinjaTrader_Gaby  
          Started by Lumbeezl, 01-11-2022, 06:50 PM
          31 responses
          819 views
          1 like
          Last Post NinjaTrader_Adrian  
          Working...
          X