Navigation

    SmartAPI Forum
    • Register
    • Login
    • Search
    • Categories
    • Popular
    • Groups
    • FAQs
    • API Docs
    1. Home
    2. Bharath Raj M
    B
    • Profile
    • Following
    • Followers
    • Topics
    • Posts
    • Best
    • Groups

    Bharath Raj M

    @Bharath Raj M

    0
    Reputation
    12
    Posts
    8
    Profile views
    1
    Followers
    0
    Following
    Joined Last Online

    Bharath Raj M Follow

    Best posts made by Bharath Raj M

    This user hasn't posted anything yet.

    Latest posts made by Bharath Raj M

    • aws lambda order placement

      Hey everyone,

      We are trying to place orders from aws lambda and S3. if anyone knows how to go about it, kindly help us out.

      We are trying to mimic the behaviour of tradetron, where orders are placed at once for multiple users based on a given strategy.

      Kind regards,
      Bharath

      posted in Python SDK
      B
      Bharath Raj M
    • RE: Placing order using tokens

      @admin
      My personal client ID is B133022

      posted in Python SDK
      B
      Bharath Raj M
    • RE: Placing order using tokens

      @admin
      I could not find any documentation regarding this.

      Could you please give a step by step instruction on how it is supposed to be done?

      posted in Python SDK
      B
      Bharath Raj M
    • RE: Issue while placing order and unauthorized order in my account.

      @admin

      So I use python to place orders:

      def place_order(client_name,client_smartApi,tradingsymbol,symbol_token,symbolexchange,transactiontype,quantity):
          #place order
          try:
              orderparams = {
                  "variety": "NORMAL",
                  "tradingsymbol": str(tradingsymbol),
                  "symboltoken": str(symbol_token),
                  "transactiontype": str(transactiontype),
                  "exchange": str(symbolexchange),
                  "ordertype": "MARKET",
                  "producttype": "INTRADAY",
                  "duration": "DAY",
                  "quantity": str(quantity)
                  }
              orderId=client_smartApi.placeOrder(orderparams)
              print("The order id is: "+orderId+"\t client_name:"+client_name+" \t time:"+str(datetime.today()))
          except Exception as e:
              print(e)
      
      client_name = 'Username'
      client_smartApi=SmartConnect(api_key='api_key')
      login = client_smartApi.generateSession('Client_id','Client_password')
      refreshToken = login['data']['refreshToken']
      quantity = 'quantity'
      place_order(client_name,client_smartApi,tradingsymbol,symbol_token,symbolexchange,transactiontype,quantity)
      

      Once I executed the above, I got a response as follows:

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

      That's pretty much it.

      posted in Bugs
      B
      Bharath Raj M
    • RE: Placing order using tokens

      @Bharath-Raj-M

      Dear @admin, it's been a while since I posted this, could you review and help us out ?

      Regards,
      Bharath

      posted in Python SDK
      B
      Bharath Raj M
    • RE: Issue while placing order and unauthorized order in my account.

      @admin
      Dear @admin,

      I faced this issue while placing orders for clients too. I faced it today, could you guide us through the correct steps?

      And also give out a reason why this is happening?

      Regards,
      Bharath

      posted in Bugs
      B
      Bharath Raj M
    • Placing order using tokens

      Dear admin,

      Once we generate a session, how do we place order using just tokens?

      Right now I am doing this:

      client_smartApi = SmartConnect(api_key = client_api_key)
      login = client_smartApi.generateSession("Client_id","Client_password")
      orderId=client_smartApi.placeOrder(orderparams)
      print("OrderId :"+str(orderId))
      
      #obtain the required tokens
      access_token = client_smartApi.access_token
      refreshToken = login['data']['refreshToken']
      jwtToken = login['data']['jwtToken']
      

      The order is successfully placed here.
      As you can see, while placing the order I generateSession for the client using the client ID and the client password.

      However, how do we generate a session initially and then use the tokens to place the orders at a later point in time?

      I tried doing this -

      client_smartApi = SmartConnect(api_key = clien_api_key)
      client_smartApi.setAccessToken(access_token )
      client_smartApi.setRefreshToken(refreshToken )
      orderId=client_smartApi.placeOrder(orderparams)
      

      This throws an error as follows:

      ..........\lib\site-packages\smartapi\smartConnect.py in placeOrder(self, orderparams)
          288                 del(params[k])
          289 
      --> 290         orderResponse= self._postRequest("api.order.place", params)['data']['orderid']
          291 
          292         return orderResponse
      
      TypeError: string indices must be integers
      

      Could you please guide me with this?

      Thank you

      posted in Python SDK
      B
      Bharath Raj M
    • RE: Multi user order placement

      @admin Dear admin, can you be kind enough to tell me why we cant place orders for multiple clients?
      Am I missing something?
      Could you please guide me to the correct sources as well?

      posted in General Discussion
      B
      Bharath Raj M
    • string indices must be integers

      Re: Error while placing order

      Hey whenever I place my orders, the orders usually get executed, however sometimes, I get the error:
      "string indices must be integers"

      Here is a gist of my code:

      client_smartApi=SmartConnect(api_key='api_key')
      login = client_smartApi.generateSession('Client_id','password')
      try:
      orderparams = {
      "variety": "NORMAL",
      "tradingsymbol": tradingsymbol,
      "symboltoken": symbol_token,
      "transactiontype": transactiontype,
      "exchange": symbolexchange,
      "ordertype": "MARKET",
      "producttype": "CARRYFORWARD",
      "duration": "DAY",
      "quantity": quantity
      }
      orderId=client_smartApi.placeOrder(orderparams)
      except Exception as e:
      print(e)

      posted in Python SDK
      B
      Bharath Raj M
    • RE: Maximum number of APIs

      @admin
      Dear admin, is there a document about the rules (compliance) as you just mentioned it. Kindly share the link .

      I did not find anything as such in the API docs.

      posted in General Discussion
      B
      Bharath Raj M