Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I am sure its me not thinking properly....But... using the Streaming data How to tell if the last trade was a Buy or Sell #237

Open
gmcodestuff opened this issue Jan 21, 2022 · 1 comment

Comments

@gmcodestuff
Copy link

Hi all...please forgive me with this question - I am pretty sure its me missing something obvious....

I am consuming the streaming data
I get the Bid_Price, Ask_price,Last_Price, Last_Size data (amongst others)

To determine if that last order placed was a Buy or Sell I am taking the value of Last_Price and if its closer to the Ask_Price than the Bid_Price I am thinking the last trade was a buy.
If the last_price is closer to the Bid_Price I am thinking the last trade was a sell.

Am I making a bad assumption? is there a better way to consume the streaming data and determine Buy/Sell ??

Thanks

@dougbrowning
Copy link

Similar question. How can I tell how much of the volume is buy vs sell?

For options the entire chain is this. I see nothing in here that will get it for me. But it is done in TOS all the time. For now comparing call volume vs put but its not as good.

{'SPY': {'52WkHigh': 479.98,
'52WkLow': 371.88,
'askId': 'P',
'askPrice': 448.89,
'askSize': 100,
'assetMainType': 'EQUITY',
'assetSubType': 'ETF',
'assetType': 'ETF',
'bidId': 'K',
'bidPrice': 448.87,
'bidSize': 300,
'bidTick': ' ',
'closePrice': 446.6,
'cusip': '7',
'delayed': False,
'description': 'SPDR S&P 500',
'digits': 2,
'divAmount': 5.7182,
'divDate': '2021-12-17 00:00:00.000',
'divYield': 1.28,
'exchange': 'p',
'exchangeName': 'PACIFIC',
'highPrice': 452.78,
'lastId': 'D',
'lastPrice': 448.9,
'lastSize': 200,
'lowPrice': 443.83,
'marginable': True,
'mark': 448.89,
'markChangeInDouble': 2.29,
'markPercentChangeInDouble': 0.5128,
'nAV': 0.0,
'netChange': 2.3,
'netPercentChangeInDouble': 0.515,
'openPrice': 446.35,
'peRatio': 0.0,
'quoteTimeInLong': 1644008393904,
'realtimeEntitled': True,
'regularMarketLastPrice': 448.9,
'regularMarketLastSize': 2,
'regularMarketNetChange': 2.3,
'regularMarketPercentChangeInDouble': 0.515,
'regularMarketTradeTimeInLong': 1644008393889,
'securityStatus': 'Normal',
'shortable': True,
'symbol': 'SPY',
'totalVolume': 102892377,
'tradeTimeInLong': 1644008393889,
'volatility': 0.0077}}
image

thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants