Navigation

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

    Posts made by whemant

    • RE: Announcing Top Gainers/ Losers, PCR and OI BuildUp APIs for SmartAPI Users

      Am I the only one encountering this error? Why am I experiencing this issue only with 'PercPriceGainers' and not with 'PercPriceLosers'?

      This has been happening since yesterday; it was working perfectly fine before that.

      @Moderator_1 @Moderator_2 @Moderator_3, @Moderator_4 , could you please respond to this?

      [E 250128 10:19:46 smartConnect:242] Error occurred while making a POST request to https://apiconnect.angelbroking.com/rest/secure/angelbroking/marketData/v1/gainersLosers. Error: Something Went Wrong, Please Try After Sometime. URL: https://apiconnect.angelbroking.com/rest/secure/angelbroking/marketData/v1/gainersLosers, Headers: {'Content-type': 'application/json', 'X-ClientLocalIP': '127.0.0.1', 'X-ClientPublicIP': '106.193.147.98', 'X-MACAddress': '87:9e:2a:03:ef:88', 'Accept': 'application/json', 'X-PrivateKey': 'hidden', 'X-UserType': 'USER', 'X-SourceID': 'WEB'}, Request: {'datatype': 'PercPriceGainers', 'expirytype': 'NEAR'}, Response: {'message': 'Something Went Wrong, Please Try After Sometime', 'errorcode': 'AB1004', 'status': False, 'data': None}

      posted in General Discussion
      W
      whemant
    • RE: Announcing Top Gainers/ Losers, PCR and OI BuildUp APIs for SmartAPI Users

      hello @Moderator_1

      I am getting an error AB1004 when the datatype = PercPriceGainers. Other datatypes PercOIGainers, PercOILosers, PercPriceLosers all working fine

      login_obj = user_details['obj']

      params = {
      "datatype": "PercPriceGainers",
      "expirytype": "NEAR"
      }

      print(login_obj.gainersLosers(params))

      {'message': 'Something Went Wrong, Please Try After Sometime', 'errorcode': 'AB1004', 'status': False, 'data': None}

      This was working fine till yesterday.

      posted in General Discussion
      W
      whemant
    • RE: Internal Server error for all requests

      I am also getting similar error but not for all requests.
      for example:

      gainersLosers for PercOILosers and PercPriceLosers is working fine.

      But gainersLosers for PercOIGainers and PercPriceGainers is giving the error

      params = {
      "datatype": "PercOIGainers",
      "expirytype": "NEAR"
      }

      print(login_obj.gainersLosers(params))

      {'message': 'Something Went Wrong, Please Try After Sometime', 'errorcode': 'AB1004', 'status': False, 'data': None}

      login_obj = user_details['obj']

      params = {
      "datatype": "PercPriceGainers",
      "expirytype": "NEAR"
      }

      {'message': 'Something Went Wrong, Please Try After Sometime', 'errorcode': 'AB1004', 'status': False, 'data': None}

      posted in Bugs
      W
      whemant
    • Stop Loss Gap Requirement for ROBO Orders

      Hello,

      I am reaching out to understand the requirement for a significant gap between the order limit price and the stop-loss price for ROBO orders.

      Here are the parameters I used while placing a SELL ROBO order for NTPC:

      Variety: "ROBO"
      Tradingsymbol: "NTPC-EQ"
      Symboltoken: "11630"
      Transaction Type: "SELL"
      Exchange: "NSE"
      Order Type: "LIMIT"
      Product Type: "BO"
      Duration: "DAY"
      Price (Limit Price): "334.90"
      Squareoff: "8"
      Stoploss: "3"
      Quantity: "6"
      The order failed with the message:
      "The gap between stop loss and limit price should be wider."

      However, when I increased the Stoploss to 4 or 5, the order got executed. I believe a gap of 3 (~0.9%) is already sufficient, and requiring a higher gap seems unnecessary.

      Could you please clarify why this high gap is required for placing ROBO orders?

      Looking forward to your response.

      posted in General Discussion
      W
      whemant
    • RE: Attempting to resubscribe/reconnect

      @0xc0de Yes, I managed to fix it. There was a small error in my code. Strangely the previous version of smartapi-python did not have any issues with this error, but the new version did. As soon as I installed the new version, the problem started appearing.

      It is easy to check if your code also has some existing issues. In the smartWebSocketV2, in the _on_error function, print the error message, and it will show what is wrong with your code:

      def _on_error(self, wsapp, error):
      print(f'error: {error}')

      posted in Python SDK
      W
      whemant
    • Attempting to resubscribe/reconnect

      Hello,

      I have been using WebSocket in my Python code for a while. Today, I had to reinstall smartapi-python and websocket-client because my virtual environment's library got deleted by mistake. I didn't make any changes to my Python code. After reinstalling these libraries, I started encountering the error message 'Attempting to resubscribe/reconnect'. The code was working fine until yesterday.

      Why is this error appearing now?

      I am using Python 3.10.7.

      posted in Python SDK
      W
      whemant
    • RE: Websocket to fetch options data

      @Moderator_1
      It worked thanks.

      posted in Python SDK
      W
      whemant
    • Websocket to fetch options data

      Hello,

      I am using Websocket to fetch live data for stocks. I have a requirrement to fetch index options data. Please can somebody confirm what value I need to pass to exchangeType? I tried using various values as mentioned in the code:

                      exchangeType: integer
                      possible values ->
                          1 -> nse_cm
                          2 -> nse_fo
                          3 -> bse_cm
                          4 -> bse_fo
                          5 -> mcx_fo
                          7 -> ncx_fo
                          13 -> cde_fo
      

      But none of these are producing the results.

      Is there any other change I need to do to get index option data?

      Thanks in advance

      posted in Python SDK
      W
      whemant
    • Historic API not working

      I know that the rate limit of historic API is 3 requests per second. However today I am getting error b'Access denied because of exceeding access rate' randomly. sometime just after 1st request, sometimes after 2nd request.
      @admin @admin123 is there any problem with the API today? Please confirm.

      posted in Bugs
      W
      whemant
    • RE: User Feedback - WebSocket 2.0 Beta Rollout – Python Language

      Hi @asho and @vrkhyd if anyone of you can provide any help on this? Thanks.

      posted in Python SDK
      W
      whemant
    • RE: User Feedback - WebSocket 2.0 Beta Rollout – Python Language

      Hi @vrkhyd,

      I am getting data in below format:

      {'subscription_mode': 3, 'exchange_type': 5, 'token': '246083', 'sequence_number': 2414112, 'exchange_timestamp': 1674818721000, 'last_traded_price': 672400, 'subscription_mode_val': 'SNAP_QUOTE', 'last_traded_quantity': 1, 'average_traded_price': 667360, 'volume_trade_for_the_day': 8589, 'total_buy_quantity': 644.0, 'total_sell_quantity': 384.0, 'open_price_of_the_day': 661700, 'high_price_of_the_day': 672700, 'low_price_of_the_day': 661700, 'closed_price': 653300, 'last_traded_timestamp': 1674818717, 'open_interest': 535600, 'open_interest_change_percentage': -4627489742054556454, 'upper_circuit_limit': 679400, 'lower_circuit_limit': 627200, '52_week_high_price': 678100, '52_week_low_price': 599400, 'best_5_buy_data': [{'flag': 0, 'quantity': 7, 'price': 672600, 'no of orders': 6}, {'flag': 0, 'quantity': 14, 'price': 672700, 'no of orders': 12}, {'flag': 0, 'quantity': 10, 'price': 672800, 'no of orders': 10}, {'flag': 0, 'quantity': 7, 'price': 672900, 'no of orders': 6}, {'flag': 0, 'quantity': 29, 'price': 673000, 'no of orders': 21}], 'best_5_sell_data': [{'flag': 1, 'quantity': 35, 'price': 672400, 'no of orders': 11}, {'flag': 1, 'quantity': 23, 'price': 672300, 'no of orders': 3}, {'flag': 1, 'quantity': 1, 'price': 672200, 'no of orders': 1}, {'flag': 1, 'quantity': 2, 'price': 672100, 'no of orders': 2}, {'flag': 1, 'quantity': 12, 'price': 672000, 'no of orders': 4}]}

      Please could explain how you are converting this data in to get 1 min candlestick data? If you could share your code that will be of great help. Thanks.

      posted in Python SDK
      W
      whemant
    • FINNIFTY token not available

      @admin FINNIFTY index token not available in https://margincalculator.angelbroking.com/OpenAPI_File/files/OpenAPIScripMaster.json

      when this will be available?

      posted in Bugs
      W
      whemant
    • RE: FINNIFTY TOKEN NOT PRESENT

      @admin any updates on this? When this will be available?

      posted in General Discussion
      W
      whemant
    • RE: Automate totp login using python module - pyotp

      @SSumit That great. Thanks for this.
      I am getting another error

      TypeError: SmartConnect.generateSession() takes 3 positional arguments but 4 were given

      Any idea how to fix this?

      posted in General Discussion
      W
      whemant
    • RE: Invalid TOTP

      @ganeshpanpat I am also getting this error. @admin kindly assist.

      posted in General Discussion
      W
      whemant
    • RE: invalid token error python

      @divy1520 I managed to fix this error. My code was not able to generate the feedToken. Check if your code is generating the feedtoken correctly.

      obj = SmartConnect(api_key="API_KEY")
      data = obj.generateSession("CLIENT_ID","PASSWORD")
      feedToken = obj.getfeedToken()

      This is how you generate a feedtoken.

      do a print(feedToken), if it is None, check values in the data - print(data).

      For me, it was showing a message that my password was expired. I changed my password in trading portal and the code worked fine. I got to know that the password has a validity of one year. Trading portal does not show this error, but API does.

      posted in Python SDK
      W
      whemant
    • RE: invalid token error python

      @divy1520 Sorry, I think this error is not related to symbol token. I am not aware of this error. @admin please could you help us with error asap. Thanks. My user id is "H118070".

      posted in Python SDK
      W
      whemant
    • RE: invalid token error python

      @divy1520 you can check symbol tokens in https://margincalculator.angelbroking.com/OpenAPI_File/files/OpenAPIScripMaster.json

      posted in Python SDK
      W
      whemant
    • RE: Getting error code AG8001 python

      Hello @admin , any updates on this issue. I am also getting this error from last couple of days. I have checked the symbol token I am using is correct.

      posted in General Discussion
      W
      whemant
    • RE: invalid token error python

      Hello @admin , any updates on this issue. I am also getting this error from last couple of days. I have checked the symbol token I am using is correct.

      posted in Python SDK
      W
      whemant