☰
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
12.8K
All Categories
111
Node JS client
35
Go client
748
.Net API client
350
Kite Publisher
530
.Net / VBA / Excel (3rd party)
420
Algorithms and Strategies
940
Java client
979
API clients
392
PHP client
3.6K
Python client
325
Mobile and Desktop apps
1.3K
Market data (WebSockets)
3.1K
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