U 주문취소 » 이력 » 버전 2
이태훈, 2025/02/10 02:03
| 1 | 1 | 이태훈 | h1. 주문취소 |
|---|---|---|---|
| 2 | |||
| 3 | h3. 소스코드 |
||
| 4 | |||
| 5 | <pre> |
||
| 6 | import pyupbit |
||
| 7 | |||
| 8 | access_key = "" # 본인 key값 |
||
| 9 | secret_key = "" # 본인 key값 |
||
| 10 | |||
| 11 | upbit = pyupbit.Upbit(access_key, secret_key) |
||
| 12 | ret = upbit.cancel_order('85cb8127-ce8a-4e6b-9e80-2f86021252f0') |
||
| 13 | print(ret) |
||
| 14 | </pre> |
||
| 15 | |||
| 16 | h3. 결과 |
||
| 17 | |||
| 18 | *[정상]* |
||
| 19 | |||
| 20 | <pre> |
||
| 21 | {'uuid': '85cb8127-ce8a-4e6b-9e80-2f86021252f0', 'side': 'ask', 'ord_type': 'limit', 'price': '170000000', 'state': 'wait', 'market': 'KRW-BTC', 'created_at': '2025-02-10T10:58:53+09:00', 'volume': '0.0011', 'remaining_volume': '0.0011', 'reserved_fee': '0', 'remaining_fee': '0', 'paid_fee': '0', 'locked': '0.0011', 'executed_volume': '0', 'trades_count': 0} |
||
| 22 | </pre> |
||
| 23 | |||
| 24 | *[오류]* |
||
| 25 | |||
| 26 | %{color:red}※이미 취소된 주문% |
||
| 27 | |||
| 28 | <pre> |
||
| 29 | {'error': {'name': 'canceled_order', 'message': '이미 취소된 주문입니다.'}} |
||
| 30 | </pre> |
||
| 31 | 2 | 이태훈 | |
| 32 | %{color:red}※uuid가 맞지 않는 경우% |
||
| 33 | |||
| 34 | <pre> |
||
| 35 | UpbitError |
||
| 36 | None |
||
| 37 | </pre> |