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 Karado58, 11-26-2012, 02:57 PM
        8 responses
        14,828 views
        0 likes
        Last Post Option Whisperer  
        Started by Option Whisperer, Today, 09:05 AM
        0 responses
        1 view
        0 likes
        Last Post Option Whisperer  
        Started by cre8able, Yesterday, 01:16 PM
        3 responses
        11 views
        0 likes
        Last Post cre8able  
        Started by Harry, 05-02-2018, 01:54 PM
        10 responses
        3,204 views
        0 likes
        Last Post tharton3  
        Started by ChartTourist, Today, 08:22 AM
        0 responses
        6 views
        0 likes
        Last Post ChartTourist  
        Working...
        X