Skip to Content
API ReferenceTradingPositionsModify Stop Loss & Target

Modify Stop Loss & Target

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

USE CASE

Tighten a stop loss as the price moves in your favour.

Details

  • This allows the user to modify the Stop Loss and Take Profit for an existing open position. User can provide the parameters that need to be modified. In case a particular parameter has not been provided, the original value will be considered.
  • Send only what you want to change. A stopLoss or takeProfit you leave out keeps its original value.
  • positionId is mandatory, for example NSE:KWIL-EQ-INTRADAY. qty is optional and its maximum is the position quantity.
  • legType is optional: 1 = offset, 2 = percentage.
  • To remove a level instead of changing it, pass null for it. See Cancel Stop Loss & Target.
  • 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
takeProfitfloatTake profit value. If not provided, the original value will be considered
stopLossfloatStop loss value. If not provided, the original value will be considered
qtyintOptional. Max qty should be position qty
legTypeintOptional. 1 = offset, 2 = percentage

Response Attributes

AttributeData TypeDescription
codeintResponse code returned by the API. 1102 indicates the stop-loss/target modification request was accepted
sstringStatus of the request, e.g. ok
messagestringHuman-readable message describing the result of the request, e.g. "Successfully modified order"
id_fyersstringUnique identifier generated by FYERS for this modify stop-loss/target request
Last updated on