Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

How Plot real time color for current bar only?

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

    How Plot real time color for current bar only?

    I'm trying to develop a volume indicator that can change the color of the current forming bar dynamically but as the bar closes, the historical bars will be the proper color based on the close of that bar.

    Currently in the code, when the current bar updates in real time, the whole series of bars changes color.

    What do I need to do to keep the none real time bars in the correct color state?

    help...

    taddypole...
    Attached Files

    #2
    you can do something like checking if the current bar is datetime.now() and then paint it
    i think?!?

    Comment


      #3
      Never mind, I found it.

      I was using this and it turns the whole series the specified color:
      Plots[0].Pen.Color = Color.Red;

      but then found this and it updates in real time and properly colors past bars:
      PlotColors[0][0] = Color.Red;

      The second bracketed term (index) was what I needed.

      Comment


        #4
        Originally posted by Taddypole View Post
        Never mind, I found it.

        I was using this and it turns the whole series the specified color:
        Plots[0].Pen.Color = Color.Red;

        but then found this and it updates in real time and properly colors past bars:
        PlotColors[0][0] = Color.Red;

        The second bracketed term (index) was what I needed.
        You may have reinvented the wheel. The shipping VolumeUpDown indicator does that already.

        Comment


          #5
          Thank you koganam,

          Exactly what I was looking for...

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by Geovanny Suaza, 02-11-2026, 06:32 PM
          0 responses
          581 views
          0 likes
          Last Post Geovanny Suaza  
          Started by Geovanny Suaza, 02-11-2026, 05:51 PM
          0 responses
          338 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
          554 views
          1 like
          Last Post Geovanny Suaza  
          Started by RFrosty, 01-28-2026, 06:49 PM
          0 responses
          552 views
          1 like
          Last Post RFrosty
          by RFrosty
           
          Working...
          X