Navigation

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

    webseos

    @webseos

    3
    Reputation
    53
    Posts
    32
    Profile views
    1
    Followers
    0
    Following
    Joined Last Online

    webseos Follow

    Best posts made by webseos

    • RE: Guide to secure your SmartAPI Account with two factor authentication

      @aj_Brk I have used similar code as given below , but got the following exception
      Exception : Object of type TOTP is not JSON serializable

      but then I solved the problem

      But then I added last two lines and problem solved the last two lines given at the end of the following code- qrOtp is the code generated here : https://smartapi.angelbroking.com/enable-totp below the QR Code. So you have to generate your own qrOtp code here in this site. Then Install pyotp using command line "pip install pyotp"

      My Code Below ( Last line totp = totp.now() is very important)

      from smartapi import SmartConnect #or from smartapi.smartConnect import SmartConnect
      import config
      import pyotp

      client_code = "aaaaaa"
      client_pass = "bbbbbb"

      apiKey="yyyyyyy"
      qrOtp = "xxxxxxxx"
      totp = pyotp.TOTP(qrOtp)
      totp = totp.now()

      smartapiObj =SmartConnect(apiKey)

      data = smartapiObj.generateSession(client_code,client_pass,totp)
      print(data)

      posted in General Discussion
      W
      webseos
    • RE: PHP LTP API

      @admin What is heart beat? I am confused. By the way I developed a code to get LTP: in PHP. If I can get LTP or 1 min GetCandleData why WEBSOCKET wss://....

      ** Pls Add a category in PHP, all going to general discussion

      https://smartapi.angelbroking.com/topic/1203/how-to-get-ltp-sample-source-code-in-php-added-a-getltp-function-error-handling-excluded

      posted in General Discussion
      W
      webseos

    Latest posts made by webseos

    • RE: NIFTY and BANKNIFTY symbol token are missing

      @ravitandur
      xchange = "NSE"
      symbol = "NIFTY"
      token_mumber = "26000"
      interval_candle = "ONE_DAY"

      Nifty Token and Symbol, But I could not get Nifty Historical API
      I tried.

      posted in Bugs
      W
      webseos
    • RE: Need volume data in getLTPdata api

      @divyadesala Get historical api call using ONE_DAY as parameter. During or after trading hours last record shows Last date's OHLC & Vol

      posted in General Discussion
      W
      webseos
    • RE: Historical API Call returning Max 500 Records for any time frame

      @webseos

      Date Range 2020-08-09 14:33 to 2022-10-18 14:33 Interval ONE_DAY

                           Date    Open    High     Low   Close    Volume
      

      0 2020-10-13 00:00:00+05:30 170.45 174.90 169.75 173.25 9712363
      1 2020-10-14 00:00:00+05:30 173.00 175.00 171.05 174.20 10704122
      2 2020-10-15 00:00:00+05:30 174.90 178.25 171.70 173.65 19813787
      3 2020-10-16 00:00:00+05:30 174.10 180.55 172.35 179.80 15546424
      4 2020-10-19 00:00:00+05:30 181.00 183.85 177.70 182.70 17095601
      .. ... ... ... ... ... ...
      495 2022-10-12 00:00:00+05:30 398.05 401.40 391.75 400.20 6584165
      496 2022-10-13 00:00:00+05:30 411.00 416.50 400.00 401.55 16563626
      497 2022-10-14 00:00:00+05:30 411.25 411.25 396.40 397.15 6115863
      498 2022-10-17 00:00:00+05:30 395.05 395.90 386.30 388.30 8964609
      499 2022-10-18 00:00:00+05:30 391.50 398.40 391.35 392.95 5865887

      [500 rows x 6 columns]
      Stock Name : HINDALCO-EQ

      posted in General Discussion
      W
      webseos
    • Historical API Call returning Max 500 Records for any time frame

      I have seen for any time frame historical api call whether 1 min data, 5 min data, 15 min data returning 500 Max rows of OHLC Data

      Instead of what has been mentioned in this link below - https://smartapi.angelbroking.com/docs/Historical

      Interval | Max Days in one Request

      ONE_MINUTE 30
      THREE_MINUTE 90
      FIVE_MINUTE 90
      TEN_MINUTE 90
      FIFTEEN_MINUTE 180
      THIRTY_MINUTE 180
      ONE_HOUR 365
      ONE_DAY 2000

      posted in General Discussion
      W
      webseos
    • RE: Access rate

      @admin What is the recommended rate of Historical Data Fetch please mention.. Also some issue on it pls see the link here - https://smartapi.angelbroking.com/topic/2411/python-api-historical-data-fetch-became-arbitrary-dataframe-not-coming-after-totp-has-been-imposed

      posted in General Discussion
      W
      webseos
    • RE: Python API - Historical Data Fetch became arbitrary & DataFrame not coming after TOTP has been imposed

      Sometimes TOTP working and sometimes failing shown here : https://smartapi.angelbroking.com/topic/2408/arbitrary-output-of-python-api-sometimes-totp-failing-and-also-historical-data-fetch-failing

      posted in General Discussion
      W
      webseos
    • Python API - Historical Data Fetch became arbitrary & DataFrame not coming after TOTP has been imposed

      Historical Data Fetch became very arbitrary its not INTERNET connection problem. Yesterday night at 1 AM midnight all worked perfectly but today now during market hours now 10 AM around DataFrame not coming

      The Code remained same as past before TOTP system using PYTHON

      usr = SmartAPI(api_key,client_code,client_pass, totp)

      if(usr.sessionData['status'] == True):
      smartapiObj = usr.smartapiObj
      else:
      print("SmartAPI Object Session Data is not TRUE, exiting...")
      exit()

      df = None
      status = None
      msg = None
      stockObj = StockClass('NSE', symbol, token_mumber, smartapiObj)
      df, status, msg = stockObj.getDF_Daily(no_of_candles, fromDate, todayDate)

      In the above code the class function stockObj.getDF_Daily() returns DataFrame only with status and message. All worked perfectly before TOTP. and in this function or class nothing about TOTP used. smartapiObj is generated using TOTP only

      The Output shown by program

      Checking NIFTY50 Stocks : Please wait..

      Traceback (most recent call last):
      File "E:\projects\python\talib-smartapi\mainOTP.py", line 108, in <module>
      if df == None or df.empty : # if len(df.columns) == 0:
      File "C:\python\python39\lib\site-packages\pandas\core\generic.py", line 1537,
      in nonzero
      raise ValueError(
      ValueError: The truth value of a DataFrame is ambiguous. Use a.empty, a.bool(),
      a.item(), a.any() or a.all().

      posted in General Discussion
      W
      webseos
    • RE: Arbitrary output of Python API - Sometimes TOTP failing and Also Historical data fetch failing

      Historical Data Fetch became very arbitrary its not INTERNET connection problem. Yesterday night at 1 AM midnight all worked perfectly but today now during market hours now 10 AM around DataFrame not coming I have set a new TOPIC on it. Read the whole post here : https://smartapi.angelbroking.com/topic/2411/python-api-historical-data-fetch-became-arbitrary-dataframe-not-coming-after-totp-has-been-imposed

      posted in General Discussion
      W
      webseos
    • Arbitrary output of Python API - Sometimes TOTP failing and Also Historical data fetch failing

      When I am running my program with TOTP with python API after 5 fail 6th time program runs as follows also Historical Data Fetch became very arbitrary and most of the time failing with TOTP new system

      1. FAIL:
        E:\projects\python>python mainOTP.py
        Error Occurred in SMARTAPI : Invalid totp | PROGRAM ENDING...

      2. FAIL
        E:\projects\python>python mainOTP.py
        Error Occurred in SMARTAPI : Invalid totp | PROGRAM ENDING...

      3. FAIL
        E:\projects\python>python mainOTP.py
        Error Occurred in SMARTAPI : Invalid totp | PROGRAM ENDING...

      4. FAIL
        E:\projects\python>python mainOTP.py
        Error Occurred in SMARTAPI : Invalid totp | PROGRAM ENDING...

      5. FAIL
        E:\projects\python>python mainOTP.py
        Error Occurred in SMARTAPI : Invalid totp | PROGRAM ENDING...

      6. RUNS SUCCESS
        E:\projects\python>python mainOTP.py

      Choose Option :

      Nifty50 Stocks type 1 ....

      posted in General Discussion
      W
      webseos
    • RE: Guide to secure your SmartAPI Account with two factor authentication

      @aj_Brk I have used similar code as given below , but got the following exception
      Exception : Object of type TOTP is not JSON serializable

      but then I solved the problem

      But then I added last two lines and problem solved the last two lines given at the end of the following code- qrOtp is the code generated here : https://smartapi.angelbroking.com/enable-totp below the QR Code. So you have to generate your own qrOtp code here in this site. Then Install pyotp using command line "pip install pyotp"

      My Code Below ( Last line totp = totp.now() is very important)

      from smartapi import SmartConnect #or from smartapi.smartConnect import SmartConnect
      import config
      import pyotp

      client_code = "aaaaaa"
      client_pass = "bbbbbb"

      apiKey="yyyyyyy"
      qrOtp = "xxxxxxxx"
      totp = pyotp.TOTP(qrOtp)
      totp = totp.now()

      smartapiObj =SmartConnect(apiKey)

      data = smartapiObj.generateSession(client_code,client_pass,totp)
      print(data)

      posted in General Discussion
      W
      webseos