Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Bar coloring from under the second data series

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

    Bar coloring from under the second data series

    Bar coloring from under the second data series

    How can I color bar from under the additional data series?

    This is what I use for the Plot - it works fine

    Code:
     protected override void OnBarUpdate()
    {
    
    if (BarsInProgress == 1)
    {
    if (LOGIC)
    {
    Price1 = High[0];
    Price2 = Low[0];
    
    
    }
    }
    
    if (BarsInProgress == 0)
    {
    Values[0][1] = Price1;
    Values[1][1] = Price2;
    
    // COLOR BAR FROM BarsInProgress == 1 ???
    }
    }

    If something like that for filling the bar?

    #2
    Hello memonolog,

    Thanks for your post.

    You can use BarBrush to set the current bar of the primary series of the chart to a particular color.

    You can use BarBrushes[] to set a bars ago of the primary series of the chart to a particular color.

    You would not be able to change a second data series on the chart.

    References:

    Comment


      #3
      Originally posted by NinjaTrader_PaulH View Post
      Hello memonolog,

      Thanks for your post.

      You can use BarBrush to set the current bar of the primary series of the chart to a particular color.

      You can use BarBrushes[] to set a bars ago of the primary series of the chart to a particular color.

      You would not be able to change a second data series on the chart.

      References:

      https://ninjatrader.com/support/help...barbrushes.htm
      What is the correct syntax? exactly for the second date of the series

      BarBrushes[1][1]= Brushes.Blue; ???

      Comment


        #4
        Hello memonolog,

        Thanks for your reply.

        The correct syntax is shown in the help guide links. You cannot use [ ] [ ].

        Can you clarify what you are trying to do as it is not clear to me.

        Are you trying to color a second data series on chart? If so that cannot be done.

        If you are trying to color the primary series of the chart from the conditions based on an added data series? That can be done but would be best done in BarsInProgress 0

        Comment

        Latest Posts

        Collapse

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