☰
Login
Signup
Home
›
Market data (WebSockets)
Howdy, Stranger!
It looks like you're new here. If you want to get involved, click one of these buttons!
Sign In
Register
Categories
Recent Discussions
Activity
Categories
13.9K
All Categories
0
Incidents
156
Node JS client
40
Go client
793
.Net API client
380
Kite Publisher
537
.Net / VBA / Excel (3rd party)
458
Algorithms and Strategies
998
Java client
1.1K
API clients
404
PHP client
4K
Python client
347
Mobile and Desktop apps
1.4K
Market data (WebSockets)
3.3K
General
In this Discussion
January 2018
rishi
January 2018
sujith
Candle volume from market data
rishi
January 2018
in
Market data (WebSockets)
I am using websocket through python client. I want to create 1 minute candles. My doubt is how to compute volume traded in 1 minute.
One way is to sum 'last_quantity' received in the ticks. But on doing so, volume I am getting is much less than compared to zerodha charts.
Is last_quantity the right field to use? Or is there any other way?
Tagged:
Python Client
WebSocket
candle volume
sujith
January 2018
Hi
@rishi
,
You need to use Volume traded for the day field. It contains cumulative volume.
In order to get volume data, you need to find the difference between the volume of last tick and first tick of that interval.
rishi
January 2018
DEBUG:root:Ticks: [{'timestamp': datetime.datetime(2018, 1, 29, 12, 12, 24), 'last_price': 273.8, 'oi_day_low': 0, '
volume
': 9508655, 'sell_quantity': 1281348, 'last_quantity': 324, 'change': -2.2840827980014193, 'oi': 0, 'average_price': 274.18, 'ohlc': {'high': 282.8, 'close': 280.2, 'open': 282.0, 'low': 268.6}, 'tradable': True, 'depth': {'sell': [{'price': 273.75, 'orders': 65536, 'quantity': 187}, {'price': 273.8, 'orders': 131072, 'quantity': 330}, {'price': 273.85, 'orders': 262144, 'quantity': 3161}, {'price': 273.9, 'orders': 1245184, 'quantity': 8253}, {'price': 273.95, 'orders': 589824, 'quantity': 4267}], 'buy': [{'price': 273.65, 'orders': 65536, 'quantity': 106}, {'price': 273.6, 'orders': 262144, 'quantity': 596}, {'price': 273.55, 'orders': 65536, 'quantity': 100}, {'price': 273.5, 'orders': 196608, 'quantity': 95}, {'price': 273.45, 'orders': 327680, 'quantity': 3100}]}, 'mode': 'full', 'last_trade_time': datetime.datetime(2018, 1, 29, 12, 12, 23), 'buy_quantity': 868677, 'oi_day_high': 0, 'instrument_token': 1723649}]
In this you mean the 'volume' field?
sujith
January 2018
Yes, you need to use volume.
rishi
January 2018
Thanks
@sujith
This discussion has been closed.
You need to use Volume traded for the day field. It contains cumulative volume.
In order to get volume data, you need to find the difference between the volume of last tick and first tick of that interval.
In this you mean the 'volume' field?