æ¥æ¬æ ªã®æ¥è¶³ãã¼ã¿ããã¼ã«ã«ã®ãã¼ã¿ãã¼ã¹ã«åãè¾¼ããã¼ã«ãä½ã£ã
æ¥æ¬æ ªã®æ¥è¶³ãã¼ã¿ããã¼ã«ã«ã®ãã¼ã¿ãã¼ã¹ã«åãè¾¼ããã¼ã«ãä½ã£ã¦ã¿ã¾ããã
- Quandl ã§å ¬éããã¦ããæ¥æ¬æ ªã®æ¥è¶³ãã¼ã¿ãåå¾ãã¦ããã¼ã«ã«ã®PostgreSQLã«åãè¾¼ã¿ã¾ãã
- Tokyo Stock Exchangeãã¼ã¿ãã¼ã¹ã®å ¨ãã¼ã¿ãåãè¾¼ãã®ã§ãETFã®ãã¼ã¿ãªã©ãå«ã¾ãã¾ãã
- ã¨ãããããç´è¿500æ¥åã®ãã¼ã¿ãåå¾ããããã«ãã¦ãã¾ãã å¸å ´ãéãã¦ããæ¥ã®ãã¼ã¿ã®ã¿ãªã®ã§ã大ä½2å¹´åã§ãã
- æªã¤ã³ãã¼ãã®ãã¼ã¿ã®ã¿åãè¾¼ãã®ã§ãåããã¼ããã¨ã©ã¼ããã£ã¦ãåå®è¡ããã°OKã
- æ¯æ¥cronã§å®è¡ããã°ãææ°ã®æ¥è¶³ãã¼ã¿ã使ããç¶æ ã«ãªãã¯ãã§ãã
- DBã®ãã¼ãã«æ§æã¯ä»¥ä¸ã
äºåæºå
$ git --version git version 1.8.3.1 $ docker -v Docker version 1.10.2, build c3959b1 $ docker-compose -v docker-compose version 1.6.2, build 4d72027
使ãæ¹
$ git clone https://github.com/unageanu/stock-db.git $ cd stock-db $ vi .env # POSTGRES_PASSWORDãQUANDL_API_KEYãè¨å®ãã¾ãã # 以ä¸ã¯è¨å®ä¾ --- POSTGRES_USER=postgres POSTGRES_PASSWORD=mysecretpassword QUANDL_API_KEY=myquandlapikey QUANDL_API_VERSION=2015-04-09 --- $ docker-compose up -d # PostgreSQLãèµ·å $ bundle install $ bundle exec ruby -I src ./src/importer.rb
Quandlã®APIãã¼åå¾ã¯ãã¡ããåç §ã éæã¯4000å¼±ããã®ã§ãåãè¾¼ã¿ã«ã¯2,3æéãããã¾ãã
ãªããããããéã«æ¸ãã¦ããã®ã§ããäºæ¿ãã ããã