Skip to Content
API ReferenceTradingPositionsCancel Stop Loss & Target

Cancel Stop Loss & Target

This API allows you to cancel the Stop Loss and Take Profit of an open position.

USE CASE

Remove the exit levels from a position and manage the exit yourself.

Note

Only the parameter passed as null is cancelled. If a parameter is not included in the request, its existing value remains unchanged.

Details

  • To cancel the Stop Loss or Take Profit added to an open position, use the Modify Stop Loss and Take Profit API and pass null for the applicable parameter.
  • This uses the same API as Set stop-loss and target and Modify stop-loss and target.
  • Cancel only Take Profit - send {"positionId": "NSE:KWIL-EQ-INTRADAY", "takeProfit": null}
  • Cancel only Stop Loss - send {"positionId": "NSE:KWIL-EQ-INTRADAY", "stopLoss": null}
  • Cancel both Stop Loss and Take Profit - send {"positionId": "NSE:KWIL-EQ-INTRADAY", "takeProfit": null, "stopLoss": null}
  • The position itself stays open. Only the stop loss or take profit you pass as null is removed.
  • positionId is mandatory, for example NSE:KWIL-EQ-INTRADAY. Get it from Get Positions.
  • This is the Positions API, for an open position. To cancel Take Profit and Stop Loss on an order that is still pending, see Cancelling TPSL in the Order Placement Guide.
  • Rate limits differ between the Standard and Prime plans. See Plans & rate limits.

Request Attributes

AttributeData TypeDescription
positionId*string
  • Mandatory. Position id
  • Eg: NSE:KWIL-EQ-INTRADAY
takeProfitfloat / nullPass null to cancel the Take Profit. If not included, the existing value remains unchanged
stopLossfloat / nullPass null to cancel the Stop Loss. If not included, the existing value remains unchanged

Response Attributes

AttributeData TypeDescription
sstringResponse status: ok / error
codeintResponse code, e.g. 1102 on success
messagestringResponse message, e.g. Successfully modified order
id_fyersstringInternal Fyers reference id generated for the request
Last updated on