{"id":20977154,"url":"https://github.com/marcnuth/autoquant","last_synced_at":"2025-10-05T15:06:00.373Z","repository":{"id":44983651,"uuid":"409545916","full_name":"Marcnuth/AutoQuant","owner":"Marcnuth","description":"AutoQuant is an out-of-the-box quantitative investment platform.","archived":false,"fork":false,"pushed_at":"2023-08-01T13:29:12.000Z","size":69711,"stargazers_count":12,"open_issues_count":0,"forks_count":3,"subscribers_count":3,"default_branch":"main","last_synced_at":"2024-04-26T20:22:43.490Z","etag":null,"topics":["ai-trade","backtrader","python","qlib","quant","quantitative-finance","trading"],"latest_commit_sha":null,"homepage":"https://autoquant.qogir.fund","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Marcnuth.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2021-09-23T10:27:25.000Z","updated_at":"2023-12-31T12:10:20.000Z","dependencies_parsed_at":"2023-02-17T17:01:11.262Z","dependency_job_id":"be9654ff-8c05-4199-9d0b-9874c7164696","html_url":"https://github.com/Marcnuth/AutoQuant","commit_stats":{"total_commits":22,"total_committers":3,"mean_commits":7.333333333333333,"dds":0.09090909090909094,"last_synced_commit":"ffd32fb5cbc79de91c209107ef0861339b37f7d1"},"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Marcnuth%2FAutoQuant","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Marcnuth%2FAutoQuant/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Marcnuth%2FAutoQuant/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Marcnuth%2FAutoQuant/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Marcnuth","download_url":"https://codeload.github.com/Marcnuth/AutoQuant/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225297832,"owners_count":17452010,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ai-trade","backtrader","python","qlib","quant","quantitative-finance","trading"],"created_at":"2024-11-19T04:57:31.576Z","updated_at":"2025-10-05T15:05:55.326Z","avatar_url":"https://github.com/Marcnuth.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![PypI Versions](https://img.shields.io/pypi/v/autoquant)](https://pypi.org/project/autoquant/#history)\n![PyPI - Downloads](https://img.shields.io/pypi/dm/AutoQuant?label=PyPI)\n[![Python Versions](https://img.shields.io/pypi/pyversions/pyqlib.svg?logo=python\u0026logoColor=white)](https://pypi.org/project/pyqlib/#files)\n[![Platform](https://img.shields.io/badge/platform-linux%20%7C%20windows%20%7C%20macos-lightgrey)](https://pypi.org/project/autoquant/#files)\n\n\n# AutoQuant\n\nAutoQuant is an out-of-the-box quantitative investment platform.\n\nIt contains the full ML pipeline of data processing, strategy building(includes AI \u0026 traditionals), back-testing, and covers the entire chain of quantitative investment: alpha seeking, risk modeling, portfolio optimization, and order execution.\n\nWith AutoQuant, users can easily try ideas to create better Quant investment strategies.\n\n\n- [AutoQuant](#autoquant)\n- [Quick Start](#quick-start)\n  - [Installation](#installation)\n  - [Data Preparation](#data-preparation)\n  - [Backtest](#backtest)\n- [Advanced Topics](#advanced-topics)\n  - [Market](#market)\n  - [Index](#index)\n  - [Indicators](#indicators)\n    - [Specific Indicators](#specific-indicators)\n    - [Backtrader Indicators](#backtrader-indicators)\n  - [Metrics](#metrics)\n    - [Specific Metrics](#specific-metrics)\n    - [TA-Lib Metrics](#ta-lib-metrics)\n  - [Providers](#providers)\n    - [Price Provider](#price-provider)\n      - [Provides List](#provides-list)\n      - [API](#api)\n    - [Financial Statement Provider](#financial-statement-provider)\n      - [Provides List](#provides-list-1)\n      - [API](#api-1)\n    - [Index Provider](#index-provider)\n      - [Provides List](#provides-list-2)\n      - [API](#api-2)\n- [Contribution Guide](#contribution-guide)\n  - [Test](#test)\n    - [Test all](#test-all)\n    - [Test specified test](#test-specified-test)\n  - [Development](#development)\n    - [Generate Requirements](#generate-requirements)\n    - [Package Update](#package-update)\n\n\n\n\n# Quick Start\n\n## Installation\n\n```shell\npip install --upgrade autoquant\n```\n\n\n## Data Preparation \n\n```python\nfrom autoquant.collector import Collector\nfrom autoquant import Market\nfrom datetime import date\n\ncollector = Collector.default()\n\ndata = collector.daily_prices(\n    market=Market.SZ, \n    code='002594', \n    start=date(2021, 11, 1), \n    end=date(2021, 11, 5)\n)\n\ndata = collector.quarter_statement(\n    market=Market.SH, \n    code='601318', \n    quarter=date(2021, 9, 30)\n)\n    \n```\n\n## Backtest\n\n```python\n\n\nfrom autoquant.collector import Collector\nfrom autoquant.workflow import Workflow\nfrom autoquant.broker import Broker\nfrom autoquant import Market\nfrom datetime import date\n\nfrom autoquant.workflow import Workflow\nfrom autoquant.strategy import MA_CrossOver\n\n\nclass SmaCross(MA_CrossOver):\n    params = dict(fast=5, slow=20)\n\n\ncollector = Collector.default()\nbroker = Broker.default(kick_start=100000, commission=0.01)\n\ndata = collector.daily_prices(market=Market.SZ, code='002594', start=date(2020, 1, 1), end=date(2021, 11, 1))\nw = Workflow().with_broker(broker).with_strategy(SmaCross).backtest(data)\n\nw.visualize()\n```\n\n# Advanced Topics\n\n## Market\nAutoQuant support Shanghai, Shenzhen, HongKong and US markets now.\nUse Market Enum in codes:\n\n```python\nfrom autoquant import Market\n\nMarket.SZ\nMarket.SH\nMarket.HK\nMarket.CN\nMarket.US\n```\n\n## Index\nAutoQuant support the indexes in multiple markets now.\n\nUse StocksIndex Enum in codes:\n```python\nfrom autoquant import StocksIndex\n\nStocksIndex.ZZ500\nStocksIndex.HS300\nStocksIndex.SZ50\n```\n\nUse FundsIndex Enum in codes:\n\n```python\nfrom autoquant import FundsIndex\n\nFundsIndex.CN_ALL\nFundsIndex.CN_ETF\nFundsIndex.CN_QDII\nFundsIndex.HUAXIA_SECTOR_ETF\n```\n\n## Indicators\n\n### Specific Indicators\n- ParityIndex\n- AdjustedMomentum\n\n### Backtrader Indicators\nAll the indicators in Backtrader are available in AutoQuant.\n\nFor Example, if you were using the indicators of Backtrader like this:\n\n```python\nfrom backtrader.indicators import Momentum\n```\n\nYou can simply change the import sentence to use the indicators in AutoQuant. The codes would be:\n\n```python\nfrom autoquant.indicators import Momentum\n```\n\n\n## Metrics\n\n### Specific Metrics\n\n- Gross Rate Of Return\n- CAGR(Compound Annual Growth Rate) \n\n\n### TA-Lib Metrics\nAll the metrics in TA-Lib are available in AutoQuant.\n\nFor Example, if you were using the metrics of TA-Lib like this:\n\n```python\nfrom talib import SMA\n\nclose = numpy.random.random(100)\noutput = MOM(close, timeperiod=5)\n```\n\nYou can simply change the import sentence to use the metrics in AutoQuant. The codes would be:\n\n```python\nfrom AutoQuant import SMA\n\nclose = numpy.random.random(100)\noutput = MOM(close, timeperiod=5)\n```\n\n\n## Providers\n### Price Provider\n\n#### Provides List\n\n- BaostockProvider\n- TushareProvider\n- EastmoneyProvider\n\n#### API\n```python\ndef daily_prices(self, market: Market, code: str, start: date, end: date, **kwargs)\n\n```\n\n\n### Financial Statement Provider\n\n\n#### Provides List\n- SnowballProvider\n\n\n#### API\n\n```python\ndef quarter_statement(self, market: Market, code: str, quarter: date, **kwargs)\n\ndef yearly_balance_sheet(self, market: Market, code: str,  years: list, **kwargs)\n\ndef yearly_income_sheets(self, market: Market, code: str, years: list, **kwargs)\n\ndef yearly_flow_sheets(self, market: Market, code: str, years: list, **kwargs)\n\n```\n\n### Index Provider\n\n\n#### Provides List\n- BaostockProvider\n- EastmoneyProvider\n\n\n#### API\n\n```python\ndef stocks_of_index(self, index: StocksIndex, **kwargs)\n\ndef funds_of_index(self, index: FundsIndex, **kwargs)\n```\n\n# Contribution Guide\n\n## Test\n### Test all\n```shell\nPYTHONPATH=./ pytest\n```\n\n### Test specified test\n```shell\nPYTHONPATH=./ pytest tests/\u003cYOUR_DISIRE_FILE\u003e.py -k \"\u003cYOUR_DISIRE_TEST_CASE\u003e\" -s\n```\n\n\n## Development\n\n### Generate Requirements\n\n```shell\npipreqs ./ --encoding=utf8 --force\n```\n### Package Update\n\n```shell\npython3 -m build \npython3 -m twine upload dist/*\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarcnuth%2Fautoquant","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmarcnuth%2Fautoquant","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarcnuth%2Fautoquant/lists"}