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 charlesugo_1, 05-26-2026, 05:03 PM
            0 responses
            60 views
            0 likes
            Last Post charlesugo_1  
            Started by DannyP96, 05-18-2026, 02:38 PM
            1 response
            145 views
            0 likes
            Last Post NinjaTrader_ChelseaB  
            Started by CarlTrading, 05-11-2026, 05:56 AM
            0 responses
            161 views
            0 likes
            Last Post CarlTrading  
            Started by CarlTrading, 05-10-2026, 08:12 PM
            0 responses
            97 views
            0 likes
            Last Post CarlTrading  
            Started by Hwop38, 05-04-2026, 07:02 PM
            0 responses
            283 views
            0 likes
            Last Post Hwop38
            by Hwop38
             
            Working...
            X