-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathtrade.py
More file actions
24 lines (18 loc) · 712 Bytes
/
trade.py
File metadata and controls
24 lines (18 loc) · 712 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
from kiteconnect import KiteConnect
api_key=open('secret/api_key.txt','r').read()
api_secret=open('secret/api_secret.txt','r').read()
kite = KiteConnect(api_key=api_key)
kite.set_access_token(open('secret/access_token.txt','r').read())
def order():
orderid=kite.place_order(tradingsymbol="INFY",
quantity="1",
exchange="NSE",
transaction_type="BUY",
order_type="MARKET",
product="CNC",
validity="DAY",
variety="regular")
print(orderid)
order()
Lastprice=kite.ltp('NSE:INFY')
print(Lastprice)