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;
    BertrandNinjaTrader Customer Service

    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...
        BertrandNinjaTrader Customer Service

        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;
            BertrandNinjaTrader Customer Service

            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.
                BertrandNinjaTrader Customer Service

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by geddyisodin, 04-25-2024, 05:20 AM
                8 responses
                58 views
                0 likes
                Last Post NinjaTrader_Gaby  
                Started by halgo_boulder, 04-20-2024, 08:44 AM
                2 responses
                21 views
                0 likes
                Last Post halgo_boulder  
                Started by mishhh, 05-25-2010, 08:54 AM
                19 responses
                6,189 views
                0 likes
                Last Post rene69851  
                Started by gwenael, Today, 09:29 AM
                0 responses
                5 views
                0 likes
                Last Post gwenael
                by gwenael
                 
                Started by Karado58, 11-26-2012, 02:57 PM
                8 responses
                14,830 views
                0 likes
                Last Post Option Whisperer  
                Working...
                X