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

Fetching DOM / Market depth data of a stock #77

Open
pandiyan07 opened this issue May 29, 2024 · 0 comments
Open

Fetching DOM / Market depth data of a stock #77

pandiyan07 opened this issue May 29, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@pandiyan07
Copy link

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
@pandiyan07 pandiyan07 added the bug Something isn't working label May 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant