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 Stanfillirenfro, Today, 07:23 AM
        1 response
        4 views
        0 likes
        Last Post NinjaTrader_Gaby  
        Started by cmtjoancolmenero, Yesterday, 03:58 PM
        2 responses
        22 views
        0 likes
        Last Post cmtjoancolmenero  
        Started by olisav57, Yesterday, 07:39 PM
        1 response
        9 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by cocoescala, 10-12-2018, 11:02 PM
        7 responses
        944 views
        0 likes
        Last Post Jquiroz1975  
        Started by oviejo, Today, 12:28 AM
        1 response
        12 views
        0 likes
        Last Post NinjaTrader_Gaby  
        Working...
        X