Austin, TX
Experience: Beginner
Platform: NinjaTrader
Broker: NT Broker
Trading: ES
Posts: 121 since Mar 2015
Thanks Given: 258
Thanks Received: 70
|
I'm a bit timid about posting such a newbie question, but newbie I am. I am on NinjaTrader 7 and looking at the ES. Still in diapers... er demo accounts.
The basic question is: How does one classify a trade as a "Sell" or a "Buy"? Every trade has a buyer and a seller. Is it compared to the last "Ask" or "Bid" no matter how off the wall their price might have been? Or should it be compared to the current "Ask" / "Bid" Depth of Market book?
The remaining portion of this note is what I was doing when I discovered a perceived inconsistency in BuySellVolume and provides some detail into the technicalities.
I created a NT strategy that built the "DOM" book from the Lvl 2 OnMarketDepth data. I validated that my results and what were shown on NT's SuperDOM were consistent. I then proceeded to classify the "Last" transaction's Price to what was in the Lvl2 book I had created and declare the trade as a "Buy" or a "Sell". I had examined the code from the NT BuySellVolume indicator and can see that if a bar has a Close price greater or equal to "GetCurrentAsk" price, then the trade is classified as a "Buy". Likewise if a Close price is less or equal to "GetCurrentBid" price, then it's classified as a "Sell".
This even made sense. Looking at the NT SuperDom I see the Ask prices ascending on the right and the Bid prices descending on the left. Clearly, says I, a trade made in the Ask price regions is a Buyer motivated to acquire and places a bid at a higher price - a "Buy". Likewise a trade made in the Bid regions is a Seller willing to take a lower price - a "Sell".
Is this basic thought correct or am I off-base somehow?
So I fire up my strategy to dump out data and see what I get. Somewhere along the way I see this big volume spike and decide to investigate. I haz lots data! BuySellVolume shows it as green (a buy) on a 5 tick chart. I find the entry in the flood of data I had generated and see that I had actually classified this trade as a "Sell". Whoa Nelly, something isn't right!
With the wonders of market reply, I dump out a gob of data and look to see what's what. I find that the Lvl2 book is current and that the last update to the base ask position (lowest ask price) is 2,058.25. Shortly thereafter there is an "Ask" @ 2,058.00 in the Lvl 1 data followed immediately by a "Last" @ 2,058.00.
This "Last" price is the ceiling/highest of the "Bid" DOM.
What I see is that a seller dumpped in an Ask with a fair sized volume attached to it and that it immediately traded because it was in the "Bid" region - hungy buyers were waiting. I therefore classified this as a "Sell" because the Seller was motivated enough to sell at a price lower than the lowest outstanding Ask price.
However the BuySellVolume classified this a "Buy" because trade price 2058.00 is "Greater than or equal to" GetCurrentAsk of 2058.00.
So, I'm reaching out to the crew here and looking for some edjumacation. What gives? Is my understanding on how to classify wrong? Is BuySellVolume wrong? What's the correct way to classify a trade as "Buy" or "Sell" ?
Output from dump:
Time 3/18/2015 8:46:15 AM, OnMarketDepth, Type Ask, Operation Update, Position 0, Price 2,058.25, Volume 197
<snip>
Time 3/18/2015 8:46:16 AM, OnMarketData, Type Ask, Price 2,058.00, Volume 535
Time 3/18/2015 8:46:16 AM, OnMarketData, Type Last, Class Sell, Price 2,058.00, Volume 487, AskPrice[0] 2,058.25, AskDepth[0] 197, BidPrice[0] 2,058.00, BidDepth[0] 465
-g
|