• 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

  • NinjaTrader_AlanP
    replied
    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

    Leave a comment:


  • DavidHunter
    replied
    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

    Leave a comment:


  • NinjaTrader_Dierk
    replied
    Thanks for your suggestion. We'll add it to the list of future considerations.

    Leave a comment:


  • tobbe
    replied
    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

    Leave a comment:


  • NinjaTrader_VinceB
    replied
    I've tried to reproduce this but was unsuccessful. What is the rule you're using?

    Leave a comment:


  • tobbe
    started a topic BackColor paints too much

    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

Latest Posts

Collapse

Topics Statistics Last Post
Started by manzo215, Today, 01:19 PM
1 response
2 views
0 likes
Last Post NinjaTrader_Jesse  
Started by sdauteuil, Today, 01:27 PM
0 responses
2 views
0 likes
Last Post sdauteuil  
Started by martyn73, Today, 01:20 PM
0 responses
3 views
0 likes
Last Post martyn73  
Started by mtamaku, Today, 01:01 PM
2 responses
3 views
0 likes
Last Post NinjaTrader_Kate  
Started by evanp90, Today, 12:32 PM
0 responses
4 views
0 likes
Last Post evanp90
by evanp90
 
Working...
X