Actions
U 매수매도 » 이력 » 개정판 6
« 뒤로 |
개정판 6/7
(비교(diff))
| 다음 »
이태훈, 2025/02/10 01:50
매수/매도¶
소스코드(매수)¶
import pyupbit
access_key = "" # 본인 key값
secret_key = "" # 본인 key값
upbit = pyupbit.Upbit(access_key, secret_key)
ret = upbit.buy_limit_order("KRW-BTC", 130000000, 0.0001)
print(ret)
결과¶
[정상]
{'uuid': '0b55c009-aca6-4b5f-a33a-9cf2c84cd6da', 'side': 'bid', 'ord_type': 'limit', 'price': '130000000', 'state': 'wait', 'market': 'KRW-BTC', 'created_at': '2025-02-10T10:40:08+09:00', 'volume': '0.0001', 'remaining_volume': '0.0001', 'reserved_fee': '6.5', 'remaining_fee': '6.5', 'paid_fee': '0', 'locked': '13006.5', 'executed_volume': '0', 'trades_count': 0}
[오류] ※매수 시 비용이 부족한 경우 발생
InsufficientFundsBid None
소스코드(매도)¶
import pyupbit
access_key = "" # 본인 key값
secret_key = "" # 본인 key값
upbit = pyupbit.Upbit(access_key, secret_key)
ret = upbit.sell_limit_order("KRW-BTC", 130000000, 0.0001)
print(ret)
결과¶
[정상]
{'uuid': '0b55c009-aca6-4b5f-a33a-9cf2c84cd6da', 'side': 'bid', 'ord_type': 'limit', 'price': '130000000', 'state': 'wait', 'market': 'KRW-BTC', 'created_at': '2025-02-10T10:40:08+09:00', 'volume': '0.0001', 'remaining_volume': '0.0001', 'reserved_fee': '6.5', 'remaining_fee': '6.5', 'paid_fee': '0', 'locked': '13006.5', 'executed_volume': '0', 'trades_count': 0}
[오류] ※매도 시 비용이 부족한 경우 발생
InsufficientFundsAsk None
이태훈이(가) 10달 전에 변경 · 6 revisions