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 DynamicTest, Today, 11:18 PM
        0 responses
        3 views
        0 likes
        Last Post DynamicTest  
        Started by dcriador, Today, 01:43 AM
        3 responses
        19 views
        0 likes
        Last Post dcriador  
        Started by smartromain, Today, 10:50 PM
        0 responses
        5 views
        0 likes
        Last Post smartromain  
        Started by popecapllc, 08-09-2023, 07:42 PM
        10 responses
        1,366 views
        0 likes
        Last Post BartMan
        by BartMan
         
        Started by jbays87, Today, 09:46 PM
        0 responses
        6 views
        0 likes
        Last Post jbays87
        by jbays87
         
        Working...
        X