xing-tick-crawler

ebest xing api wrapper


Keywords
xing-api, tick-data
License
MIT
Install
pip install xing-tick-crawler==0.0.2

Documentation

xing-tick-crawler

  • ๋ฐ˜๋“œ์‹œ python 32bit๋ฅผ ์‚ฌ์šฉ

์„ค์น˜

pip install xing-tick-crawler

์‚ฌ์šฉ์˜ˆ์‹œ

1. config.py ํŒŒ์ผ ์ƒ์„ฑ ๋ฐ ์„ค์ •

config = {
    "id": "my_id",  # xing api ์•„์ด๋””
    "password": "my_password",  # xing api ํŒจ์Šค์›Œ๋“œ
    "cert_password": "my_cert_password",  # ๊ณต๋™์ธ์ฆ์„œ ๋น„๋ฐ€๋ฒˆํ˜ธ
}

RES_FOLDER_PATH = "C:/eBEST/xingAPI/Res"  # xing_tick_crawler Res ํŒŒ์ผ ํด๋” ์œ„์น˜
TICKER_DATA_FOLDER_PATH = "."  # tick ๋ฐ์ดํ„ฐ ์ €์žฅํ•  ์œ„์น˜

2. main.py ์ƒ์„ฑ ๋ฐ ์‹คํ–‰

  • ํ•„์š”์—†๋Š” ๋ฐ์ดํ„ฐ off ํ•˜๊ณ , ์‹คํ–‰
"""
ํฌ๋กค๋Ÿฌ 1 ๊ตฌ๋…์˜ต์…˜ (๊ธฐ๋ณธ๊ฐ’ All True)
    - STOCK_VI_ON_OFF
    - KOSPI_ORDER_BOOK
    - KOSPI_AFTER_MARKET_ORDER_BOOK
    - KOSPI_AFTER_MARKET_TICK
    - KOSPI_BROKER_INFO
    - STOCK_FUTURES_ORDER_BOOK
    - STOCK_FUTURES_TICK

ํฌ๋กค๋Ÿฌ 2 ๊ตฌ๋…์˜ต์…˜ (๊ธฐ๋ณธ๊ฐ’ All True)
    - KOSDAQ_ORDER_BOOK
    - KOSDAQ_AFTER_MARKET_ORDER_BOOK
    - KOSDAQ_AFTER_MARKET_TICK
    - KOSDAQ_BROKER_INFO
"""

from xing_tick_crawler.crawler import crawler_1, crawler_2, crawl_kospi_tick, crawl_kosdaq_tick
from datetime import datetime
from multiprocessing import Process, get_context
from multiprocessing.queues import Queue

if __name__ == "__main__":
    crawler_1_subs_option = {
        # ์ฃผ์‹ VI ์ •๋ณด off
        'STOCK_VI_ON_OFF': False,
    }
    crawler_2_subs_option = {

    }

    queue = Queue(ctx=get_context())
    p1 = Process(target=crawl_kospi_tick, args=(queue,))
    p2 = Process(target=crawl_kosdaq_tick, args=(queue,))
    p3 = Process(target=crawler_1, args=(queue,), kwargs=crawler_1_subs_option)
    p4 = Process(target=crawler_2, args=(queue,), kwargs=crawler_2_subs_option)

    p1.start()
    p2.start()
    p3.start()
    p4.start()

    while True:
        tick = queue.get()
        waiting_tasks = queue.qsize()
        tick_type, tick_data = tick
        print(f"\r{datetime.now()} waiting tasks : {'%6d' % waiting_tasks}", end='')
        print(tick_type, tick_data)

๊ตฌํ˜„ Real ๋ชฉ๋ก

์ฃผ์‹์‹œ์žฅ

  • ์ฝ”์Šคํ”ผ ํ˜ธ๊ฐ€
  • ์ฝ”์Šคํ”ผ ์ฒด๊ฒฐ
  • ์ฝ”์Šค๋‹ฅ ํ˜ธ๊ฐ€
  • ์ฝ”์Šค๋‹ฅ ์ฒด๊ฒฐ
  • ์ฃผ์‹VI ๋ฐœ๋™ํ•ด์ œ
  • ์ฝ”์Šคํ”ผ ์‹œ๊ฐ„์™ธ๋‹จ์ผ๊ฐ€ ํ˜ธ๊ฐ€
  • ์ฝ”์Šคํ”ผ ์‹œ๊ฐ„์™ธ๋‹จ์ผ๊ฐ€ ์ฒด๊ฒฐ
  • ์ฝ”์Šค๋‹ฅ ์‹œ๊ฐ„์™ธ๋‹จ์ผ๊ฐ€ ํ˜ธ๊ฐ€
  • ์ฝ”์Šค๋‹ฅ ์‹œ๊ฐ„์™ธ๋‹จ์ผ๊ฐ€ ์ฒด๊ฒฐ
  • ์ฝ”์Šคํ”ผ ๊ฑฐ๋ž˜์›
  • ์ฝ”์Šค๋‹ฅ ๊ฑฐ๋ž˜์›
  • ์ฝ”์Šคํ”ผ ํ”„๋กœ๊ทธ๋žจ๋งค๋งค ์ข…๋ชฉ๋ณ„
  • ์ฝ”์Šค๋‹ฅ ํ”„๋กœ๊ทธ๋žจ๋งค๋งค ์ข…๋ชฉ๋ณ„

์„ ๋ฌผ์˜ต์…˜์‹œ์žฅ

  • ์ฃผ์‹์„ ๋ฌผ ํ˜ธ๊ฐ€
  • ์ฃผ์‹์„ ๋ฌผ ์ฒด๊ฒฐ
  • ์ฃผ์‹์„ ๋ฌผ ๊ฐ€๊ฒฉ์ œํ•œํญํ™•๋Œ€
  • ์ฝ”์Šคํ”ผ200 ์„ ๋ฌผํ˜ธ๊ฐ€
  • ์ฝ”์Šคํ”ผ200 ์„ ๋ฌผ์ฒด๊ฒฐ
  • ์ฝ”์Šคํ”ผ200 ์˜ต์…˜์ฒด๊ฒฐ
  • ์ฝ”์Šคํ”ผ200 ์˜ต์…˜ํ˜ธ๊ฐ€
  • ์ฝ”์Šคํ”ผ200 ์˜ต์…˜๊ฐ€๊ฒฉ์ œํ•œํญํ™•๋Œ€