๋ฌธ์ :
๋๋ ์ฝ 30 ๋ถ ํ, ํ์ ์์ ๋ฌธ์ ๋ ๊ตํ ๋ฌธ์ , ๋๋ ccxt ๋ฌธ์ , ํด๊ฒฐ ๋ฐฉ๋ฒ์
๋๋ค.
์ํธ:
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)
๋๋ ์ฝ 30 ๋ถ ํ, ํ์ ์์ ๋ฌธ์ , ๊ตํ ๋ฌธ์ ๋๋ ccxt ๋ฌธ์
๊ทธ๊ฒ์ ๊ตํ์ ๋ฌธ์ ์ด๋ฉฐ, ๋ชจ๋ ๊ตํ์ ๋๋๋ก RequestTimeout์ผ๋ก ์๋ต ํ ๊ฒ์ ๋๋ค. ์ฌ๋ฐ๋ฅด๊ฒ ์ฒ๋ฆฌํ๋ฉด๋ฉ๋๋ค.
๊ทธ๊ฒ์ ํด๊ฒฐํ๋ ๋ฐฉ๋ฒ.
์์ธ๋ฅผ ํฌ์ฐฉํ๊ณ ๋์ค์ ๋ค์ ์๋ํ์ญ์์ค.
๋์์ด ๋์๊ธฐ๋ฅผ ๋ฐ๋๋๋ค.
์ ๋ง ๊ฐ์ฌํฉ๋๋ค. ์ง์นจ์ ๋ฐ๋ผ ์์ธ๋ฅผ ์ก๊ธฐ ์ํด ํด๊ฒฐํ์ต๋๋ค.
๋ต์ฅ์ ๋ณด๋ด ์ฃผ์ @nashse thx!