closes open positions for a market https://www.gate.com/docs/developers/apiv4/en/#place-futures-order https://www.gate.com/docs/developers/apiv4/en/#place-futures-order-2 https://www.gate.com/docs/developers/apiv4/en/#create-an-options-order :param str symb
(self, symbol: str, side: OrderSide = None, params={})
| 7590 | } |
| 7591 | |
| 7592 | async def close_position(self, symbol: str, side: OrderSide = None, params={}) -> Order: |
| 7593 | """ |
| 7594 | closes open positions for a market |
| 7595 | |
| 7596 | https://www.gate.com/docs/developers/apiv4/en/#place-futures-order |
| 7597 | https://www.gate.com/docs/developers/apiv4/en/#place-futures-order-2 |
| 7598 | https://www.gate.com/docs/developers/apiv4/en/#create-an-options-order |
| 7599 | |
| 7600 | :param str symbol: Unified CCXT market symbol |
| 7601 | :param str side: 'buy' or 'sell' |
| 7602 | :param dict [params]: extra parameters specific to the okx api endpoint |
| 7603 | :returns dict[]: `A list of position structures <https://docs.ccxt.com/?id=position-structure>` |
| 7604 | """ |
| 7605 | request = { |
| 7606 | 'close': True, |
| 7607 | } |
| 7608 | params = self.extend(request, params) |
| 7609 | if side is None: |
| 7610 | side = '' # side is not used but needs to be present, otherwise crashes in php |
| 7611 | return await self.create_order(symbol, 'market', side, 0, None, params) |
| 7612 | |
| 7613 | async def fetch_leverage(self, symbol: str, params={}) -> Leverage: |
| 7614 | """ |
nothing calls this directly
no test coverage detected