1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
import ccxt # ccxt(각종거래소) API 모듈
# GateIo API 모듈 적용
gateio=ccxt.gateio({"apiKey":"API키","secret":"SECRET키"})
# 게이트아이오 주문 / ex) GateIoOrder('XEM','/USDT',Money)
def GateIoOrder(Symbol,Market,Money):
# 매도 호가 조회 및 매수 수량 계산
price = gateio.fetch_order_book(Symbol+Market)['asks'][0][0]
ask_cal = Money/price
# 매도 호가 매수
Order_Message = gateio.create_limit_buy_order(Symbol+Market, ask_cal, price)
# 주문 내역 출력 및 메시지 전송
print(Order_Message)
GateIoOrder('FIO','/USDT',20)
|
cs |
사용모듈 ccxt