Ccxt: okex ์‹œ๊ฐ„ ์ดˆ๊ณผ์˜ Fetch_ohlcv (๊ธฐํ˜ธ, '1m')

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

๋ฌธ์ œ :
๋‚˜๋Š” ์•ฝ 30 ๋ถ„ ํ›„, ํƒ€์ž„ ์•„์›ƒ ๋ฌธ์ œ๋Š” ๊ตํ™˜ ๋ฌธ์ œ, ๋˜๋Š” ccxt ๋ฌธ์ œ, ํ•ด๊ฒฐ ๋ฐฉ๋ฒ•์ž…๋‹ˆ๋‹ค.

  • ์šด์˜์ฒด์ œ : win10
  • ํ”„๋กœ๊ทธ๋ž˜๋ฐ ์–ธ์–ด ๋ฒ„์ „ : python 3.6
  • CCXT ๋ฒ„์ „ : ccxt-1.11.137
  • ๊ตํ™˜ : okex
  • ๋ฉ”์†Œ๋“œ : exchange.fetch_ohlcv (self.symbol, '1m')

์•”ํ˜ธ:

 def get_close_prices(self):
        close_prices = []
        bar_data = np.array(self.exchange.fetch_ohlcv(symbol, '1m'))
        for element in bar_data:
            close_prices.append(float(element[4]))
        return close_prices

if __name__ == '__main__':
while true:
        close_prices = self.get_close_prices()
        time.sleep(1 * 60)

์˜ค๋ฅ˜:

handle_bar์˜ "E : /work/test/test.py"ํŒŒ์ผ 44 ํ–‰
close_prices = np.array (self.get_close_prices ())
ํŒŒ์ผ "E : /work/test/test.py", 24 ํ–‰, get_close_prices
bar_data = np.array (self.exchange.fetch_ohlcv (self.symbol, '1m'))
fetch_ohlcv์—์žˆ๋Š” ํŒŒ์ผ "E : \ sorfware \ anaconda3.5 \ lib \ site-packages \ ccxt \ okcoinusd.py", 348 ํ–‰
์‘๋‹ต = getattr (self, method) (self.extend (request, params))
ํŒŒ์ผ "E : \ sorfware \ anaconda3.5 \ lib \ site-packages \ ccxt \ base \ exchange.py", 298 ํ–‰, ์š”์ฒญ์‹œ
return self.fetch2 (path, api, method, params, headers, body)
fetch2์˜ ํŒŒ์ผ "E : \ sorfware \ anaconda3.5 \ lib \ site-packages \ ccxt \ base \ exchange.py", 295 ํ–‰
return self.fetch (request [ 'url'], request [ 'method'], request [ 'headers'], request [ 'body'])
ํŒŒ์ผ "E : \ sorfware \ anaconda3.5 \ lib \ site-packages \ ccxt \ base \ exchange.py", ์ค„ 359, ๊ฐ€์ ธ ์˜ค๊ธฐ
self.raise_error (RequestTimeout, ๋ฉ”์†Œ๋“œ, URL, e)
ํŒŒ์ผ "E : \ sorfware \ anaconda3.5 \ lib \ site-packages \ ccxt \ base \ exchange.py", ์ค„ 280, raise_error
exception_type (์ถœ๋ ฅ) ๋ฐœ์ƒ
ccxt.base.errors.RequestTimeout : okex GET https://www.okex.com/api/v1/kline.do?symbol=bch_btc&type=1min&since=1521547087487 HTTPSConnectionPool (host = 'www.okex.com', port = 443 ) : ์ฝ๊ธฐ ์‹œ๊ฐ„์ด ์ดˆ๊ณผ๋˜์—ˆ์Šต๋‹ˆ๋‹ค. (์ฝ๊ธฐ ์‹œ๊ฐ„ ์ดˆ๊ณผ = 10)

duplicate question

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

๋‚˜๋Š” ์•ฝ 30 ๋ถ„ ํ›„, ํƒ€์ž„ ์•„์›ƒ ๋ฌธ์ œ, ๊ตํ™˜ ๋ฌธ์ œ ๋˜๋Š” ccxt ๋ฌธ์ œ

๊ทธ๊ฒƒ์€ ๊ตํ™˜์˜ ๋ฌธ์ œ์ด๋ฉฐ, ๋ชจ๋“  ๊ตํ™˜์€ ๋•Œ๋•Œ๋กœ RequestTimeout์œผ๋กœ ์‘๋‹ต ํ•  ๊ฒƒ์ž…๋‹ˆ๋‹ค. ์˜ฌ๋ฐ”๋ฅด๊ฒŒ ์ฒ˜๋ฆฌํ•˜๋ฉด๋ฉ๋‹ˆ๋‹ค.

๊ทธ๊ฒƒ์„ ํ•ด๊ฒฐํ•˜๋Š” ๋ฐฉ๋ฒ•.

์˜ˆ์™ธ๋ฅผ ํฌ์ฐฉํ•˜๊ณ  ๋‚˜์ค‘์— ๋‹ค์‹œ ์‹œ๋„ํ•˜์‹ญ์‹œ์˜ค.

๋„์›€์ด ๋˜์—ˆ๊ธฐ๋ฅผ ๋ฐ”๋ž๋‹ˆ๋‹ค.

์ •๋ง ๊ฐ์‚ฌํ•ฉ๋‹ˆ๋‹ค. ์ง€์นจ์— ๋”ฐ๋ผ ์˜ˆ์™ธ๋ฅผ ์žก๊ธฐ ์œ„ํ•ด ํ•ด๊ฒฐํ–ˆ์Šต๋‹ˆ๋‹ค.

๋‹ต์žฅ์„ ๋ณด๋‚ด ์ฃผ์‹  @nashse thx!

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