AutoQuant is an out-of-the-box quantitative investment platform.
It contains the full ML pipeline of data processing, strategy building(includes AI & traditionals), back-testing, and covers the entire chain of quantitative investment: alpha seeking, risk modeling, portfolio optimization, and order execution.
With AutoQuant, users can easily try ideas to create better Quant investment strategies.
pip install --upgrade autoquantfromautoquant.collectorimportCollectorfromautoquantimportMarketfromdatetimeimportdatecollector=Collector.default()
data=collector.daily_prices(
market=Market.SZ, code='002594', start=date(2021, 11, 1), end=date(2021, 11, 5)
)
data=collector.quarter_statement(
market=Market.SH, code='601318', quarter=date(2021, 9, 30)
)
fromautoquant.collectorimportCollectorfromautoquant.workflowimportWorkflowfromautoquant.brokerimportBrokerfromautoquantimportMarketfromdatetimeimportdatefromautoquant.workflowimportWorkflowfromautoquant.strategyimportMA_CrossOverclassSmaCross(MA_CrossOver):
params=dict(fast=5, slow=20)
collector=Collector.default()
broker=Broker.default(kick_start=100000, commission=0.01)
data=collector.daily_prices(market=Market.SZ, code='002594', start=date(2020, 1, 1), end=date(2021, 11, 1))
w=Workflow().with_broker(broker).with_strategy(SmaCross).backtest(data)
w.visualize()AutoQuant support Shanghai, Shenzhen, HongKong and US markets now. Use Market Enum in codes:
fromautoquantimportMarketMarket.SZMarket.SHMarket.HKMarket.CNMarket.USAutoQuant support the indexes in multiple markets now.
Use StocksIndex Enum in codes:
fromautoquantimportStocksIndexStocksIndex.ZZ500StocksIndex.HS300StocksIndex.SZ50Use FundsIndex Enum in codes:
fromautoquantimportFundsIndexFundsIndex.CN_ALLFundsIndex.CN_ETFFundsIndex.CN_QDIIFundsIndex.HUAXIA_SECTOR_ETF- ParityIndex
- AdjustedMomentum
All the indicators in Backtrader are available in AutoQuant.
For Example, if you were using the indicators of Backtrader like this:
frombacktrader.indicatorsimportMomentumYou can simply change the import sentence to use the indicators in AutoQuant. The codes would be:
fromautoquant.indicatorsimportMomentum- Gross Rate Of Return
- CAGR(Compound Annual Growth Rate)
All the metrics in TA-Lib are available in AutoQuant.
For Example, if you were using the metrics of TA-Lib like this:
fromtalibimportSMAclose=numpy.random.random(100)
output=MOM(close, timeperiod=5)You can simply change the import sentence to use the metrics in AutoQuant. The codes would be:
fromAutoQuantimportSMAclose=numpy.random.random(100)
output=MOM(close, timeperiod=5)- BaostockProvider
- TushareProvider
- EastmoneyProvider
defdaily_prices(self, market: Market, code: str, start: date, end: date, **kwargs)- SnowballProvider
defquarter_statement(self, market: Market, code: str, quarter: date, **kwargs)
defyearly_balance_sheet(self, market: Market, code: str, years: list, **kwargs)
defyearly_income_sheets(self, market: Market, code: str, years: list, **kwargs)
defyearly_flow_sheets(self, market: Market, code: str, years: list, **kwargs)- BaostockProvider
- EastmoneyProvider
defstocks_of_index(self, index: StocksIndex, **kwargs)
deffunds_of_index(self, index: FundsIndex, **kwargs)PYTHONPATH=./ pytestPYTHONPATH=./ pytest tests/<YOUR_DISIRE_FILE>.py -k "<YOUR_DISIRE_TEST_CASE>" -spipreqs ./ --encoding=utf8 --forcepython3 -m build python3 -m twine upload dist/*