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 Geovanny Suaza, 02-11-2026, 06:32 PM
              0 responses
              596 views
              0 likes
              Last Post Geovanny Suaza  
              Started by Geovanny Suaza, 02-11-2026, 05:51 PM
              0 responses
              343 views
              1 like
              Last Post Geovanny Suaza  
              Started by Mindset, 02-09-2026, 11:44 AM
              0 responses
              103 views
              0 likes
              Last Post Mindset
              by Mindset
               
              Started by Geovanny Suaza, 02-02-2026, 12:30 PM
              0 responses
              556 views
              1 like
              Last Post Geovanny Suaza  
              Started by RFrosty, 01-28-2026, 06:49 PM
              0 responses
              554 views
              1 like
              Last Post RFrosty
              by RFrosty
               
              Working...
              X