Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Equivalent of BarColor

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

    Equivalent of BarColor

    Hi,
    I'm trying to recreate a paint bar type of indicator. I use to just set the BarColor property. What is the equivalent in NT8?

    #2
    Color object is no longer used, these properties have been renamed to match their new Brush type

    Code:
    BarBrush = Brushes.Blue;
    MatthewNinjaTrader Product Management

    Comment


      #3
      Thanks Matt,
      One more question, I use to set a plots opacity by defining the color using:

      Color.FromArgb(Math.Min(255, Math.Max(0, Convert.ToInt32(opacity * 0.01 * 255))), color)

      I tried setting the opacity by:

      Plots[0].Brush.Opacity = 0.5d;

      but it didn't like that. Could you point me in the right direction?

      Comment


        #4
        The Plots brush is frozen when it is instantiated , which means it's read-only and cannot be modified at runtime.

        If you wish to change a plot's brush property, you need to first clone the desired plot brush, make the changes, and then make sure you call Freeze() on that new brush to prevent further access issues

        Code:
        	Brush myBrush = Plots[0].Brush.Clone();
        	myBrush.Opacity = 0.5f;
        	myBrush.Freeze();
        	Plots[0].Brush = myBrush;
        Attached is a complete example of how to change the opacity of entire plot series.
        Attached Files
        MatthewNinjaTrader Product Management

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        662 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        376 views
        1 like
        Last Post Geovanny Suaza  
        Started by Mindset, 02-09-2026, 11:44 AM
        0 responses
        110 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by Geovanny Suaza, 02-02-2026, 12:30 PM
        0 responses
        575 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        580 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X