> For the complete documentation index, see [llms.txt](https://hdsd2.entrade.com.vn/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://hdsd2.entrade.com.vn/entrade-api/15.-chot-loi-cat-lo-tung-deal.md).

# 15. Chốt lời cắt lỗ từng Deal

* **URL:**&#x20;

PROD: <https://services.entrade.com.vn/entrade-api/deal\\_risks/:dealId&#x20>;

PAPERTRADE: <https://services.entrade.com.vn/papertrade-entrade-api/deal\\_risks/:dealId&#x20>;

* **Method**: PATCH&#x20;

Description: Sửa cấu hình chốt lời cắt lỗ Deal&#x20;

* **Parameters**:&#x20;

dealId: id Deal&#x20;

* Query parameters: None&#x20;
* Request body:&#x20;

<pre><code>{ 
cutLossEnabled: true 
cutLossOrderDelta: -2 
cutLossOrderStrategy: "TriggerPrice" 
cutLossPriceDelta: 5 
cutLossRate: 0.88 
cutLossType: "Rate" 
takeProfitEnabled: true 
<strong>takeProfitOrderDelta: -2 
</strong>takeProfitOrderStrategy: "TriggerPrice" 
takeProfitPriceDelta: 5 
takeProfitRate: 1 
takeProfitType: "Rate" 
trailingEnabled: false
}
</code></pre>

* Mô tả:&#x20;
  * cutLossEnabled: Bật tắt tính năng cắt lỗ cho Deal&#x20;
  * cutLossType: Loại cắt lỗ&#x20;
    * "Rate": Theo tỷ lệ&#x20;
    * "TriggerPrice": Theo khoảng điểm&#x20;
  * cutLossRate: Tỷ lệ lỗ&#x20;
  * cutLossPriceDelta: Khoảng điểm cắt lỗ để xác định giá Kích hoạt&#x20;
  * cutLossOrderStrategy: Chiến thuật đặt lệnh cắt lỗ&#x20;
    * "TriggerPrice": Đặt lệnh theo biên độ&#x20;
    * "CeilFloor": Đặt lệnh theo Giá Trần/ Sàn&#x20;
  * cutLossOrderDelta: Biên độ để xác định Giá đặt&#x20;
  * takeProfitEnabled: Bật tắt tính năng chốt lời cho Deal&#x20;
  * takeProfitType: Loại chốt lời&#x20;
    * "Rate": Theo tỷ lệ&#x20;
    * "TriggerPrice": Theo khoảng điểm&#x20;
  * takeProfitRate: Tỷ lệ lãi&#x20;
  * takeProfitPriceDelta: Khoảng điểm chốt lời để xác định giá Kích hoạt&#x20;
  * takeProfitOrderStrategy: Chiến thuật đặt lệnh chốt lời&#x20;
    * "TriggerPrice": Đặt lệnh theo biên độ&#x20;
    * "CeilFloor": Đặt lệnh theo Giá Trần/ Sàn&#x20;
  * takeProfitOrderDelta: Biên độ để xác định Giá đặt&#x20;
  * trailingEnabled: Bật tắt tính năng Trailing&#x20;
* **Response**:&#x20;

```
{
    "id": 2938248, 
    "status": "NORMAL", 
    "positionType": -1, 
    "side": "NS", 
    "symbol": "41I1G5000", 
    "cutLossEnabled": true, 
    "cutLossType": "Rate", 
    "cutLossRate": 0.88, 
    "cutLossPriceDelta": 5.0, 
    "takeProfitRate": 1.0, 
    "cutPrice": 2221.4, 
    "bestPrice": 2029.5, 
    "takeProfitPrice": 1841.3, 
    "takeProfitValue": 1.9210613385E7, 
    "breakEventPrice": 2043.516983, 
    "takeProfitEnabled": true, 
    "takeProfitType": "Rate", 
    "takeProfitPriceDelta": 5.0, 
    "trailingEnabled": false, 
    "triggeredTakeProfit": false, 
    "triggeredCutLoss": false, 
    "triggeredLiquidate": false, 
    "cutLossOrderId": 0, 
    "liquidateOrderId": 0, 
    "takeProfitOrderId": 0, 
    "investorId": 1000061305, 
    "investorAccountId": 1000062472, 
    "createdDate": "2026-05-21T02:10:44.868+00:00", 
    "modifiedDate": "2026-05-21T10:20:47.922+00:00", 
    "openQuantity": 1, 
    "liquidPrice": 2164.8, 
    "maintenancePrice": 2124.3, 
    "takeProfitOrderDelta": -2.0, 
    "takeProfitOrderStrategy": "TriggerPrice", 
    "cutLossOrderStrategy": "CeilFloor", 
    "cutLossOrderDelta": 0.0, 
    "triggerIncreaseDealRate": false, 
    "countIncreaseDealRateFailed": 0, 
    "closedPositionFee": 0.0, 
    "marginCallAmount": 0.0, 
    "marginExcessAmount": 0.0, 
    "adjustedCostPrice": 0.0, 
    "closed": false 
}
```

* **Mô tả (các field quan trọng):**&#x20;
  * cutLossEnabled: Bật tắt tính năng cắt lỗ cho Deal&#x20;
  * cutLossType: Loại cắt lỗ
    * "Rate": Theo tỷ lệ&#x20;
    * "TriggerPrice": Theo khoảng điểm&#x20;
  * cutLossRate: Tỷ lệ lỗ&#x20;
  * cutLossPriceDelta: Khoảng điểm cắt lỗ để xác định giá Kích hoạt&#x20;
  * cutLossOrderStrategy: Chiến thuật đặt lệnh cắt lỗ&#x20;
    * "TriggerPrice": Đặt lệnh theo biên độ&#x20;
    * "CeilFloor": Đặt lệnh theo Giá Trần/ Sàn
  * cutLossOrderDelta: Biên độ để xác định Giá đặt&#x20;
  * takeProfitEnabled: Bật tắt tính năng chốt lời cho Deal&#x20;
  * takeProfitType: Loại chốt lời&#x20;
    * "Rate": Theo tỷ lệ&#x20;
    * "TriggerPrice": Theo khoảng điểm&#x20;
  * takeProfitRate: Tỷ lệ lãi&#x20;
  * takeProfitPriceDelta: Khoảng điểm chốt lời để xác định giá Kích hoạt&#x20;
  * takeProfitOrderStrategy: Chiến thuật đặt lệnh chốt lời&#x20;
    * "TriggerPrice": Đặt lệnh theo biên độ&#x20;
    * "CeilFloor": Đặt lệnh theo Giá Trần/ Sàn&#x20;
  * takeProfitOrderDelta: Biên độ để xác định Giá đặt&#x20;
  * trailingEnabled: Bật tắt tính năng Trailing&#x20;
