Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

change bar colors on previous bar

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

    change bar colors on previous bar

    Hello,
    I would like to be able to set a user defined variable (n) and each time a new bar closes, change the color of all bars further back than bar(n). For example, lets say I want the chart to plot the latest 10 bars in red and all others in black. Is this possible?

    thanks.

    #2
    Hello billr,

    That would be possible. You would have to overload the Plot() method like in the HeikenAshi indicator. To view the source code of the HeikenAshi Indicator you may go to the Tools -> Edit NinjaScript -> Indicators and double click on the HeikenAshi.

    Let us know if we can be of further assistance.
    JCNinjaTrader Customer Service

    Comment


      #3
      Originally posted by billr View Post
      Hello,
      I would like to be able to set a user defined variable (n) and each time a new bar closes, change the color of all bars further back than bar(n). For example, lets say I want the chart to plot the latest 10 bars in red and all others in black. Is this possible?

      thanks.
      Look up BarColorSeries in NT Help.

      ref: http://www.ninjatrader.com/support/h...olorseries.htm

      Code:
      BarColorSeries[n] = Color.Black;
      Last edited by koganam; 12-30-2012, 02:52 PM.

      Comment


        #4
        Just saw your response to this. I assumed that BarColorSeries(10), for example, would only affect bar (10). I'll give it a try. Thanks.

        Comment


          #5
          Originally posted by billr View Post
          Just saw your response to this. I assumed that BarColorSeries(10), for example, would only affect bar (10). I'll give it a try. Thanks.
          Yes, but you are doing it on a stream, so on each bar, it is coloring the bar 10 bars back, which then stays that color.

          Comment


            #6
            OK, wasn't sure if they might reset, makes sense. Thanks again!

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by Geovanny Suaza, 02-11-2026, 06:32 PM
            0 responses
            646 views
            0 likes
            Last Post Geovanny Suaza  
            Started by Geovanny Suaza, 02-11-2026, 05:51 PM
            0 responses
            367 views
            1 like
            Last Post Geovanny Suaza  
            Started by Mindset, 02-09-2026, 11:44 AM
            0 responses
            107 views
            0 likes
            Last Post Mindset
            by Mindset
             
            Started by Geovanny Suaza, 02-02-2026, 12:30 PM
            0 responses
            569 views
            1 like
            Last Post Geovanny Suaza  
            Started by RFrosty, 01-28-2026, 06:49 PM
            0 responses
            573 views
            1 like
            Last Post RFrosty
            by RFrosty
             
            Working...
            X