Navigation

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

    Karthikeyan

    @Karthikeyan

    3
    Reputation
    5
    Posts
    11
    Profile views
    1
    Followers
    0
    Following
    Joined Last Online

    Karthikeyan Follow

    Best posts made by Karthikeyan

    • failed to get the cash details

      Hi Team,

      I'm trying to get the cash details, but seeing error. Upto yesterday It was working fine

      Method used
      conn_obj_temp.rmsLimit()

      HTTPSConnectionPool(host='apiconnect.angelbroking.com', port=443): Read timed out. (read timeout=7)

      posted in Python SDK
      K
      Karthikeyan
    • RE: Websocket 2.0

      @admin Hi @admin

      I have updated the code like below to convert the bytes to string and I can see the response.

      def _parse_binary_data(self, binary_data):
          try:
              parsed_data = {
                  "subscription_mode": self._unpack_data(binary_data, 0, 1, byte_format="B")[0],
                  "exchange_type": self._unpack_data(binary_data, 1, 2, byte_format="B")[0],
                  # "token": SmartWebSocketV2._parse_token_value(binary_data[2:27]),
                  "token": binary_data[2:27].decode("utf-8").replace("\x00",""),
                  "sequence_number": self._unpack_data(binary_data, 27, 35, byte_format="q")[0],
                  "exchange_timestamp": self._unpack_data(binary_data, 35, 43, byte_format="q")[0],
                  "last_traded_price": self._unpack_data(binary_data, 43, 51, byte_format="q")[0]
              }
      

      Got connected to server...
      on open
      Ticks: {'subscription_mode': 3, 'exchange_type': 1, 'token': '26009', 'sequence_number': 6346734, 'exchange_timestamp': 1668667371000, 'last_traded_price': 4245320, 'subscription_mode_val': 'SNAP_QUOTE', 'last_traded_quantity': 0, 'average_traded_price': 0, 'volume_trade_for_the_day': 0, 'total_buy_quantity': 0.0, 'total_sell_quantity': 0.0, 'open_price_of_the_day': 0, 'high_price_of_the_day': 0, 'low_price_of_the_day': 0, 'closed_price': 4253530, 'last_traded_timestamp': 0, 'open_interest': 31252900, 'open_interest_change_percentage': 4626580563041346420, 'upper_circuit_limit': 0, 'lower_circuit_limit': 0, '52_week_high_price': 0, '52_week_low_price': 0, 'best_5_buy_data': [{'flag': 0, 'quantity': 0, 'price': 0, 'no of orders': 0}, {'flag': 0, 'quantity': 0, 'price': 0, 'no of orders': 0}, {'flag': 0, 'quantity': 0, 'price': 0, 'no of orders': 0}, {'flag': 0, 'quantity': 0, 'price': 0, 'no of orders': 0}, {'flag': 0, 'quantity': 0, 'price': 0, 'no of orders': 0}], 'best_5_sell_data': [{'flag': 1, 'quantity': 0, 'price': 0, 'no of orders': 0}, {'flag': 1, 'quantity': 0, 'price': 0, 'no of orders': 0}, {'flag': 1, 'quantity': 0, 'price': 0, 'no of orders': 0}, {'flag': 1, 'quantity': 0, 'price': 0, 'no of orders': 0}, {'flag': 1, 'quantity': 0, 'price': 0, 'no of orders': 0}]}
      Ticks: {'subscription_mode': 3, 'exchange_type': 1, 'token': '26009', 'sequence_number': 6347286, 'exchange_timestamp': 1668667372000, 'last_traded_price': 4245150, 'subscription_mode_val': 'SNAP_QUOTE', 'last_traded_quantity': 0, 'average_traded_price': 0, 'volume_trade_for_the_day': 0, 'total_buy_quantity': 0.0, 'total_sell_quantity': 0.0, 'open_price_of_the_day': 0, 'high_price_of_the_day': 0, 'low_price_of_the_day': 0, 'closed_price': 4253530, 'last_traded_timestamp': 0, 'open_interest': 31252900, 'open_interest_change_percentage': 4626580563041346420, 'upper_circuit_limit': 0, 'lower_circuit_limit': 0, '52_week_high_price': 0, '52_week_low_price': 0, 'best_5_buy_data': [{'flag': 0, 'quantity': 0, 'price': 0, 'no of orders': 0}, {'flag': 0, 'quantity': 0, 'price': 0, 'no of orders': 0}, {'flag': 0, 'quantity': 0, 'price': 0, 'no of orders': 0}, {'flag': 0, 'quantity': 0, 'price': 0, 'no of orders': 0}, {'flag': 0, 'quantity': 0, 'price': 0, 'no of orders': 0}], 'best_5_sell_data': [{'flag': 1, 'quantity': 0, 'price': 0, 'no of orders': 0}, {'flag': 1, 'quantity': 0, 'price': 0, 'no of orders': 0}, {'flag': 1, 'quantity': 0, 'price': 0, 'no of orders': 0}, {'flag': 1, 'quantity': 0, 'price': 0, 'no of orders': 0}, {'flag': 1, 'quantity': 0, 'price': 0, 'no of orders': 0}]}

      posted in Python SDK
      K
      Karthikeyan
    • Instrument link is not working

      Instrument link is not working!

      https://margincalculator.angelbroking.com/OpenAPI_File/files/OpenAPIScripMaster.json

      49d21fdb-e622-4bdc-9aed-77885a60cfdf-image.png

      90b16632-cbf5-4cb1-8874-5a7e1c2a779a-image.png

      posted in Bugs
      K
      Karthikeyan

    Latest posts made by Karthikeyan

    • Instrument link is not working

      Instrument link is not working!

      https://margincalculator.angelbroking.com/OpenAPI_File/files/OpenAPIScripMaster.json

      49d21fdb-e622-4bdc-9aed-77885a60cfdf-image.png

      90b16632-cbf5-4cb1-8874-5a7e1c2a779a-image.png

      posted in Bugs
      K
      Karthikeyan
    • RE: Websocket 2.0

      @admin Hi @admin

      I have updated the code like below to convert the bytes to string and I can see the response.

      def _parse_binary_data(self, binary_data):
          try:
              parsed_data = {
                  "subscription_mode": self._unpack_data(binary_data, 0, 1, byte_format="B")[0],
                  "exchange_type": self._unpack_data(binary_data, 1, 2, byte_format="B")[0],
                  # "token": SmartWebSocketV2._parse_token_value(binary_data[2:27]),
                  "token": binary_data[2:27].decode("utf-8").replace("\x00",""),
                  "sequence_number": self._unpack_data(binary_data, 27, 35, byte_format="q")[0],
                  "exchange_timestamp": self._unpack_data(binary_data, 35, 43, byte_format="q")[0],
                  "last_traded_price": self._unpack_data(binary_data, 43, 51, byte_format="q")[0]
              }
      

      Got connected to server...
      on open
      Ticks: {'subscription_mode': 3, 'exchange_type': 1, 'token': '26009', 'sequence_number': 6346734, 'exchange_timestamp': 1668667371000, 'last_traded_price': 4245320, 'subscription_mode_val': 'SNAP_QUOTE', 'last_traded_quantity': 0, 'average_traded_price': 0, 'volume_trade_for_the_day': 0, 'total_buy_quantity': 0.0, 'total_sell_quantity': 0.0, 'open_price_of_the_day': 0, 'high_price_of_the_day': 0, 'low_price_of_the_day': 0, 'closed_price': 4253530, 'last_traded_timestamp': 0, 'open_interest': 31252900, 'open_interest_change_percentage': 4626580563041346420, 'upper_circuit_limit': 0, 'lower_circuit_limit': 0, '52_week_high_price': 0, '52_week_low_price': 0, 'best_5_buy_data': [{'flag': 0, 'quantity': 0, 'price': 0, 'no of orders': 0}, {'flag': 0, 'quantity': 0, 'price': 0, 'no of orders': 0}, {'flag': 0, 'quantity': 0, 'price': 0, 'no of orders': 0}, {'flag': 0, 'quantity': 0, 'price': 0, 'no of orders': 0}, {'flag': 0, 'quantity': 0, 'price': 0, 'no of orders': 0}], 'best_5_sell_data': [{'flag': 1, 'quantity': 0, 'price': 0, 'no of orders': 0}, {'flag': 1, 'quantity': 0, 'price': 0, 'no of orders': 0}, {'flag': 1, 'quantity': 0, 'price': 0, 'no of orders': 0}, {'flag': 1, 'quantity': 0, 'price': 0, 'no of orders': 0}, {'flag': 1, 'quantity': 0, 'price': 0, 'no of orders': 0}]}
      Ticks: {'subscription_mode': 3, 'exchange_type': 1, 'token': '26009', 'sequence_number': 6347286, 'exchange_timestamp': 1668667372000, 'last_traded_price': 4245150, 'subscription_mode_val': 'SNAP_QUOTE', 'last_traded_quantity': 0, 'average_traded_price': 0, 'volume_trade_for_the_day': 0, 'total_buy_quantity': 0.0, 'total_sell_quantity': 0.0, 'open_price_of_the_day': 0, 'high_price_of_the_day': 0, 'low_price_of_the_day': 0, 'closed_price': 4253530, 'last_traded_timestamp': 0, 'open_interest': 31252900, 'open_interest_change_percentage': 4626580563041346420, 'upper_circuit_limit': 0, 'lower_circuit_limit': 0, '52_week_high_price': 0, '52_week_low_price': 0, 'best_5_buy_data': [{'flag': 0, 'quantity': 0, 'price': 0, 'no of orders': 0}, {'flag': 0, 'quantity': 0, 'price': 0, 'no of orders': 0}, {'flag': 0, 'quantity': 0, 'price': 0, 'no of orders': 0}, {'flag': 0, 'quantity': 0, 'price': 0, 'no of orders': 0}, {'flag': 0, 'quantity': 0, 'price': 0, 'no of orders': 0}], 'best_5_sell_data': [{'flag': 1, 'quantity': 0, 'price': 0, 'no of orders': 0}, {'flag': 1, 'quantity': 0, 'price': 0, 'no of orders': 0}, {'flag': 1, 'quantity': 0, 'price': 0, 'no of orders': 0}, {'flag': 1, 'quantity': 0, 'price': 0, 'no of orders': 0}, {'flag': 1, 'quantity': 0, 'price': 0, 'no of orders': 0}]}

      posted in Python SDK
      K
      Karthikeyan
    • RE: Ticker not working

      @admin Hi, I'm using python SDK. does it has the method to handle the socket v2?

      posted in General Discussion
      K
      Karthikeyan
    • failed to get the cash details

      Hi Team,

      I'm trying to get the cash details, but seeing error. Upto yesterday It was working fine

      Method used
      conn_obj_temp.rmsLimit()

      HTTPSConnectionPool(host='apiconnect.angelbroking.com', port=443): Read timed out. (read timeout=7)

      posted in Python SDK
      K
      Karthikeyan
    • websocket failed to connect, seeing errors

      I tried to connect the websocket, but seeing errors

      (Pdb) >? ss.connect()
      Error info: [WinError 10060] A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond
      socker error [WinError 10060] A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond
      Error info: SmartWebSocket.__on_close() takes 2 positional arguments but 4 were given
      socker error SmartWebSocket.__on_close() takes 2 positional arguments but 4 were given

      (Pdb) >? ss.connect()
      __on_open################
      on open
      subscribing - nse_cm|26000&nse_cm|26009
      Ticks: [{'ak': 'nk', 'msg': 'cn', 'task': 'cn'}]
      2022-11-15 13:05:54.326055 : Start task in the background
      Ticks: [{'ak': 'nk', 'msg': 'mw', 'task': 'mw'}]
      Ticks: [{'ak': 'nk', 'msg': 'hb', 'task': 'hb'}]

      posted in Python SDK
      K
      Karthikeyan