☰
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
July 2020
rhnvrm
July 2020
sudhirtambe
July 2020
sujith
get_gtts call does not return tag
sudhirtambe
July 2020
in
Python client
if place_gtt accept orders, which include tag field.
then, get_gtts should also return tag field.
Tagged:
tag
GTT
sujith
July 2020
@sudhirtambe
,
The order tags are not supported while placing a GTT.
sudhirtambe
July 2020
edited July 2020
tag is supported for GTT order, see working code snippet below. I am able to retrieve the tag through ticker as well when GTT is triggered & executed. So tag is functional in all aspect, except when get_gtts() is invoked.
#InsertKiteOrder
.py
if jsonOrdData['trigger_type']:
#Indicates
OCO Order
lstTriggers.insert(0, jsonOrdData['slPrice'])
lstOrders.insert(0, {'transaction_type':jsonOrdData['transaction_type'], 'quantity' :jsonOrdData['quantity'],
'price':jsonOrdData['slPrice'], 'order_type':orderType, 'product':product ,
'tag':jsonOrdData['tag']
})
trigger_type = KiteConnect.GTT_TYPE_OCO
print(f'lstTriggers: {lstTriggers}')
print(f'New lstOrders: {lstOrders}')
kite = KiteSingleton.get_instance()
ordId = kite.place_gtt(trigger_type=trigger_type, tradingsymbol=jsonOrdData['tradingsymbol'], exchange=jsonOrdData['exchange'],
last_price=last_price,trigger_values=lstTriggers, orders = lstOrders)
#TickerDAO
.py
if data['status'] == "COMPLETE": # or data['status'] == "CANCELLED":
print(f"status:{data['status']}\norder:{data}")
try:
TradeDAO.insertKiteMultiTrades(data['order_id'], data['tag'])
rhnvrm
July 2020
Hey
Currently we don't support tag in GTT, and we may consider supporting it at a later date.
At the moment, even the python api docs do not mention tag. (
https://github.com/zerodhatech/pykiteconnect/blob/b00a4b56581a50586d3139c204c72de317913c5c/kiteconnect/connect.py#L718
). To clarify, I think you are getting confused with the order api, which supports it. The order expected in GTT is not the same as that.
Sign In
or
Register
to comment.
The order tags are not supported while placing a GTT.
#InsertKiteOrder.py
if jsonOrdData['trigger_type']: #Indicates OCO Order
lstTriggers.insert(0, jsonOrdData['slPrice'])
lstOrders.insert(0, {'transaction_type':jsonOrdData['transaction_type'], 'quantity' :jsonOrdData['quantity'],
'price':jsonOrdData['slPrice'], 'order_type':orderType, 'product':product ,'tag':jsonOrdData['tag']})
trigger_type = KiteConnect.GTT_TYPE_OCO
print(f'lstTriggers: {lstTriggers}')
print(f'New lstOrders: {lstOrders}')
kite = KiteSingleton.get_instance()
ordId = kite.place_gtt(trigger_type=trigger_type, tradingsymbol=jsonOrdData['tradingsymbol'], exchange=jsonOrdData['exchange'],
last_price=last_price,trigger_values=lstTriggers, orders = lstOrders)
#TickerDAO.py
if data['status'] == "COMPLETE": # or data['status'] == "CANCELLED":
print(f"status:{data['status']}\norder:{data}")
try:
TradeDAO.insertKiteMultiTrades(data['order_id'], data['tag'])
Currently we don't support tag in GTT, and we may consider supporting it at a later date.
At the moment, even the python api docs do not mention tag. (https://github.com/zerodhatech/pykiteconnect/blob/b00a4b56581a50586d3139c204c72de317913c5c/kiteconnect/connect.py#L718). To clarify, I think you are getting confused with the order api, which supports it. The order expected in GTT is not the same as that.