How to place order with tag

vishwash_yadav
Hi,
I want to place order with some tag so that i can list out all orders which is executed from my application. Doing like this it will help me to generate report for my application about Profit/Loss over a month/week.
Tagged:
  • sujith
    @vishwash_yadav,
    Order tag is already available. You can check out documentation.
  • trade_then
    trade_then edited February 2018
    in PlaceOrder Tag is already an argument provided, you just have to fill it and crosscheck it with the order details you download, or receive through websocket connection.

    Length of Tag word cannot be more then 8 characters.

    Thanks
    Regards
  • MAG
    @vishwash_yadav

    TagStr="02281"
    order_id=kws.order_place(
    exchange=NSE,
    tradingsymbol=ACC,
    transaction_type=BUY, # or SELL
    quantity=1,
    price=1634.4,
    product=MIS,
    order_type=LIMIT,
    validity=DAY,
    variety=regular,
    tag=TagStr
    )

    Tag can be alphanumeric, no special characters. Max length is 8 characters.
  • ankur0101
    But what is the use of tag?
  • gsuryagandh
    @ankur0101 one can identify orders belonging to certain algorithm if he is running multiple algorithms
  • ankur0101
    Yes, I thought of that only but when I set some value in a tag and algo fires the order, I dont see that tag in the orders that have been executed.
  • ankur0101
    @vivek @sujith , I am setting a text value in tags parameter while placing an order but it is not visible in kite's order page. Need your input
  • sujith
    @ankur0101,
    It can only take alphanumeric characters of maximum length 8.
    Are you sure you are not sending special characters and length of the string is not more than length 8?
  • ankur0101
    ankur0101 edited April 2018
    @sujith , yes please find source code:


    url = "https://api.kite.trade/orders/regular"
    zerodhaToken = "token "+api_key+":" + access_token
    headers = {"X-Kite-Version": "3", "Authorization": zerodhaToken}
    data = { "tradingsymbol" : tradingSymbol,
    "exchange" : exchange,
    "transaction_type" : transaction_type,
    "product" : product,
    "order_type" : order_type,
    "quantity" : quantity,
    "price" : price,
    "trigger_price" : trigger_price,
    "disclosed_quantity" : disclosed_quantity, "validity" : validity, "tag" : "tag1"
    }

    response = requests.post(url, headers=headers, data=data)
  • ankur0101
    My code belongs to python
  • sujith
    Are you using pykiteconnect?
    Can you elaborate your issue, tags are not there in the orderbook response or it is not visible on Kite web/mobile?
  • ankur0101
    No, I am using pure REST API. While placing an order from python, I am using the above code, I believe given tag "tag1" should be visible when I login to Kite > Orders > Locate respective order > Order info



  • ankur0101
    @sujith @vivek from which interface we can see the tags that I set from API?
  • sujith
    Order tags are only visible in response. It won't show up on Kite.
  • ankur0101
    ankur0101 edited April 2018
    Thanks @sujith I think it would be good idea to have them in Kite too, because user will understand whether the order has been placed manually or using algo.
  • sujith
    I am afraid we can't add that in Kite Web different platforms use it in a different way.
This discussion has been closed.