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

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 pechtri, 06-22-2023, 02:31 AM
              8 responses
              122 views
              0 likes
              Last Post Nyman
              by Nyman
               
              Started by frankthearm, 04-18-2024, 09:08 AM
              16 responses
              64 views
              0 likes
              Last Post NinjaTrader_Clayton  
              Started by habeebft, Today, 01:18 PM
              1 response
              5 views
              0 likes
              Last Post NinjaTrader_ChelseaB  
              Started by benmarkal, Today, 12:52 PM
              2 responses
              13 views
              0 likes
              Last Post benmarkal  
              Started by f.saeidi, Today, 01:38 PM
              1 response
              7 views
              0 likes
              Last Post NinjaTrader_BrandonH  
              Working...
              X