Navigation

    SmartAPI Forum
    • Register
    • Login
    • Search
    • Categories
    • Popular
    • Groups
    • FAQs
    • API Docs
    1. Home
    2. Nitin_06
    3. Topics
    N
    • Profile
    • Following
    • Followers
    • Topics
    • Posts
    • Best
    • Groups

    Topics created by Nitin_06

    • N

      Not receiving LTP data
      General Discussion • • Nitin_06  

      2
      0
      Votes
      2
      Posts
      11
      Views

      M

      Hi @Nitin_06, Apologies for the delayed response. Please try using the below code in market hours and let us know if you face the same issue. from SmartApi.smartWebSocketV2 import SmartWebSocketV2 from logzero import logger AUTH_TOKEN = "auth_token" API_KEY = "api_key_here" CLIENT_CODE = "client_code" FEED_TOKEN = "feed_token" correlation_id = "abc123"// any string value action = 1 mode = 3 token_list = [ { "exchangeType": 1, "tokens": ["26009"] } ] #retry_strategy=0 for simple retry mechanism sws = SmartWebSocketV2(AUTH_TOKEN, API_KEY, CLIENT_CODE, FEED_TOKEN) #retry_strategy=1 for exponential retry mechanism # sws = SmartWebSocketV2(AUTH_TOKEN, API_KEY, CLIENT_CODE, FEED_TOKEN,max_retry_attempt=3, retry_strategy=1, retry_delay=10,retry_multiplier=2, retry_duration=30) def on_data(wsapp, message): logger.info("Ticks: {}".format(message)) # close_connection() def on_control_message(wsapp, message): logger.info(f"Control Message: {message}") def on_open(wsapp): logger.info("on open") some_error_condition = False if some_error_condition: error_message = "Simulated error" if hasattr(wsapp, 'on_error'): wsapp.on_error("Custom Error Type", error_message) else: sws.subscribe(correlation_id, mode, token_list) # sws.unsubscribe(correlation_id, mode, token_list1) def on_error(wsapp, error): logger.error(error) def on_close(wsapp): logger.info("Close") def close_connection(): sws.close_connection() # Assign the callbacks. sws.on_open = on_open sws.on_data = on_data sws.on_error = on_error sws.on_close = on_close sws.on_control_message = on_control_message sws.connect() Please write to us at smartapi@angelbroking.com if you still face the issue. Thank you. Regards SmartAPI Team
    • N

      Unable to fetch the ticks
      Bugs • • Nitin_06  

      2
      0
      Votes
      2
      Posts
      11
      Views

      M

      Hi @Nitin_06 Apologies for delayed response. Websocket streaming is working fine from our end. Please reverify and let us know if the issue still occurs. Thanks & Regards, SmartAPI team