☰
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
Missing value error while placing GTT order
Amit2308
August 2020
edited August 2020
in
Python client
I am getting following error:
Traceback (most recent call last):
File "C:\Users\amits\OneDrive\Desktop\Avant Garde\alicetest.py", line 77, in
trigger_id= kite.place_gtt(trigger_type=kite.GTT_TYPE_OCO, tradingsymbol=ci, exchange='NFO', trigger_values=TRIGGER, last_price=y1, orders=ORDER)
File "C:\Users\amits\AppData\Local\Programs\Python\Python37\lib\site-packages\kiteconnect\connect.py", line 725, in place_gtt
condition, gtt_orders = self._get_gtt_payload(trigger_type, tradingsymbol, exchange, trigger_values, last_price, orders)
File "C:\Users\amits\AppData\Local\Programs\Python\Python37\lib\site-packages\kiteconnect\connect.py", line 694, in _get_gtt_payload
raise ex.InputException("`{req}` missing inside orders".format(req=req))
kiteconnect.exceptions.InputException: `quantity` missing inside orders
[Finished in 1.9s with exit code 1]
while placing the following order:
token= 256265
x=kite.ohlc(token)
o=float(x[str(token)]['ohlc'].get('open'))
a=o//100
call_strike=int(a*100)
put_strike=call_strike+100
expiry_date= '20806'
instrument= 'NIFTY'
ci= instrument + expiry_date + str(call_strike) + 'CE'
pi= instrument + expiry_date + str(put_strike) + 'PE'
call_instrument= 'NFO:' + instrument + expiry_date + str(call_strike) + 'CE'
put_instrument= 'NFO:' + instrument + expiry_date + str(put_strike) + 'PE'
#print(call_instrument)
call_x=kite.ltp(call_instrument)
#print(call_x)
call_token=str(call_x[call_instrument].get('instrument_token'))
put_x=kite.ltp(put_instrument)
#print(put_x)
put_token=str(put_x[put_instrument].get('instrument_token'))
#print(call_token)
#print(put_token)
x=kite.ltp(call_token)
y1=float(x[str(call_token)].get('last_price'))
ORDER= [
{
"exchange":"NFO",
"tradingsymbol": ci,
"transaction_type": kite.TRANSACTION_TYPE_SELL,
"quantity": 75,
"order_type": "LIMIT",
"product": "NRML",
"price": 225.0
},
{
"exchange":"NFO",
"tradingsymbol": ci,
"transaction_type": kite.TRANSACTION_TYPE_SELL,
"quantity": 75,
"order_type": "LIMIT",
"product": "NRML",
"price": 200.0
}
]
trigger_id= kite.place_gtt(trigger_type=kite.GTT_TYPE_OCO, tradingsymbol=ci, exchange='NFO', trigger_values=[200.0,225.0], last_price=y1, orders=ORDER)
Can anyone please help me with spotting the error??
Tagged:
missing
GTT
#gtt #kite #python
kiteconnect.exceptions.InputException: `quantity` missing inside orders
Sign In
or
Register
to comment.