import pyupbit
import pprint
f = open("upbit.txt")
lines = f.readlines()
access = lines[0].strip() # access_key
secrets = lines[1].strip() # secret key
f.close()
upbit = pyupbit.Upbit(access, secrets)
# 현재가 조회
xrp_price = pyupbit.get_current_price("KRW-XRP")
print(xrp_price)
# 지정가 주문
resp = upbit.buy_limit_order("KRW-XRP",767,100)
pprint.pprint(resp)
import pprint
f = open("upbit.txt")
lines = f.readlines()
access = lines[0].strip() # access_key
secrets = lines[1].strip() # secret key
f.close()
upbit = pyupbit.Upbit(access, secrets)
# 현재가 조회
xrp_price = pyupbit.get_current_price("KRW-XRP")
print(xrp_price)
# 지정가 주문
resp = upbit.buy_limit_order("KRW-XRP",767,100)
pprint.pprint(resp)
'재테크•투자•경제•주식' 카테고리의 다른 글
[pyupbit] 시장가 매수 (0) | 2024.02.18 |
---|---|
[pyupbit] 지정가 매도 (0) | 2024.02.18 |
[pyupbit] 보유코인 별 잔고 조회 (0) | 2024.02.18 |
[pyupbit] 외부 파일에서 access, secret key 가져오기 및 잔고조회 (0) | 2024.02.18 |
[pyupbit] 매도/매수 호가 잔량 (0) | 2024.02.18 |