Navigation

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

    TheM3

    @TheM3

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

    TheM3 Follow

    Best posts made by TheM3

    This user hasn't posted anything yet.

    Latest posts made by TheM3

    • Open price is not available in streaming data

      Hi @admin ! When I am trying to fetch OHLC through websocket, High, Low and Close price match correctly however instead of Open price i am getting closing of the previous candle. Is there any solution of it, please?

      posted in Bugs
      T
      TheM3
    • Unable to fetch candle data

      Fetch historical data for the latest 25 candles

      def fetch_historical_data(token, interval='ONE_MINUTE', limit=25):
      url = 'https://apiconnect.angelbroking.com/rest/secure/angelbroking/historical/v1/getCandleData'
      end_date = datetime.now(ist).strftime('%Y-%m-%d %H:%M:%S')
      start_date = (datetime.now(ist) - timedelta(minutes=limit * 1)).strftime('%Y-%m-%d %H:%M:%S')

      params = {
          'symbol': f'NFO:{token}',
          'interval': interval,
          'from_date': start_date,
          'to_date': end_date
      }
      headers = {'Authorization': appCreds['ao_appSecret']}
      print("i am here1----------------->")
      try:
          print("i am here2----------------->")
          response = requests.get(url, params=params, headers=headers)
          response.raise_for_status()  # Check if request was successful
          print("Response Status Code:", response.status_code)
          print("Response Content:", response.text)
          data = response.json()
          print("i am here3----------------->")
          return data
      except requests.RequestException as e:
          print(f"RequestException: {e}")
          print(f"Response Content: {response.text}")
          return None
      except ValueError as e:
          print(f"ValueError: {e}")
          print(f"Response Content: {response.text}")
          return None
      

      Getting the following error:
      i am here1----------------->
      i am here2----------------->
      Response Status Code: 200
      Response Content: <html><head><title>Request Rejected</title></head><body>The requested URL was rejected. Please consult with your administrator.<br><br>Your support ID is: 30350829149037984<br><br><a href='javascript:history.back();'>[Go Back]</a></body></html>
      RequestException: Expecting value: line 1 column 1 (char 0)
      Response Content: <html><head><title>Request Rejected</title></head><body>The requested URL was rejected. Please consult with your administrator.<br><br>Your support ID is: 30350829149037984<br><br><a href='javascript:history.back();'>[Go Back]</a></body></html>
      WebSocket Connection Open !!!

      Error encountered: Connection closed
      [W 240723 14:29:45 smartWebSocketV2:343] Connection closed due to max retry attempts reached.
      Error encountered: Connection closed
      [W 240723 14:29:45 smartWebSocketV2:343] Connection closed due to max retry attempts reached.
      Error encountered: Connection closed
      [W 240723 14:29:45 smartWebSocketV2:343] Connection closed due to max retry attempts reached.

      posted in Python SDK
      T
      TheM3
    • Data Pull Failed with Error - Couldn't parse the JSON response received from the server: b''

      After stablishing the connection to SmartAPI, I am trying to pull the historic data. While pulling the data I am getting this error: Data Pull Failed with Error - Couldn't parse the JSON response received from the server: b''

      Kindly help me.
      Regards,
      TheM3

      posted in Bugs
      T
      TheM3