HOW CAN I GET "exchange": "", "tradingSymbol": "", "symbolToken": "", EXAMPLE : SENSEX 01 Jul 82700 Call ITS SYMBOL AND TOKEN ?
Posts made by C1234
-
HOW CAN I GET? TOKEN AND SYMBOL?
-
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 -
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?
-
RE: Issue while placing order and unauthorized order in my account.
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.
-
RE: Placing order using tokens
Dear @admin, it's been a while since I posted this, could you review and help us out ?
Regards,
Bharath -
RE: Issue while placing order and unauthorized order in my account.
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 -
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
-
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? -
string indices must be integers
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) -
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.
-
Maximum number of APIs
Dear team,
What is the maximum number of APIs a user can create? Is there a limit to this?
Can we use these APIs for a large scale number of clients?Looking forward for your response.
Kind regards,
Bharath Raj M -
Multi user order placement
Dear admin,
I am trying to place the same order for multiple clients at once. However, the login flow for each client takes about 0.8 seconds, so as the number of clients increase, this 0.8 seconds of delay for each clients adds up to a big number.
I'd like to know is there a feasible multiuser order placement gateway?
For instance, this is how I am able to place orders for multiple clients right now:
iterate through a list of client credentials
- generate smart api session for each client
- place order for each client (clientapi, symbol, transaction)
end loopCan someone guide me with a more efficient way to place multiuser orders?
Thank you,
Bharath Raj M