Idirect-Tech / Breeze-Python-SDK

The official Python client library for the ICICI Securities trading APIs
MIT License
63 stars 30 forks source link

WebSocket Connection, not getting Market Depth #133

Closed vineetvermait closed 1 month ago

vineetvermait commented 2 months ago

When market depth set to True, I am still getting the same values in case of FnO, I am still getting the same values in the ticks and no difference

Code:

client.subscribe_feeds(
        exchange_code=req.exchange_code, #NFO
        stock_code=req.stock_code, #NIFTY
        interval=req.interval, # 1second
        product_type=req.product_type, #options
        expiry_date=req.expiry_date, #14-08-2024
        strike_price=str(req.strike_price), #24000
        right=req.right, # Call
        get_exchange_quotes=True,
        get_market_depth=True #<---
    )

How to get market depth for Options

Idirect-Tech commented 2 months ago

Dear Vineet,

Could you please share the correct expiry date for which you want market depth data through websocket as the expiry date you are passing is invalid expiry date?

Note : At a time you can keep get_exchange_quotes as true or getmarketdepth as true. As you want market depth data, so keep get_exchange_quotes as True and get_exchange_quotes as False.

[E29CF836]

Thanks & Regards,

Hiten Solanki,

Team Breeze API,

ICICI Securities


From: Vineet Verma @.> Sent: Thursday, August 29, 2024 11:50 AM To: Idirect-Tech/Breeze-Python-SDK @.> Cc: Subscribed @.***> Subject: [Idirect-Tech/Breeze-Python-SDK] WebSocket Connection, not getting Market Depth (Issue #133)

CAUTION: This email originated from outside the organization! Do not click links, open attachments or reply, unless you recognize the sender's email address! Use 'Report suspicious Email' button in the toolbar to report Phishing mails. Beware!

When market depth set to True, I am still getting the same values in case of FnO, I am still getting the same values in the ticks and no difference

Code:

client.subscribe_feeds( exchange_code=req.exchange_code, #NFO stock_code=req.stock_code, #NIFTY interval=req.interval, # 1second product_type=req.product_type, #options expiry_date=req.expiry_date, #14-08-2024 strike_price=str(req.strike_price), #24000 right=req.right, # Call get_exchange_quotes=True, get_market_depth=True #<--- )

How to get market depth for Options

— Reply to this email directly, view it on GitHubhttps://github.com/Idirect-Tech/Breeze-Python-SDK/issues/133, or unsubscribehttps://github.com/notifications/unsubscribe-auth/A3TQZ45UGYLKMD4AKR4QTUDZT24T5AVCNFSM6AAAAABNJWFBMCVHI2DSMVQWIX3LMV43ASLTON2WKOZSGQ4TGNJUHE2TSOI. You are receiving this because you are subscribed to this thread.Message ID: @.***>

Print this mail only if absolutely necessary. Save Paper. Save Trees." "The information contained in this e-mail and any attachments to this message are intended for the exclusive use of the intended recipient and may contain proprietary, confidential or legally privileged information. If you are not the intended recipient, please note that you are not authorised to disseminate, distribute or copy this e-mail or any parts of it or act upon/rely on the contents of this e-mail in any manner. Please notify the sender immediately by e-mail and destroy all copies of this e-mail and any attachments. Please also note that ICICI Bank or its subsidiaries and associated companies, (collectively "ICICI Group"), are unable to exercise control or ensure the integrity of/over the contents of the information contained in e-mail transmissions and that any views expressed in this e-mail are not endorsed by/binding on the ICICI Group unless the sender does so expressly with due authority of ICICI Group. Before opening any attachments please check them for viruses and defects and please note that ICICI Group accepts no liability or responsibility for any damage caused by any virus that may be transmitted by this email. Any unauthorized use of this email or any attachment(s) may be treated as infringement of right(s) including right of privacy under the applicable laws of India including Information and Technology Act, 2000. Thank you for your cooperation. Regulatory Disclosures are available on https://www.icicisecurities.com (for institutional business) and www.icicidirect.com (for retail business).

vermavineet-google commented 2 months ago

There seems to be an issue here

when i use get_exchange_quotes False, and Market Depth True, I am getting no response at all in socket connection

configuration for ws_connect:

{'exchange_code': 'NFO', 'stock_code': 'CNXBAN', 'strike_price': '51400', 'right': 'Call', 'expiry': '20240904', 'interval': '1second', 'product_type': 'options', 'get_exchange_quotes': False, 'get_market_depth': True}
Idirect-Tech commented 2 months ago

Dear Vineet,

Thank you for showing interest in Breeze API.

When you are subscribing to WebSocket for fetching market depth you cannot use interval. Please find below sample code to get Market depth :

breeze.ws_connect()

def on_ticks(ticks): print("Ticks: {}".format(ticks))

breeze.on_ticks = on_ticks breeze.subscribe_feeds(get_order_notification=True)

breeze.subscribe_feeds(exchange_code="NFO", stock_code="CNXBAN", product_type="options", expiry_date="04-Sep-2024", strike_price="51400", right="call", get_market_depth = "True", get_exchange_quotes = "False")

Please find attached screenshot for your reference.

[E29CF836] Thanks & Regards, Akash Sapkal, Team Breeze API, ICICI Securities


From: vermavineet-google @.> Sent: 04 September 2024 13:17 To: Idirect-Tech/Breeze-Python-SDK @.> Cc: BREEZEAPI @.>; Comment @.> Subject: Re: [Idirect-Tech/Breeze-Python-SDK] WebSocket Connection, not getting Market Depth (Issue #133)

CAUTION: This email originated from outside the organization! Do not click links, open attachments or reply, unless you recognize the sender's email address! Use 'Report suspicious Email' button in the toolbar to report Phishing mails. Beware!

There seems to be an issue here

when i use get_exchange_quotes False, and Market Depth True, I am getting no response at all in socket connection

configuration for we_connect:

{'exchange_code': 'NFO', 'stock_code': 'CNXBAN', 'strike_price': '51400', 'right': 'Call', 'expiry': '20240904', 'interval': '1second', 'product_type': 'options', 'get_exchange_quotes': False, 'get_market_depth': True}

— Reply to this email directly, view it on GitHubhttps://github.com/Idirect-Tech/Breeze-Python-SDK/issues/133#issuecomment-2328154541, or unsubscribehttps://github.com/notifications/unsubscribe-auth/A3TQZ4ZMMCPPNTQNDZMVNWLZU23K7AVCNFSM6AAAAABNJWFBMCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGMRYGE2TINJUGE. You are receiving this because you commented.Message ID: @.***>

Print this mail only if absolutely necessary. Save Paper. Save Trees." "The information contained in this e-mail and any attachments to this message are intended for the exclusive use of the intended recipient and may contain proprietary, confidential or legally privileged information. If you are not the intended recipient, please note that you are not authorised to disseminate, distribute or copy this e-mail or any parts of it or act upon/rely on the contents of this e-mail in any manner. Please notify the sender immediately by e-mail and destroy all copies of this e-mail and any attachments. Please also note that ICICI Bank or its subsidiaries and associated companies, (collectively "ICICI Group"), are unable to exercise control or ensure the integrity of/over the contents of the information contained in e-mail transmissions and that any views expressed in this e-mail are not endorsed by/binding on the ICICI Group unless the sender does so expressly with due authority of ICICI Group. Before opening any attachments please check them for viruses and defects and please note that ICICI Group accepts no liability or responsibility for any damage caused by any virus that may be transmitted by this email. Any unauthorized use of this email or any attachment(s) may be treated as infringement of right(s) including right of privacy under the applicable laws of India including Information and Technology Act, 2000. Thank you for your cooperation. Regulatory Disclosures are available on https://www.icicisecurities.com (for institutional business) and www.icicidirect.com (for retail business).

vermavineet-google commented 2 months ago

Thanks

ISSUE: Time value in market depth is not IST, it is UTC time. kindly fix

'time': 'Wed Sep 4 09:55:35 2024',