☰
Login
Signup
Home
›
Python client
Howdy, Stranger!
It looks like you're new here. If you want to get involved, click one of these buttons!
Sign In
Register
Categories
Recent Discussions
Activity
Categories
13.9K
All Categories
0
Incidents
156
Node JS client
40
Go client
793
.Net API client
380
Kite Publisher
537
.Net / VBA / Excel (3rd party)
457
Algorithms and Strategies
998
Java client
1.1K
API clients
404
PHP client
4K
Python client
347
Mobile and Desktop apps
1.4K
Market data (WebSockets)
3.3K
General
In this Discussion
October 2022
dearsatya
September 2022
rakeshr
September 2022
nikhil154
Algo order placing Error
nikhil154
September 2022
in
Python client
My algo is written in python .
When i try to place an order , it gives as error - Invalid `api_key` or `access_token`
def placeorder(scrip,qty,PRICE):
kite.place_order(variety="REGULAR",
exchange="NSE",
tradingsymbol=scrip,
transaction_type="BUY",
quantity=qty,
product="MIS",
order_type="LIMIT",
price=PRICE)
1. I can download data perfectly and also get the quotes perfectly
2. I have also enabled 2 factor authentication.
3. I have run these codes before and they have worked perfectly .
Can someone please tell me the error ?
What am i missing ?
nikhil154
September 2022
i even changed 'REGULAR' to 'regular'
rakeshr
September 2022
Go through
the order FAQs here
.
dearsatya
October 2022
#This
wrapper function works for me:
def PlaceBuyOrderLimitNSE(self, tradingsymbol, qty, price):
orderid = 1
try:
orderid = self.kite.place_order(variety=self.kite.VARIETY_REGULAR,
exchange=self.kite.EXCHANGE_NSE,
product=self.kite.PRODUCT_MIS,
order_type=self.kite.ORDER_TYPE_LIMIT,
tradingsymbol= tradingsymbol,
transaction_type=self.kite.TRANSACTION_TYPE_BUY,
quantity = qty,
price= price
)
except Exception as e:
print("Order placement failed: {}".format(e))
return orderid
Sign In
or
Register
to comment.
def PlaceBuyOrderLimitNSE(self, tradingsymbol, qty, price):
orderid = 1
try:
orderid = self.kite.place_order(variety=self.kite.VARIETY_REGULAR,
exchange=self.kite.EXCHANGE_NSE,
product=self.kite.PRODUCT_MIS,
order_type=self.kite.ORDER_TYPE_LIMIT,
tradingsymbol= tradingsymbol,
transaction_type=self.kite.TRANSACTION_TYPE_BUY,
quantity = qty,
price= price
)
except Exception as e:
print("Order placement failed: {}".format(e))
return orderid