Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions pybitget/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -1179,6 +1179,22 @@ def mix_cp_close_position(self, symbol, trackingNo):
else:
logger.error("pls check args")
return False

def mix_cp_close_all_positions(self, productType: str):
"""
Trader Close All Positions: https://bitgetlimited.github.io/apidoc/en/mix/#close-all-position
Limit
Limit rule: 1 times/1s (uid)
Required: productType
:param productType: The product type for closing positions
:return: Response from the API
:raises ValueError: If productType is not provided or is empty
"""
if not productType:
raise ValueError("Parameter `productType` is required and cannot be empty")

params = {"productType": productType}
return self._request_with_params(POST, MIX_ORDER_V1_URL + '/close-all-positions', params)

def mix_cp_modify_tpsl(self, symbol, trackingNo, stopProfitPrice=None, stopLossPrice=None):
"""
Expand Down