kingofhawks / stocktrace

stock market analysis
5 stars 3 forks source link
python3 stock-analysis stock-market

stocktrace will parse finance data from famous finance web sites and generate some useful report. tech stack: backend: python3+django+pandas frontend: react+highcharts

Features:

Tutorial:

  1. pip install -r requirements.txt
  2. install mongodb 3.6 mongodb backup:
    mongodump --db stocktrace
    mongodb restore:
    mongorestore --collection industry --db stocktrace dump/stocktrace/industry.bson run as windows service: mongod --dbpath=g:\data --logpath=g:\data\mongodb.log --install
  3. python manage.py runserver http://localhost:8000
  4. client side cd client yarn yarn start http://localhost:3000

How to run tests

  1. run module

python manage.py test market.tests.ParseTestCase.test_sw_history

  1. run test method

python manage.py test test.yahoo_test.TestSequenceFunctions.test_print_stock

  1. pycharm just right click test method and click "Run"

xueqiu.com API token:

Login xueqiu.com check HTTP request Cookie "xq_a_token"

Upgrade from python2 to 3
$2to3 -w analysis.py
https://docs.python.org/3/howto/pyporting.html
https://docs.python.org/3/library/2to3.html
http://python-future.org/

Reference

xueqiu

robinhood

tradehero

pandas to parse Excel