Navigation

    SmartAPI Forum
    • Register
    • Login
    • Search
    • Categories
    • Popular
    • Groups
    • FAQs
    • API Docs
    1. Home
    2. C1234
    C
    • Profile
    • Following 0
    • Followers 1
    • Topics 6
    • Posts 13
    • Best 0
    • Groups 0

    C1234

    @C1234

    1
    Reputation
    9
    Profile views
    13
    Posts
    1
    Followers
    0
    Following
    Joined Last Online

    C1234 Unfollow Follow

    Latest posts made by C1234

    • HOW CAN I GET? TOKEN AND SYMBOL?

      HOW CAN I GET "exchange": "", "tradingSymbol": "", "symbolToken": "", EXAMPLE : SENSEX 01 Jul 82700 Call ITS SYMBOL AND TOKEN ?

      posted in General Discussion
      C
      C1234
    • 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
      C
      C1234
    • RE: Placing order using tokens

      @admin
      My personal client ID is B133022

      posted in Python SDK
      C
      C1234
    • 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
      C
      C1234
    • 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 Test
      C
      C1234
    • 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
      C
      C1234
    • 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 Test
      C
      C1234
    • 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
      C
      C1234
    • 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
      C
      C1234
    • 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
      C
      C1234