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 NullPointStrategies, 03-13-2026, 05:17 AM
        0 responses
        86 views
        0 likes
        Last Post NullPointStrategies  
        Started by argusthome, 03-08-2026, 10:06 AM
        0 responses
        151 views
        0 likes
        Last Post argusthome  
        Started by NabilKhattabi, 03-06-2026, 11:18 AM
        0 responses
        79 views
        0 likes
        Last Post NabilKhattabi  
        Started by Deep42, 03-06-2026, 12:28 AM
        0 responses
        53 views
        0 likes
        Last Post Deep42
        by Deep42
         
        Started by TheRealMorford, 03-05-2026, 06:15 PM
        0 responses
        60 views
        0 likes
        Last Post TheRealMorford  
        Working...
        X