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
stopLossortakeProfityou leave out keeps its original value. positionIdis mandatory, for exampleNSE:KWIL-EQ-INTRADAY.qtyis optional and its maximum is the position quantity.legTypeis optional: 1 = offset, 2 = percentage.- To remove a level instead of changing it, pass
nullfor it. See Cancel Stop Loss & Target. - This is the Positions API, for an open position. To change Take Profit and Stop Loss on an order that is still pending, see Modifying TPSL in the Order Placement Guide.
- Rate limits differ between the Standard and Prime plans. See Plans & rate limits.
Request Attributes
| Attribute | Data Type | Description |
|---|---|---|
positionId* | string |
|
takeProfit | float | Take profit value. If not provided, the original value will be considered |
stopLoss | float | Stop loss value. If not provided, the original value will be considered |
qty | int | Optional. Max qty should be position qty |
legType | int | Optional. 1 = offset, 2 = percentage |
Response Attributes
| Attribute | Data Type | Description |
|---|---|---|
code | int | Response code returned by the API. 1102 indicates the stop-loss/target modification request was accepted |
s | string | Status of the request, e.g. ok |
message | string | Human-readable message describing the result of the request, e.g. "Successfully modified order" |
id_fyers | string | Unique identifier generated by FYERS for this modify stop-loss/target request |
Last updated on