Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Re paint chart

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

    Re paint chart

    I have an indicator that colors the backcolor at certain market times based on a condition.

    I use

    if(condition)

    BackColorAll = Color.Pink;

    This works great but once the event is over I wish to reapply the 'default' BackColor to that area.
    Is there a way to do this?

    At the moment the only way I can do it is to hit F5 and reload.

    #2
    Mindset, please try adding an else condition to change to your needed default color -

    Code:
     
    if(condition)
    
    BackColorAll = Color.Pink;
     
    else
     
    BackColorAll = Color.White;

    Comment


      #3
      won't repaint

      but that won't repaint the old bars will it?

      Comment


        #4
        Not sure I follow, the switch would be done according to the condition you've defined for all bars the OnBarUpdate() is called for for the leftmost to the current going forward...

        Comment


          #5
          better explanation

          if (diff.TotalMinutes < alerttimel )

          {

          BackColorAll = Color.Pink;
          }

          So my condition is a time limited condition - not price based. If I put the else statement in - the pink doesn't show.

          What I currently get left with is pink at the duration of my alerttime as a band which is quite nice and informative but not what I want!!

          Comment


            #6
            Then use something like this adjusted to your times needed -

            Code:
             
            if (ToTime(Time[0]) > 93000 && ToTime(Time[0]) < 100000)
            BackColorAll = Color.Blue;
            else
            BackColorAll = Color.Empty;

            Comment


              #7
              timespan

              Bertrand
              I am using a timespan var to countdown the minutes so I don't think that will work?

              Comment


                #8
                Hmm, would think so to without getting into the code - you would need to relate this condition then to the bar's timestamp then.

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by argusthome, 03-08-2026, 10:06 AM
                0 responses
                85 views
                0 likes
                Last Post argusthome  
                Started by NabilKhattabi, 03-06-2026, 11:18 AM
                0 responses
                47 views
                0 likes
                Last Post NabilKhattabi  
                Started by Deep42, 03-06-2026, 12:28 AM
                0 responses
                29 views
                0 likes
                Last Post Deep42
                by Deep42
                 
                Started by TheRealMorford, 03-05-2026, 06:15 PM
                0 responses
                32 views
                0 likes
                Last Post TheRealMorford  
                Started by Mindset, 02-28-2026, 06:16 AM
                0 responses
                67 views
                0 likes
                Last Post Mindset
                by Mindset
                 
                Working...
                X