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 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.
    JimNinjaTrader Customer Service

    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.
        JimNinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by judysamnt7, 03-13-2023, 09:11 AM
        4 responses
        59 views
        0 likes
        Last Post DynamicTest  
        Started by ScottWalsh, Today, 06:52 PM
        4 responses
        36 views
        0 likes
        Last Post ScottWalsh  
        Started by olisav57, Today, 07:39 PM
        0 responses
        7 views
        0 likes
        Last Post olisav57  
        Started by trilliantrader, Today, 03:01 PM
        2 responses
        21 views
        0 likes
        Last Post helpwanted  
        Started by cre8able, Today, 07:24 PM
        0 responses
        10 views
        0 likes
        Last Post cre8able  
        Working...
        X