• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

BackColor paints too much

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

    BackColor paints too much

    1) Chart is moved slightly to the left to make some drawing space.
    2) BackColor is used to color bars according to some rule.
    3) The rule kicks in on the last (current) bar.
    4) The complete area to the right of the bar is colored as well.

    The free area to the right of the chart flashes madly if the rule for coloring is continuously activated and deactivated. I hope this isn't by design and that you can change it to only color the background of the bar.

    I've attached a small snippet showing the problem, BackColor being set to dark gray.
    Attached Files

    #2
    I've tried to reproduce this but was unsuccessful. What is the rule you're using?
    VinceNinjaTrader Customer Service

    Comment


      #3
      Originally posted by NinjaTrader_Vincent View Post
      I've tried to reproduce this but was unsuccessful. What is the rule you're using?
      I'm sorry that I was unclear. It isn't the rule that is the problem.

      I've attached another image that is larger and hopefully clearer. It sets BackColor for "outside bars". The problem is that BackColor paints the background of the last bar and the rest of the free area to the right of the bar.

      If you then have a rule that evaluates to "true", "false" etc several times intrabar, that switching of color of the large free area is visually disturbing. It would be much better if only the background color of the bar in question was painted.
      Attached Files

      Comment


        #4
        Thanks for your suggestion. We'll add it to the list of future considerations.
        DierkNinjaTrader Customer Service

        Comment


          #5
          BackColor only paints realtime

          NT 7 user

          Recently I updated an oscillator so that the background color would change to blue if it crossed the zero line and red if it passed below. This is the code:

          if (colorbackground) //DH 08/15/2017
          {
          if (SignalLine[0] > zeroline)
          BackColor = Color.FromArgb(opacity,upColor);
          }

          {
          if (SignalLine[0] < zeroline)
          BackColor = Color.FromArgb(opacity,downColor);
          }

          The indicator compiles fine and works great with the exception that it only works real time. While the market is moving then the background colors on a bar by bar basis starting at the currently bar. Gradually this updates as more bars are added but none of the previous bars cause the background to change. Then if there is any need for the indicators on the chart to be changed then when that change is applied the background is wiped clear and it starts again.

          I know that it must be something that I am doing wrong because this functionality is in many indicators but as a newbie programmer I would be most grateful if you could point me in the right direction.

          Thanks

          David

          Comment


            #6
            Hello David,

            What is it you'd like the indicator to do? Have a different background for each bar, similar to the picture I have posted?

            I look forward to your reply.
            Attached Files
            Alan P.NinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by TazoTodua, Today, 06:00 AM
            0 responses
            7 views
            0 likes
            Last Post TazoTodua  
            Started by Thans1946, Today, 04:04 AM
            0 responses
            5 views
            0 likes
            Last Post Thans1946  
            Started by gbux11, Today, 02:36 AM
            0 responses
            8 views
            0 likes
            Last Post gbux11
            by gbux11
             
            Started by fx.practic, Today, 01:47 AM
            0 responses
            14 views
            0 likes
            Last Post fx.practic  
            Started by bneccv, Yesterday, 09:25 PM
            0 responses
            5 views
            0 likes
            Last Post bneccv
            by bneccv
             
            Working...
            X