Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Volume Bars color-coded according to Price change

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

    Volume Bars color-coded according to Price change

    Every other charting package I've used allows the Volume Bars to be color-coded based on Current Price compared to previous Price (e.g., at previous bar close). Ideally with support for three colors (<, ==, >)

    It is a fairly basic function that I cannot find in NinjaTrader.

    Is it being added?
    If not how can it be coded? I am fairly good at pattern matching...
    Attached Files

    #2
    This doesn't do everything that's in your screen shot, but it only took a couple of minutes to do and it's a start (see attached.)
    Attached Files

    Comment


      #3
      KBJ, Thank you!!!!
      That looks good.

      By reading the cs file, it looked like I could modify to get what I wanted...
      Changed up color to black, down to red, added a 3rd equal color of mediumOrchid (~light purple), and changed the test to reference [Price] Close instead of Volume.

      It looks good! I'll test it out over the next day or so...
      Thank you very much for your help -- getting started with something new can be a challenge initially.

      Appreciate the help
      Attached Files

      Comment


        #4
        Good job!

        I was wondering when the purple bars were supposed to be drawn.

        I like it better this way.
        Attached Files

        Comment


          #5
          Interesting, KBJ... Often, price bars are colored red if falling, green (or black) if rising. So I tend to associate
          .... red volume with falling price and
          .... black (or green) volume with rising price.

          BTW, from reading the manual,
          CalculateOnBarClose = false;
          is the ONLY way to get intrabar updates -- which obviously I need on Volume bars. So does that mean I should add the stmt immediately before the closing bracket } of the protected override void Initialize() section as the very last stmt in that section, in order to make that the default?

          Finally, I need some extra Y-axis clear space over the Volume bars (so I could draw some lines) and that caused my 0 line to rise also -- now I have some wasted empty space underneath Volume (since Volume cannot be negative). Is there a way to instruct the software that this value (plot) should always keep 0 at the bottom of the panel?

          Comment


            #6
            The statement "CalculateOnBarClose = false;" can be placed anywhere in the Initialize() method.

            I don't know how to adjust the vertical space.

            Comment


              #7
              There may be some more advanced plot overriding techniques you can use to achieve it, but it would require a lot more advance programming then that of which we provide support for. Perhaps you could try clicking on the y-axis scale and dragging it up and down to adjust it?
              Josh P.NinjaTrader Customer Service

              Comment


                #8
                Just wanted to say the script posted here worked in my NT 7 just fine. It contains three different volume bar colors- red is down vol, green is up vol and i changed the color for neutral vol to yellow. Thanks to the original poster for this thread and to the script writer.

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                0 responses
                577 views
                0 likes
                Last Post Geovanny Suaza  
                Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                0 responses
                334 views
                1 like
                Last Post Geovanny Suaza  
                Started by Mindset, 02-09-2026, 11:44 AM
                0 responses
                101 views
                0 likes
                Last Post Mindset
                by Mindset
                 
                Started by Geovanny Suaza, 02-02-2026, 12:30 PM
                0 responses
                553 views
                1 like
                Last Post Geovanny Suaza  
                Started by RFrosty, 01-28-2026, 06:49 PM
                0 responses
                551 views
                1 like
                Last Post RFrosty
                by RFrosty
                 
                Working...
                X