Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

how to paint specific bars

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

    how to paint specific bars

    What property or static method allows me to color specific bars? For example if I wanted to color bars 0, 3 and 8...

    #2
    There's unfortunately no specific method for this, you would need to work with CurrentBar and BarColor for this.



    Comment


      #3
      Painting Specific Bars

      Can you add this to the wishlist? I am hitting this too. I have logic that determines a bar needs colorized much later than the current bar I am on, so I would like to colorize a bar in the past. Thanks!

      Comment


        #4
        Hello,

        I will send your suggestion to our development department for consideration, thanks!
        DenNinjaTrader Customer Service

        Comment


          #5
          Anyway to color the background of the chart during a certain time frame? Say like 9:30 AM - 4:00 PM EST and bars outside this time would have the regular background color?

          Comment


            #6
            BackColor by Time

            Yes; you can check the time of each bar. I typically convert my times into a number; there might be a better way, but this seems to work for me:

            Code:
            DateTime now = Time[0];
             
            string minute = now.Minute.ToString();
            if (minute.Length == 1)
                 minute = "0" + minute;
            int time = int.Parse(now.Hour.ToString() + minute);
             
            // too early!
            if (time < 820)
            {
                 BackColor = Color.Red;
             }
            I hope this helps!

            Comment


              #7
              See if this works for you. I use it to color the overnight session. you can adjust the times you want to use, or modify it to change colors.

              VT
              Attached Files

              Comment


                #8
                That's great! Thanks.

                Comment


                  #9
                  Originally posted by d.allen101 View Post
                  What property or static method allows me to color specific bars? For example if I wanted to color bars 0, 3 and 8...
                  This is supported in NT7.
                  RayNinjaTrader Customer Service

                  Comment

                  Latest Posts

                  Collapse

                  Topics Statistics Last Post
                  Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                  0 responses
                  628 views
                  0 likes
                  Last Post Geovanny Suaza  
                  Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                  0 responses
                  359 views
                  1 like
                  Last Post Geovanny Suaza  
                  Started by Mindset, 02-09-2026, 11:44 AM
                  0 responses
                  105 views
                  0 likes
                  Last Post Mindset
                  by Mindset
                   
                  Started by Geovanny Suaza, 02-02-2026, 12:30 PM
                  0 responses
                  562 views
                  1 like
                  Last Post Geovanny Suaza  
                  Started by RFrosty, 01-28-2026, 06:49 PM
                  0 responses
                  568 views
                  1 like
                  Last Post RFrosty
                  by RFrosty
                   
                  Working...
                  X