Help deriving Buy/Sell side from WebSocket data
Hi Team,
I'm new to TrueData, transitioning from traditional broker platforms (such as Kite, which I’ve used with a ₹2000 monthly subscription). I’m really impressed with the reliability and consistency of your truedata_ws WebSocket feed — great work!
I primarily work on Orderflow-based algo trading strategies, and I often compare data with visualizations from platforms like Gocharting. I’ve found that your WebSocket data aligns well with what I see on those platforms — which is fantastic.
However, I’m trying to derive a few more fields and need your guidance.
From the TrueData WebSocket feed, I receive data in the following format (sample):
{
"timestamp": "2025-07-28T20:07:38",
"symbol_id": 950000072,
"symbol": "CRUDEOIL-I",
"ltp": 5787.0,
"ltq": 3.0,
"atp": 5750.2,
"ttq": 13211.0,
"day_open": 5671.0,
"day_high": 5819.0,
"day_low": 5657.0,
"prev_day_close": 5648.0,
"oi": 10546,
"prev_day_oi": 11510,
"turnover": 7596596000.0,
"special_tag": "",
"tick_seq": 3452,
"best_bid_price": 5785.0,
"best_bid_qty": 11,
"best_ask_price": 5787.0,
"best_ask_qty": 5,
"tick_type": 1
}
The issue I'm facing is — I’m trying to determine whether each tick (specifically using tick_seq) represents a Buy trade or Sell trade. In other words, I’d like to derive something like:
- Trade Side: Buy / Sell
- Buy Volume / Sell Volume
- Buy Trade Count / Sell Trade Count
Currently, I don’t see a side field or anything similar in the response. Is there any way to infer the trade direction from the data fields provided? Or do you provide any additional field that could help with this?
I’ve also attached a screenshot for reference (from the Gocharting view I’m trying to replicate).
Would appreciate any documentation, logic, or guidance you can share on how to calculate or interpret trade direction using your WebSocket data.
Thanks in advance!
Best regards,
Shashi
Replies have been locked on this page!