Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Is it possible to retrieve the BarColor of a past Bar?

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

    Is it possible to retrieve the BarColor of a past Bar?

    Hello, I am developing an indicator according to a customer's specs, and I need to find out the BarColor of a past bar. Is this possible?

    If not, I suppose I will have to store a code that identifies the color in a DataSeries that I can later access.. how would I do this?

    Thanks in advance for any help you might provide.

    #2
    Currently this is not supported. You could use the StringSeries class and store the RGB value per bar?

    RayNinjaTrader Customer Service

    Comment


      #3
      Originally posted by NinjaTrader_Ray View Post
      Currently this is not supported. You could use the StringSeries class and store the RGB value per bar?

      http://www.ninjatrader-support.com/H...riesClass.html
      Thanks for your help, I will certainly try.

      Comment


        #4
        try this

        if (BarColor[1] == Color.Brown)

        then bla bla bla

        Comment


          #5
          That will not work since BarColor is not a series.
          RayNinjaTrader Customer Service

          Comment


            #6
            can but you need to do a lot of command

            if ((BarColor[1] == Color.Brown) && (BarColor[2] == Color.Brown))

            1 & 2 is pass bar

            other option is

            if (ChartControl.BarColorSeries[CurrentBar - 1] == Color.Blue)

            [CurrentBar - 1] = pass bar

            Comment


              #7
              Define your own dataseries to record the barcolors then you can retrieve any barcolor you want. So, in your code where you set the barcolor, also set your color dataseries with a value that represents that color.

              Mike

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by Hwop38, 05-04-2026, 07:02 PM
              0 responses
              160 views
              0 likes
              Last Post Hwop38
              by Hwop38
               
              Started by CaptainJack, 04-24-2026, 11:07 PM
              0 responses
              308 views
              0 likes
              Last Post CaptainJack  
              Started by Mindset, 04-21-2026, 06:46 AM
              0 responses
              245 views
              0 likes
              Last Post Mindset
              by Mindset
               
              Started by M4ndoo, 04-20-2026, 05:21 PM
              0 responses
              349 views
              0 likes
              Last Post M4ndoo
              by M4ndoo
               
              Started by M4ndoo, 04-19-2026, 05:54 PM
              0 responses
              179 views
              0 likes
              Last Post M4ndoo
              by M4ndoo
               
              Working...
              X