See below details for order modification
Get Order Modification
tsl.modify_order(order_id, order_type, quantity, price=0, trigger_price=0, disclosed_quantity=0, validity='DAY', leg_name=None)
- Arguments:
- order_id (str): The unique ID of the order to be modified.
- order_type (str): Type of the order. Options include: - ‘LIMIT’: Limit order. - ‘MARKET’: Market order. - ‘STOPLIMIT’: Stop-loss limit order. - ‘STOPMARKET’: Stop-loss market order.
- quantity (int): The updated quantity for the order.
- price (float, optional): The updated price for the order (default is 0).
- trigger_price (float, optional): The updated trigger price for the order (default is 0).
- disclosed_quantity (int, optional): The quantity to disclose (default is 0).
- validity (str, optional): Validity of the order. Options are: - ‘DAY’: Order remains valid for the trading day (default). - ‘IOC’: Immediate or cancel.
- leg_name (str, optional): The specific leg to modify (used for bracket/CO orders). Options are: - ‘ENTRY_LEG’: Entry leg of the order. - ‘TARGET_LEG’: Target leg of the order. - ‘STOP_LOSS_LEG’: Stop-loss leg of the order. - If not applicable, leave as None.
- Returns:
- str: The modified order ID if the modification is successful.
- Raises an exception if the modification fails.
example code
orderid = '12241210603927'
modified_order_id = tsl.modify_order(order_id=orderid,order_type="LIMIT",quantity=50,price=0.1,trigger_price=0)