Navigation

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

    opt_trader

    @opt_trader

    0
    Reputation
    5
    Posts
    2
    Profile views
    0
    Followers
    0
    Following
    Joined Last Online

    opt_trader Follow

    Best posts made by opt_trader

    This user hasn't posted anything yet.

    Latest posts made by opt_trader

    • RE: Unable to fetch Historical Data for NFO

      @Moderator_3 Please find the code :

      obj = SmartConnect(api_key = apikey)
      data = obj.generateSession(clientId, pwd, totp)
      print(data)
      AUTH_TOKEN = data ["data"]["jwtToken"]
      refreshToken = data['data']['refreshToken']
      FEED_TOKEN = feedtoken

      res = obj.getProfile(refreshToken)
      res["data"]["exchanges"]
      print (res)

      And also please find the error message. It is pointing at the jwtToken but I have been using the same since long and the system is also returning the same :


      TypeError Traceback (most recent call last)
      Cell In[4], line 5
      3 data = obj.generateSession(clientId, pwd, totp)
      4 print(data)
      ----> 5 AUTH_TOKEN = data ["data"]["jwtToken"]
      6 refreshToken = data['data']['refreshToken']
      7 FEED_TOKEN = feedtoken

      TypeError: 'NoneType' object is not subscriptable

      posted in Bugs
      O
      opt_trader
    • Unable to fetch Historical Data for NFO

      Hi . Unable to fetch Historical data for NFO since yesterday night. Below is the error message:

      I 240613 11:15:36 smartConnect:121] in pool
      [E 240613 11:15:37 smartConnect:243] Error occurred while making a POST request to https://apiconnect.angelbroking.com/rest/auth/angelbroking/user/v1/loginByPassword. Error: Something Went Wrong, Please Try After Sometime.

      Please look into it

      posted in Bugs
      O
      opt_trader
    • RE: Free Python Code for Websocket 2.0 and Get Live Feed Data

      @J88913 Thank you Sir for sharing the video. Very grateful and Appreciate!!

      Request a clarification. on line 85 of the code which reads as below, we would be able to fetch the high, low , volume for the day. But how do we code it if we want the details for open, high , low , close, volume and open interest for all ticks say for 1 minute, so we can compile the date into candlestick data of for 1 minute

      LIVE_FEED_JSON[msg['token']] = {'1' :datetime.datetime.fromtimestamp(msg['exchange_timestamp']/1000).strftime('%Y-%m-%d %H:%M:%S') ,'3' :msg['last_traded_price']/100 ,'4' :msg['average_traded_price']/100 ,'5' :msg['high_price_of_the_day']/100 ,'6':msg['low_price_of_the_day']/100 ,'7' :msg['closed_price']/100 ,'8':msg['volume_trade_for_the_day'],'9':msg['open_interest']}

      posted in General Discussion
      O
      opt_trader
    • RE: Historical API for Nifty and Bank Nifty

      @Moderator_2 Thank you for your kind and prompt responses.

      Kindly help how do we fetch open interest for historical data of options. I am using the below line of code but it is showing an error as

      Historic Api failed: 'Series' object has no attribute 'open_interest' BANKNIFTY20DEC2346000CE

      Code is as below:
      historicParam = {
      "exchange" : symbolInfo.exch_seg,
      "symboltoken": symbolInfo.token,
      "interval": "ONE_MINUTE",
      "fromdate": "2023-12-15 09:15",
      "todate": "2023-12-15 15:30",
      }
      res_json = obj.getCandleData(historicParam)
      columns = ["timestamp", "open", "high", "low", "close", "volume"]
      df = pd.DataFrame(res_json["data"], columns= columns )
      df["open_interest"] = symbolInfo.open_interest

      Without Open interest the code works fine. Thanks in advance

      posted in General Discussion
      O
      opt_trader
    • Historical Data for Options

      Re: Historical data for options

      @admin Do we have any update on historical data for options. Or any other solution available. Its much needed data

      posted in General Discussion
      O
      opt_trader