Navigation

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

    mohan1710

    @mohan1710

    5
    Reputation
    10
    Posts
    4
    Profile views
    0
    Followers
    0
    Following
    Joined Last Online

    mohan1710 Follow

    Best posts made by mohan1710

    • Streamer is not working

      When I try to stream the ticks for any stock (EQ/Bank nifty Option/Fut or Crude oil Fut) I am not getting the LTP details. I am always getting only the heartbeat details as below:

      {'task': 'hb', 'channel': '', 'token': '0876494748', 'user': 'S866252', 'acctid': 'S866252'}
      2023-03-07 20:05:27.396006 : Start task in the background
      {'task': 'hb', 'channel': '', 'token': '0876494748', 'user': 'S866252', 'acctid': 'S866252'}
      2023-03-07 20:05:57.409312 : Start task in the background
      {'task': 'hb', 'channel': '', 'token': '0876494748', 'user': 'S866252', 'acctid': 'S866252'}
      2023-03-07 20:06:27.425053 : Start task in the background
      {'task': 'hb', 'channel': '', 'token': '0876494748', 'user': 'S866252', 'acctid': 'S866252'}
      2023-03-07 20:06:57.437980 : Start task in the background
      {'task': 'hb', 'channel': '', 'token': '0876494748', 'user': 'S866252', 'acctid': 'S866252'}
      2023-03-07 20:07:27.454424 : Start task in the background
      {'task': 'hb', 'channel': '', 'token': '0876494748', 'user': 'S866252', 'acctid': 'S866252'}
      2023-03-07 20:07:57.466786 : Start task in the background
      {'task': 'hb', 'channel': '', 'token': '0876494748', 'user': 'S866252', 'acctid': 'S866252'}
      2023-03-07 20:08:27.482817 : Start task in the background
      {'task': 'hb', 'channel': '', 'token': '0876494748', 'user': 'S866252', 'acctid': 'S866252'}
      2023-03-07 20:08:57.493365 : Start task in the background
      {'task': 'hb', 'channel': '', 'token': '0876494748', 'user': 'S866252', 'acctid': 'S866252'}
      2023-03-07 20:09:27.509732 : Start task in the background
      {'task': 'hb', 'channel': '', 'token': '0876494748', 'user': 'S866252', 'acctid': 'S866252'}
      2023-03-07 20:09:57.518243 : Start task in the background
      {'task': 'hb', 'channel': '', 'token': '0876494748', 'user': 'S866252', 'acctid': 'S866252'}
      2023-03-07 20:10:27.523685 : Start task in the background
      {'task': 'hb', 'channel': '', 'token': '0876494748', 'user': 'S866252', 'acctid': 'S866252'}

      No "mw" task with LTP details are being streamed. Anyone else is facing this issue? Admin please help to resolve the issue.

      posted in Python SDK
      M
      mohan1710

    Latest posts made by mohan1710

    • RE: WebSocket 2.0 Streaming is not Receiving the Live Price Feed

      @anil_patel
      Are you able to receive the live feed using websocket 2.9?

      posted in General Discussion
      M
      mohan1710
    • RE: Is Anybody is getting Live Datafeed using Websocket 2.0?

      @admin
      2023-05-16 21:18:32.856586 : Start task in the background
      {'task': 'hb', 'channel': '', 'token': 'eyJhbGciOiJIUzUxMiJ9.eyJ1c2VybmFtZSI6IlM4NjYyNTIiLCJpYXQiOjE2ODQyNTIwNjMsImV4cCI6MTY4NDMzODQ2M30.MSgZCCtgnrD-Rci1kFVFNPYTUNqthvoPz2IUStmFrHj2Np0nOuOleWWxnzdphCSRFEZaCt4m7QDKU2tUDB1HcQ', 'user': 'S866252', 'acctid': 'S866252'}
      2023-05-16 21:19:02.872482 : Start task in the background
      {'task': 'hb', 'channel': '', 'token': 'eyJhbGciOiJIUzUxMiJ9.eyJ1c2VybmFtZSI6IlM4NjYyNTIiLCJpYXQiOjE2ODQyNTIwNjMsImV4cCI6MTY4NDMzODQ2M30.MSgZCCtgnrD-Rci1kFVFNPYTUNqthvoPz2IUStmFrHj2Np0nOuOleWWxnzdphCSRFEZaCt4m7QDKU2tUDB1HcQ', 'user': 'S866252', 'acctid': 'S866252'}

      I could only get the Heartbeat signals. No live feed for the scripts. Please help to resolve the issue

      posted in General Discussion
      M
      mohan1710
    • RE: Important Update: Change in 'feedToken' Format in Login Response

      @Mnagesh
      Are you able to get the ticks via smartAPI? I am not getting any ticks in the streamer although I used the latest package from git using pip install.

      Does not get any error but not getting the ticks for even a single script.

      Can you please help me with the code if yours is working?

      posted in General Discussion
      M
      mohan1710
    • RE: Streamer is not working

      @admin , can you update on this please

      posted in Python SDK
      M
      mohan1710
    • RE: Unable to get to tick data

      @Ramesh i am facing similar issue and no response for my post as well

      posted in Python SDK
      M
      mohan1710
    • Streamer is not working

      When I try to stream the ticks for any stock (EQ/Bank nifty Option/Fut or Crude oil Fut) I am not getting the LTP details. I am always getting only the heartbeat details as below:

      {'task': 'hb', 'channel': '', 'token': '0876494748', 'user': 'S866252', 'acctid': 'S866252'}
      2023-03-07 20:05:27.396006 : Start task in the background
      {'task': 'hb', 'channel': '', 'token': '0876494748', 'user': 'S866252', 'acctid': 'S866252'}
      2023-03-07 20:05:57.409312 : Start task in the background
      {'task': 'hb', 'channel': '', 'token': '0876494748', 'user': 'S866252', 'acctid': 'S866252'}
      2023-03-07 20:06:27.425053 : Start task in the background
      {'task': 'hb', 'channel': '', 'token': '0876494748', 'user': 'S866252', 'acctid': 'S866252'}
      2023-03-07 20:06:57.437980 : Start task in the background
      {'task': 'hb', 'channel': '', 'token': '0876494748', 'user': 'S866252', 'acctid': 'S866252'}
      2023-03-07 20:07:27.454424 : Start task in the background
      {'task': 'hb', 'channel': '', 'token': '0876494748', 'user': 'S866252', 'acctid': 'S866252'}
      2023-03-07 20:07:57.466786 : Start task in the background
      {'task': 'hb', 'channel': '', 'token': '0876494748', 'user': 'S866252', 'acctid': 'S866252'}
      2023-03-07 20:08:27.482817 : Start task in the background
      {'task': 'hb', 'channel': '', 'token': '0876494748', 'user': 'S866252', 'acctid': 'S866252'}
      2023-03-07 20:08:57.493365 : Start task in the background
      {'task': 'hb', 'channel': '', 'token': '0876494748', 'user': 'S866252', 'acctid': 'S866252'}
      2023-03-07 20:09:27.509732 : Start task in the background
      {'task': 'hb', 'channel': '', 'token': '0876494748', 'user': 'S866252', 'acctid': 'S866252'}
      2023-03-07 20:09:57.518243 : Start task in the background
      {'task': 'hb', 'channel': '', 'token': '0876494748', 'user': 'S866252', 'acctid': 'S866252'}
      2023-03-07 20:10:27.523685 : Start task in the background
      {'task': 'hb', 'channel': '', 'token': '0876494748', 'user': 'S866252', 'acctid': 'S866252'}

      No "mw" task with LTP details are being streamed. Anyone else is facing this issue? Admin please help to resolve the issue.

      posted in Python SDK
      M
      mohan1710
    • GetLTP failing with Internal Error

      payload {
      "exchange": "NFO",
      "tradingsymbol": "BANKNIFTY23FEB23FUT",
      "symboltoken": "48756"
      }
      headers {'Authorization': 'Bearer -------------------', 'Content-Type': 'application/json', 'Accept': 'application/json', 'X-UserType': 'USER', 'X-SourceID': 'WEB', 'X-ClientLocalIP': 'CLIENT_LOCAL_IP', 'X-ClientPublicIP': 'CLIENT_PUBLIC_IP', 'X-MACAddress': 'MAC_ADDRESS', 'X-PrivateKey': '----------------'}
      data_getltp>>>>>>>>>>>> b'<!doctype html><html lang="en"><head><title>HTTP Status 500 \xe2\x80\x93 Internal Server Error</title><style type="text/css">body {font-family:Tahoma,Arial,sans-serif;} h1, h2, h3, b {color:white;background-color:#525D76;} h1 {font-size:22px;} h2 {font-size:16px;} h3 {font-size:14px;} p {font-size:12px;} a {color:black;} .line {height:1px;background-color:#525D76;border:none;}</style></head><body><h1>HTTP Status 500 \xe2\x80\x93 Internal Server Error</h1></body></html>'

      Code Used:

      def get_ltp(jwt_token,api_key,symbol,token,exchg):
      conn = http.client.HTTPSConnection(
      "apiconnect.angelbroking.com")

      payload = "{\n     \"exchange\": \"" + \
                exchg + "\",\n \"tradingsymbol\": \"" + \
                symbol + "\",\n \"symboltoken\": \"" + \
                token + "\"\n}"
      headers = {
          'Authorization': jwt_token,
          'Content-Type': 'application/json',
          'Accept': 'application/json',
          'X-UserType': 'USER',
          'X-SourceID': 'WEB',
          'X-ClientLocalIP': 'CLIENT_LOCAL_IP',
          'X-ClientPublicIP': 'CLIENT_PUBLIC_IP',
          'X-MACAddress': 'MAC_ADDRESS',
          'X-PrivateKey': api_key
      }
      conn.request("POST",
                   "/order-service/rest/secure/angelbroking/order/v1/getLtpData",
                   payload,
                   headers)
      
      res = conn.getresponse()
      data = res.read()
      
      posted in General Discussion
      M
      mohan1710
    • RE: On_Error/On_Close issue

      @admin , Kindly explain how many parameters to be passed to on_close and on_error methods?

      posted in Python SDK
      M
      mohan1710
    • On_Error/On_Close issue

      I have coded on_error, on_close in the streamer as given in the sample github code. Code is given below:

      def on_error(ws, code, reason):
      logging.debug("Connection error: {code} - {reason}".format(code=code, reason=reason))

      def on_close(ws, code, reason):
      logging.debug("on close")

      In the middle of the streamer getting the error as like:
      [2021-08-31 14:42:00,457] {_logging.py:67} ERROR - error from callback <bound method SmartWebSocket.__on_error of <smartapi.smartApiWebsocket.SmartWebSocket object at 0x00000257B6F86F70>>: on_error() missing 1 required positional argument: 'reason'
      [2021-08-31 14:42:00,457] {_logging.py:67} ERROR - error from callback <bound method SmartWebSocket.__on_close of <smartapi.smartApiWebsocket.SmartWebSocket object at 0x00000257B6F86F70>>: __on_close() takes 2 positional arguments but 4 were given
      [2021-08-31 14:42:00,457] {_logging.py:67} ERROR - error from callback <bound method SmartWebSocket.__on_close of <smartapi.smartApiWebsocket.SmartWebSocket object at 0x00000257B6F86F70>>: __on_close() takes 2 positional arguments but 4 were given

      Can you please suggest the correct code to solve this issue by providing the right parameters.

      posted in Python SDK
      M
      mohan1710
    • Ticks missing in the middle of the trading day

      While we are trying to get the ticks for FNO instruments we are missing the ticks for around 19 minutes

      from time 2021-08-31 14:23:55 to 2021-08-31 14:42:00,457. It was started again after a while. In this period there are no errors as well.
      This is causing issue for back testing or go live.

      posted in Python SDK
      M
      mohan1710