Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

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:

    Paul H.NinjaTrader Customer Service

    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
        Paul H.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by helpwanted, Today, 03:06 AM
        0 responses
        3 views
        0 likes
        Last Post helpwanted  
        Started by Brevo, Today, 01:45 AM
        0 responses
        7 views
        0 likes
        Last Post Brevo
        by Brevo
         
        Started by aussugardefender, Today, 01:07 AM
        0 responses
        5 views
        0 likes
        Last Post aussugardefender  
        Started by pvincent, 06-23-2022, 12:53 PM
        14 responses
        242 views
        0 likes
        Last Post Nyman
        by Nyman
         
        Started by TraderG23, 12-08-2023, 07:56 AM
        9 responses
        384 views
        1 like
        Last Post Gavini
        by Gavini
         
        Working...
        X