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

Bid-Ask Volume vs Buy-Sell Volume ???

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

    Bid-Ask Volume vs Buy-Sell Volume ???

    Hi,

    A client requests me a Volume Delta indicator.
    (Volume Delta = Ask Volume - Bid Volume)

    I take the idea from BuySellVolume, a default indicator by NinjaTrader.

    As far as I know, the way NinjaTrader coded BuySellVolume is based on the well known definition:
    • Buy Volume = Ask Volume (the volume that occurs at the Ask price)
    • Sell Volume = Bid Volume (the volume that occurs at the Bid price)


    Source: http://daytrading.about.com/od/daytr...dAskVolume.htm

    So:
    Buy Volume = Ask Volume
    Sell Volume = Bid Volume
    And therefore:
    Volume Delta = Buy Volume - Sell Volume
    (I mean the buy & sell volumes computed by BuySellVolume indicator)
    Am I correct about this?

    Thank you very much.
    Pi
    ninZa
    NinjaTrader Ecosystem Vendor - ninZa.co

    #2

    Comment


      #3
      Hello NinZa,

      Thank you for your post and thanks to Sledge for answering.

      That is a fair assessment for the Volume difference for Buy and Sell.

      If the client is looking for this kind of Delta, then when this is positive value there are more buys then sells and vice versa for negative value.
      Cal H.NinjaTrader Customer Service

      Comment


        #4
        Originally posted by NinjaTrader_Cal View Post
        Hello NinZa,

        Thank you for your post and thanks to Sledge for answering.

        That is a fair assessment for the Volume difference for Buy and Sell.

        If the client is looking for this kind of Delta, then when this is positive value there are more buys then sells and vice versa for negative value.
        Thanks sledge and Cal.

        I just ask for a confirmation of the formula used to calculate volume delta. The programming is straightforward.

        As Cal said, using the formula: volume delta = buy volume - sell volume is a fair assessment.

        I ask this question because the client says the volume delta of my version (which uses buy & sell volumes of the default BuySellVolume indicator) is different from Gomi's version. I'm not sure Gomi used the same formula. So I just want to know if there is 1 or many formulas to compute the volume delta.

        Thanks.
        Pi
        ninZa
        NinjaTrader Ecosystem Vendor - ninZa.co

        Comment


          #5
          You will probably need to use the OnMarketData() method for more accuracy and to match Gomi.

          Dan
          eDanny
          NinjaTrader Ecosystem Vendor - Integrity Traders

          Comment


            #6
            Originally posted by ninZa View Post
            Thanks sledge and Cal.

            I just ask for a confirmation of the formula used to calculate volume delta. The programming is straightforward.

            As Cal said, using the formula: volume delta = buy volume - sell volume is a fair assessment.

            I ask this question because the client says the volume delta of my version (which uses buy & sell volumes of the default BuySellVolume indicator) is different from Gomi's version. I'm not sure Gomi used the same formula. So I just want to know if there is 1 or many formulas to compute the volume delta.

            Thanks.
            Pi
            That will depend on how you (same applies to NT and Gomi) are defining BuyVolume and SellVolume. Is there NeutralVolume/UnknownVolume/UnclassifiedVolume, and how does it affect your calculations?

            Comment


              #7
              Originally posted by eDanny View Post
              You will probably need to use the OnMarketData() method for more accuracy and to match Gomi.

              Dan
              Can you explain the difference between the OnMarketData and OnBarUpdate approaches, Dan? I have not investigated this issue thoroughly, but at a glance I see both of them use the same data:
              • OnBarUpdate: get the last price via Close[0], and bid, ask prices via GetCurrentBid(), GetCurrentAsk()
              • OnMarketData: get the last, bid, ask prices via MarketDataEventArgs


              The same data, just the way we access them is different, so it should be identical. Am I wrong at some point, Dan?


              =====================================


              Originally posted by koganam
              That will depend on how you (same applies to NT and Gomi) are defining BuyVolume and SellVolume. Is there NeutralVolume/UnknownVolume/UnclassifiedVolume, and how does it affect your calculations?
              Yes I believe it's the way we define Buy vol and Sell vol. I'm not sure what neutral, unknown, unclassified volumes mean. The way I code my Volume Delta is the same as BuySellVolume of NT:
              Code:
              if (Close[0] >= GetCurrentAsk())
              	buys += tradeVol;
              else if (Close[0] <= GetCurrentBid())
              	sells += tradeVol;
              Buy Volume = the volume that occurs at the Ask price (last price >= Ask price)
              Sell Volume = the volume that occurs at the Bid price (last price <= Bid price)

              Can you make a comment on this, koganam?

              A problem that seemed simple has turned into a real headache to me

              Thank you very much for the kind help from you, fellow vendors.
              Pi
              Last edited by ninZa; 01-04-2015, 06:04 PM.
              ninZa
              NinjaTrader Ecosystem Vendor - ninZa.co

              Comment


                #8
                Originally posted by ninZa View Post
                Can you explain the difference between the OnMarketData and OnBarUpdate approaches, Dan? I have not investigated this issue thoroughly, but at a glance I see both of them use the same data:
                • OnBarUpdate: get the last price via Close[0], and bid, ask prices via GetCurrentBid(), GetCurrentAsk()
                • OnMarketData: get the last, bid, ask prices via MarketDataEventArgs


                The same data, just the way we access them is different, so it should be identical. Am I wrong at some point, Dan?


                =====================================




                Yes I believe it's the way we define Buy vol and Sell vol. I'm not sure what neutral, unknown, unclassified volumes mean. The way I code my Volume Delta is the same as BuySellVolume of NT:
                Code:
                if (Close[0] >= GetCurrentAsk())
                	buys += tradeVol;
                else if (Close[0] <= GetCurrentBid())
                	sells += tradeVol;
                Buy Volume = the volume that occurs at the Ask price (last price >= Ask price)
                Sell Volume = the volume that occurs at the Bid price (last price <= Bid price)

                Can you make a comment on this, koganam?

                A problem that seemed simple has turned into a real headache to me

                Thank you very much for the kind help from you, fellow vendors.
                Pi
                What about the volume that occurs on the inside: neither at the Bid nor the Ask? That is what I mean by UnclassifiedVolume.
                Last edited by koganam; 01-05-2015, 08:29 AM.

                Comment


                  #9
                  Originally posted by koganam View Post
                  Waht about the volume that occurs on the inside: neither at the Bid nor the Ask? That is what I mean by UnclassifiedVolume.
                  That kind of volume is simply ignored, Koganam. We neither credit it to buy vol nor to sell vol.

                  Thanks.
                  Pi
                  ninZa
                  NinjaTrader Ecosystem Vendor - ninZa.co

                  Comment


                    #10
                    Originally posted by ninZa View Post
                    Can you explain the difference between the OnMarketData and OnBarUpdate approaches, Dan? I have not investigated this issue thoroughly, but at a glance I see both of them use the same data:
                    • OnBarUpdate: get the last price via Close[0], and bid, ask prices via GetCurrentBid(), GetCurrentAsk()
                    • OnMarketData: get the last, bid, ask prices via MarketDataEventArgs


                    The same data, just the way we access them is different, so it should be identical. Am I wrong at some point, Dan?
                    I seem to figure out the difference. The data we get from the 2 approaches at any point are identical. However, the accumulation of volumes may be different because:
                    • OnMarketData: our volume computation is executed when ANY of the bid, ask, last prices changes.
                    • OnBarUpdate: our volume computation is executed ONLY when the last price changes. Therefore, sometimes the bid or ask changes and makes a qualifying volume but the volume is ignored in our computation.


                    Am I right, Dan?

                    Thanks.
                    Pi
                    Last edited by ninZa; 01-05-2015, 03:27 AM.
                    ninZa
                    NinjaTrader Ecosystem Vendor - ninZa.co

                    Comment


                      #11
                      You are correct in understanding Pi, the OnBarUpdate will need price updates.
                      BertrandNinjaTrader Customer Service

                      Comment


                        #12
                        Originally posted by NinjaTrader_Bertrand View Post
                        You are correct in understanding Pi, the OnBarUpdate will need price updates.
                        Thanks.
                        I'm editing the algorithm accordingly.
                        ninZa
                        NinjaTrader Ecosystem Vendor - ninZa.co

                        Comment


                          #13
                          Originally posted by ninZa View Post
                          That kind of volume is simply ignored, Koganam. We neither credit it to buy vol nor to sell vol.

                          Thanks.
                          Pi
                          I must not have been clear. That is my point. You ignore it. Does Gomi?

                          Comment


                            #14
                            Originally posted by koganam View Post
                            I must not have been clear. That is my point. You ignore it. Does Gomi?
                            I don't know anything about Gomi's algorithm

                            As Dan pointed out, Gomi uses OnMarketData approach.
                            I have edited the indicator using OnMarketData and sent it to my client.

                            Waiting for his reply whether my version and Gomi's produce the same results .

                            Thank you for your help, Koganam.
                            ninZa
                            NinjaTrader Ecosystem Vendor - ninZa.co

                            Comment


                              #15
                              Today I have just released Volume Delta as the latest free indicator by ninZa.co.

                              Description: http://ninza.co/product/volume-delta
                              File: Download now

                              Thank you for all your helps and supports
                              Pi
                              ninZa
                              NinjaTrader Ecosystem Vendor - ninZa.co

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by sidlercom80, 10-28-2023, 08:49 AM
                              168 responses
                              2,262 views
                              0 likes
                              Last Post sidlercom80  
                              Started by Barry Milan, Yesterday, 10:35 PM
                              3 responses
                              10 views
                              0 likes
                              Last Post NinjaTrader_Manfred  
                              Started by WeyldFalcon, 12-10-2020, 06:48 PM
                              14 responses
                              1,429 views
                              0 likes
                              Last Post Handclap0241  
                              Started by DJ888, 04-16-2024, 06:09 PM
                              2 responses
                              9 views
                              0 likes
                              Last Post DJ888
                              by DJ888
                               
                              Started by jeronymite, 04-12-2024, 04:26 PM
                              3 responses
                              41 views
                              0 likes
                              Last Post jeronymite  
                              Working...
                              X