Ccxt: HitBTC ์‹œ์žฅ ๋งค์ˆ˜/๋งค๋„ ์ฃผ๋ฌธ ์‹คํŒจ

์— ๋งŒ๋“  2017๋…„ 10์›” 12์ผ  ยท  3์ฝ”๋ฉ˜ํŠธ  ยท  ์ถœ์ฒ˜: ccxt/ccxt

์•ˆ๋…•ํ•˜์„ธ์š”,

๋‚ด ์ฝ”๋“œ๋Š” ๋‹ค์Œ๊ณผ ๊ฐ™์Šต๋‹ˆ๋‹ค.

import ccxt
hitbtc = ccxt.hitbtc({
    "apiKey": "key",
    "secret": "secret",
    "verbose": True,
})
print(hitbtc.create_market_sell_order('BTC/USD', 0.01))

ccxt ์‹คํŒจ...

PS Key & nonce๋Š” ๊ดœ์ฐฎ์Šต๋‹ˆ๋‹ค. ์˜ˆ๋ฅผ ๋“ค์–ด ์ž”์•ก ๋ฐ์ดํ„ฐ๋ฅผ ๊ฐ€์ ธ์˜ฌ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

๊ฐ€์žฅ ์œ ์šฉํ•œ ๋Œ“๊ธ€

@Fcl69 ์•Œ๊ฒ ์Šต๋‹ˆ๋‹ค . ํ•˜์ง€๋งŒ ์กฐ๊ธˆ ๋” ์ž์„ธํ•œ ๋‚ด์šฉ์ด ์žˆ์Šต๋‹ˆ๋‹ค.

  1. HitBTC์—๋Š” timeInForce ์ฃผ๋ฌธ ๋งค๊ฐœ๋ณ€์ˆ˜๊ฐ€ ์žˆ์Šต๋‹ˆ๋‹ค. ์ด๋Š” ์ฃผ๋ฌธ ์‹คํ–‰์„ ์ œ์–ดํ•˜๋Š” โ€‹โ€‹์„ค์ •์ž…๋‹ˆ๋‹ค(HitBTC๊ฐ€ ์ฃผ๋ฌธ์„ ์ฒ˜๋ฆฌํ•˜๊ณ  ์ฑ„์šฐ๋Š” ๋ฐฉ๋ฒ•):
GTC (Good-Til-Canceled): the order will stay open or partially closed until filled or canceled by user
IOC (Immediate-Or-Cancel): the order will either fill immediately or will be canceled automatically
FOK (Fill-Or-Kill): the order will either be filled entirely or will expire
DAY (Day): the order will either be filled in 24 hours or will expire
GTD (Good Till Date):ย the order will expire on specific date
  1. HitBTC ๋ฐ ccxt์˜ ์ง€์ •๊ฐ€ ์ฃผ๋ฌธ์— ๋Œ€ํ•œ ๊ธฐ๋ณธ ์‹คํ–‰ ์œ ํ˜•์€ GTC์ž…๋‹ˆ๋‹ค.

  2. ์‹œ์žฅ ์ฃผ๋ฌธ์˜ ๊ฒฝ์šฐ HitBTC๋Š” IOC ๋˜๋Š” FOK๋งŒ ํ—ˆ์šฉํ•ฉ๋‹ˆ๋‹ค. HitBTC ๋ฐ ccxt์˜ ๊ธฐ๋ณธ๊ฐ’์€ FOK์ž…๋‹ˆ๋‹ค.
    IOC ์‹คํ–‰์ด ํ•„์š”ํ•œ ๊ฒฝ์šฐ ๋‹ค์Œ๊ณผ ๊ฐ™์ด ์ฃผ๋ฌธ๊ณผ ํ•จ๊ป˜ ์ถ”๊ฐ€ ๋งค๊ฐœ๋ณ€์ˆ˜๋กœ ์ „๋‹ฌํ•ด์•ผ ํ•ฉ๋‹ˆ๋‹ค.

hitbtc.create_market_sell_order('BTC/USD', 0.01) # default
hitbtc.create_market_sell_order('BTC/USD', 0.01, { 'timeInForce': 'FOK' }) # default
hitbtc.create_market_buy_order('BTC/USD', 0.01, { 'timeInForce': 'IOC' })

hitbtc.create_limit_sell_order('BTC/USD', 0.01) # default
hitbtc.create_limit_sell_order('BTC/USD', 0.01, { 'timeInForce': 'GTC' }) # default
hitbtc.create_limit_buy_order('BTC/USD', 0.01, { 'timeInForce': 'IOC' })

์งˆ๋ฌธ์ด๋‚˜ ์–ด๋ ค์šด ์ ์ด ์žˆ์œผ๋ฉด ์•Œ๋ ค์ฃผ์„ธ์š”. ๊ณ ๋งˆ์›Œ!

๋ชจ๋“  3 ๋Œ“๊ธ€

์•ˆ๋…•ํ•˜์„ธ์š” @Fcl69์ž…๋‹ˆ๋‹ค!
์กฐ๊ธˆ ์ˆ˜์ •ํ•ด์„œ ์˜ฌ๋ ธ๋Š”๋ฐ.. ๋‹ค์‹œ ํ•ด๋ณด๊ณ  ์ œ๋ณด ๋ถ€ํƒ๋“œ๋ ค๋„ ๋ ๊นŒ์š”? ์ด์ œ ์ž‘๋™ํ•ด์•ผ ํ•ฉ๋‹ˆ๋‹ค.
๊ฑด๋ฐฐ!

๊ทธ๊ฒƒ์€ ํšจ๊ณผ๊ฐ€ ์žˆ์—ˆ๋‹ค! ๊ฐ์‚ฌํ•ฉ๋‹ˆ๋‹ค!

@Fcl69 ์•Œ๊ฒ ์Šต๋‹ˆ๋‹ค . ํ•˜์ง€๋งŒ ์กฐ๊ธˆ ๋” ์ž์„ธํ•œ ๋‚ด์šฉ์ด ์žˆ์Šต๋‹ˆ๋‹ค.

  1. HitBTC์—๋Š” timeInForce ์ฃผ๋ฌธ ๋งค๊ฐœ๋ณ€์ˆ˜๊ฐ€ ์žˆ์Šต๋‹ˆ๋‹ค. ์ด๋Š” ์ฃผ๋ฌธ ์‹คํ–‰์„ ์ œ์–ดํ•˜๋Š” โ€‹โ€‹์„ค์ •์ž…๋‹ˆ๋‹ค(HitBTC๊ฐ€ ์ฃผ๋ฌธ์„ ์ฒ˜๋ฆฌํ•˜๊ณ  ์ฑ„์šฐ๋Š” ๋ฐฉ๋ฒ•):
GTC (Good-Til-Canceled): the order will stay open or partially closed until filled or canceled by user
IOC (Immediate-Or-Cancel): the order will either fill immediately or will be canceled automatically
FOK (Fill-Or-Kill): the order will either be filled entirely or will expire
DAY (Day): the order will either be filled in 24 hours or will expire
GTD (Good Till Date):ย the order will expire on specific date
  1. HitBTC ๋ฐ ccxt์˜ ์ง€์ •๊ฐ€ ์ฃผ๋ฌธ์— ๋Œ€ํ•œ ๊ธฐ๋ณธ ์‹คํ–‰ ์œ ํ˜•์€ GTC์ž…๋‹ˆ๋‹ค.

  2. ์‹œ์žฅ ์ฃผ๋ฌธ์˜ ๊ฒฝ์šฐ HitBTC๋Š” IOC ๋˜๋Š” FOK๋งŒ ํ—ˆ์šฉํ•ฉ๋‹ˆ๋‹ค. HitBTC ๋ฐ ccxt์˜ ๊ธฐ๋ณธ๊ฐ’์€ FOK์ž…๋‹ˆ๋‹ค.
    IOC ์‹คํ–‰์ด ํ•„์š”ํ•œ ๊ฒฝ์šฐ ๋‹ค์Œ๊ณผ ๊ฐ™์ด ์ฃผ๋ฌธ๊ณผ ํ•จ๊ป˜ ์ถ”๊ฐ€ ๋งค๊ฐœ๋ณ€์ˆ˜๋กœ ์ „๋‹ฌํ•ด์•ผ ํ•ฉ๋‹ˆ๋‹ค.

hitbtc.create_market_sell_order('BTC/USD', 0.01) # default
hitbtc.create_market_sell_order('BTC/USD', 0.01, { 'timeInForce': 'FOK' }) # default
hitbtc.create_market_buy_order('BTC/USD', 0.01, { 'timeInForce': 'IOC' })

hitbtc.create_limit_sell_order('BTC/USD', 0.01) # default
hitbtc.create_limit_sell_order('BTC/USD', 0.01, { 'timeInForce': 'GTC' }) # default
hitbtc.create_limit_buy_order('BTC/USD', 0.01, { 'timeInForce': 'IOC' })

์งˆ๋ฌธ์ด๋‚˜ ์–ด๋ ค์šด ์ ์ด ์žˆ์œผ๋ฉด ์•Œ๋ ค์ฃผ์„ธ์š”. ๊ณ ๋งˆ์›Œ!

์ด ํŽ˜์ด์ง€๊ฐ€ ๋„์›€์ด ๋˜์—ˆ๋‚˜์š”?
0 / 5 - 0 ๋“ฑ๊ธ‰