What I want to do
To know whether a trade is buyer initiated or seller initiated
What I have done
I check the Real-time Stock Data - doc and find that there is no such field in trade schema:
| Attribute | Type | Notes |
|---|---|---|
T |
string | message type, always “t” |
S |
string | symbol |
i |
int | trade ID |
x |
string | exchange code where the trade occurred |
p |
number | trade price |
s |
int | trade size |
c |
array<string> |
trade condition |
t |
string | RFC-3339 formatted timestamp with nanosecond precision |
z |
string | tape |
I also check the condition flags through api v2/stocks/meta/conditions/trade, but those seem to be irrelevant.
My question
- Can I get the trade direction? Is that possible with SIP WebSocket feed?
- If I compare trade price with ask0 and bid0 to determine whether it’s buyer initiated, is this method accurate? how do I deal with trade correction and cancels? (and also timetamps?)