twquant

retrieve financial-related data and use the data on investment decision making


Keywords
SOME, MEANINGFULL, KEYWORDS
License
MIT
Install
pip install twquant==0.2

Documentation

twquant

Twquant is a framework which aims for quant investment. Within current version, the focus is stock selecting. The functions include but are not limited as follows.

  1. Retrieve raw data by web scraping and turn raw data into formatted data.
  2. Combine various source of data and get the whole picture.
  3. Calculate yearly return after addressing price adjustment in given time period.
  4. Backtesting - import specific criteria and calculate correspondent yearly return.

Installing

Use the package manager pip to install twquant.

pip install twquant

Usage

from twquant import stockindc as si

x = si.Price('20200619', '上市')
x.head(1) # returns price data of sii on 20200619

For more information, please check the files below.

api_metrics.ipynb illustrates how to retrieve clean financial data. api_test.ipynb illustrates how to download data to local and use the data to realize backtesting.

Note

Some functions require 'tej.csv' to execute. This csv file is derived and simplified from open data of tej companies basic information. The purpose of using tej data is to map the industry of each company and to generate average industry PE ratio. An example ready-to-use file can be found on the github of twquant. Although that file is compatible with package, the content is not updated and it's recommended to get your own tej api key and replace the content with the latest one.

Disclaimer

Twquant retrieves data from publicly accessible source. We make no representations or warranties about the completeness, reliability and accuracy of data. Any action you take on the data via this package is strictly on your own risk. We will not be liable for any losses and connections with the uses of package.

License

MIT