Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Bar Coloring Offset

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

    Bar Coloring Offset

    Hello,

    I couldnt find in "NinjaTrader8 HelpGuide" how one can backcolor bars. If a certain condition is true and lets say calculated during the last 5 bars then do coloring those 5 bars.

    Thank you!
    Tony

    #2
    Hello tonynt,

    Thanks for your post.

    Changing the color of a bar can be done with BarBrush. Setting the color historically can be done with BarBrushes[]. If you are referring to the background color behind the bar, BackBrush and BackBrushes[] can be used respectively.

    Documentation and example code for BarBrush and BarBrushes can be found below.

    BarBrush - https://ninjatrader.com/support/help...s/barbrush.htm
    BarBrushes - https://ninjatrader.com/support/help...barbrushes.htm

    Documentation and example code for BackBrush and BackBrushes can be found below.

    BackBrush - https://ninjatrader.com/support/help.../backbrush.htm
    BackBrushes - https://ninjatrader.com/support/help...ackbrushes.htm

    Please let us know if you have any questions.

    Comment


      #3
      Hello,

      thank you for your reply. When working with BarBrushes in a script with only primary dataseries it works all OK. But when I use it in a script with eg 3 dataseries there are strange plottings.

      I thought it is the same problem that would be eg with using High[0] instead of referring accurately with Highs[0][0] (when using more dataseries)

      But there are error messages when compiling once I use eg BarBrushes[0][1] = Brushes.Cyan;

      How can one use BarBrushes in a script with more than 1 dataseries please so that plotting is correctly and to avoid issues.

      Thank you!
      Tony
      Last edited by tonynt; 02-11-2019, 08:48 AM. Reason: typing error

      Comment


        #4
        Hello tonynt,

        Indicator drawings and plots are relative to the primary data series. The same applies for BarBrush and BackBrush. In a multi time frame NinjaScript, it would be advised to use BarBrush and BackBrush on BarsInProgress 0 iterations of OnBarUpdate.

        BarsInProgress - https://ninjatrader.com/support/help...inprogress.htm

        Please let us know if you have any questions.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Mindset, 04-21-2026, 06:46 AM
        0 responses
        88 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by M4ndoo, 04-20-2026, 05:21 PM
        0 responses
        134 views
        0 likes
        Last Post M4ndoo
        by M4ndoo
         
        Started by M4ndoo, 04-19-2026, 05:54 PM
        0 responses
        68 views
        0 likes
        Last Post M4ndoo
        by M4ndoo
         
        Started by cmoran13, 04-16-2026, 01:02 PM
        0 responses
        119 views
        0 likes
        Last Post cmoran13  
        Started by PaulMohn, 04-10-2026, 11:11 AM
        0 responses
        67 views
        0 likes
        Last Post PaulMohn  
        Working...
        X