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 Jeremytang, 07-14-2018, 06:45 PM
          21 responses
          439 views
          0 likes
          Last Post mav8rick  
          Started by LeonK, Yesterday, 09:26 PM
          1 response
          8 views
          0 likes
          Last Post bltdavid  
          Started by NicholasJoannette, Yesterday, 03:01 PM
          2 responses
          11 views
          0 likes
          Last Post NicholasJoannette  
          Started by rach1994, Yesterday, 12:20 PM
          1 response
          35 views
          0 likes
          Last Post bltdavid  
          Started by litamm89, Yesterday, 11:00 AM
          5 responses
          22 views
          1 like
          Last Post rafael_delima86  
          Working...
          X