• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

BuySellVolume indicator

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

    BuySellVolume indicator

    I don't quite understand what is the rationale behind that indicator. In order to find out how it works, I modified the Initialize() code this way :
    protected override void Initialize()
    {
    Add(new Plot(new Pen(Color.Red, 2), PlotStyle.Square, "Sells"));
    Add(new Plot(new Pen(Color.Green, 2), PlotStyle.Square, "Buys"));
    CalculateOnBarClose = false;
    DisplayInDataBox = false;
    // PaintPriceMarkers = false;
    PlotsConfigurable = true;
    }

    I then opened a Time & Sales window to trace the trades and the pricemarkers which yielded to this figures :

    Time: Green trade: Red trade: Green pricemarker: Red pricemarker:
    18:53:16 start time 9719 980
    18:53:17 0 64 9783 1044
    18:53:19 11 21 9815 1065

    It looks like volume traded at a price <= current bid is added to red pricemarker ("Sells" plot) which is common sense but it is also added to green pricemarker ("Buys" plot) as well as volume traded at a price >= current ask which get me confused since I would wait for the "Buys" plot to tally only volume traded at a price >= current ask.
    Did I miss something ?

    Gérard

    #2
    Very observant. This is correct. The purpose of this indicator is NOT to display absolute values but to display a histogram relationship. In order to get the desired visual display, I had to create one bar (buys) that has the total buys and sells. Then I put the sells bars in front of it which only has the sells volume and hides the sells portion of the buys bar so what you see is a green one bar split with green and red color.
    RayNinjaTrader Customer Service

    Comment


      #3
      Another Possibility

      Hello
      A question to the cracks . May it be possible to code something like this?
      It's just showing the number of contracts traded at the bid versus number of contracts traded at the ask , so called marketdelta. It's from tradestation.
      regs
      Jojo
      Attached Files

      Comment


        #4
        Technically this is possible but it is far outside of the scope of what is officially supported.

        Perphaps this product may do the trick or, the developer of this product is capable of custom coding this indicator for a fee.

        http://fin-alg.com/tpoandvolumechart.html
        RayNinjaTrader Customer Service

        Comment


          #5
          I modified the BuySellVolume indicator so as to watch one red pricemarker and one green pricemarker displaying red trade volume and green trade volume from the Time & Sales window. The code is :

          if (firstPaint)
          firstPaint = false;
          else
          {
          double tradeVol = previousVol == 0 ? Volume[0] : Volume[0] - previousVol;
          if (Close[0] >= GetCurrentAsk())
          {
          buys += tradeVol;
          positive.Set(tradeVol);
          negative.Set(0);
          }
          else if (Close[0] <= GetCurrentBid())
          {
          sells += tradeVol;
          negative.Set(tradeVol);
          positive.Set(0);
          }
          }

          previousVol = Volume[0];
          if (!firstPaint && !Historical)
          {
          Values[0].Set(negative[0]);
          Values[1].Set(positive[0]);
          }

          It went Ok then I wanted to get those trade volume displayed for a limited number of ticks; so I modified the two above lines this way :

          if(CurrentBar < period)
          return;
          Values[0].Set(SUM(negative, period)[0]);
          Values[1].Set(SUM(positive, period)[0]);

          The result is very disappointing : using Market Replay, as the T&S window shows green volume = 1 and red volume = 250, the green pricemarker is 345K and the red pricemarker is 1 !

          I welcome any help.
          Gérard

          Comment


            #6
            Ninjatrader Ray,

            Could you please post that volume indicator. I would really like to have something like that.

            Thanks,

            Geoff

            Comment


              #7
              Unfortunately I do not have an indicator to post
              RayNinjaTrader Customer Service

              Comment


                #8
                I was just wondering if its possible to save this data for the next time i open the program?
                Also is it possible to set the larger bar on top, instead of the green all the time? it would make it a whole lot easier to see which side produced the higher volume.

                Comment


                  #9
                  Unfortunately not on both items.
                  RayNinjaTrader Customer Service

                  Comment


                    #10
                    since the green column is buys+sells, not buys like I had first thought, could someone explain how to read (interpret) this indicator properly? thanks.

                    Comment


                      #11
                      Green column represents buys but is consctructed of buy + sells since once the red bar is show, it sits in front of the green bar. Thus, what is left visually on the green bar is the buys. Its a visual trick. The values in the databox really serve no purpose and would give you the total value of buys + sells.
                      RayNinjaTrader Customer Service

                      Comment

                      Latest Posts

                      Collapse

                      Topics Statistics Last Post
                      Started by matthewbartlett, Today, 01:22 AM
                      2 responses
                      12 views
                      0 likes
                      Last Post NinjaTrader_Jim  
                      Started by thomaspartyof10, Today, 02:33 AM
                      1 response
                      19 views
                      0 likes
                      Last Post NinjaTrader_Jesse  
                      Started by manueldecastro, Yesterday, 12:57 AM
                      1 response
                      16 views
                      0 likes
                      Last Post NinjaTrader_ChrisL  
                      Started by ArmKnuckle, Today, 01:59 AM
                      1 response
                      17 views
                      0 likes
                      Last Post NinjaTrader_PaulH  
                      Started by seppyr, Today, 01:53 AM
                      1 response
                      17 views
                      0 likes
                      Last Post NinjaTrader_PaulH  
                      Working...
                      X