jugaad-py/jugaad-data

Fetching DOM / Market depth data of a stock

Opened this issue · 0 comments

Issue description

I imported NSELive and used the trade_info() function within it to get the DOM data, but it seems the DOM bid & ask data is available for only 5 price levels only, which are closest to the current price level. The other price level's bid and ask quantity data are missing
.
Can someone tell me how to fetch more price levels bid & ask data ? Atleast the price levels with maximum amount of bid & ask quantity would be very much helpful..!!
.
Thanks in advance.

Example Code

from jugaad_data.nse import NSELive

n = NSELive()
trade_info = n.trade_info(eqList)
bid = trade_info['marketDeptOrderBook']['bid']
ask = trade_info['marketDeptOrderBook']['ask']

print('\nthe bids are = ')
for a in bid:
    print (f"price = {a['price']} <---> quantity = {a['quantity']}")

print('\nthe ask are = ')
for b in ask:
    print (f"price = {b['price']} <---> quantity = {b['quantity']}")

Error snippet

the bids are =
price = 1180.7 <---> quantity = 10
price = 1180.6 <---> quantity = 117
price = 1180.4 <---> quantity = 36
price = 1180.35 <---> quantity = 10
price = 1180.3 <---> quantity = 9

the ask are =
price = 1180.85 <---> quantity = 1
price = 1180.9 <---> quantity = 32
price = 1181.1 <---> quantity = 89
price = 1181.15 <---> quantity = 26
price = 1181.35 <---> quantity = 1