Top Related Projects
Lean Algorithmic Trading Engine by QuantConnect (Python, C#)
Qlib is an AI-oriented Quant investment platform that aims to use AI tech to empower Quant Research, from exploring ideas to implementing productions. Qlib supports diverse ML modeling paradigms, including supervised learning, market dynamics modeling, and RL, and is now equipped with https://github.com/microsoft/RD-Agent to automate R&D process.
An Algorithmic Trading Library for Crypto-Assets in Python
Portfolio analytics for quants, written in Python
🔎 📈 🐍 💰 Backtest trading strategies in Python.
Quick Overview
QUANTAXIS is an open-source quantitative trading and investment research platform developed in Python. It provides a comprehensive set of tools for financial data acquisition, processing, analysis, and strategy backtesting, aimed at both individual investors and institutional traders.
Pros
- Comprehensive ecosystem with modules for data fetching, analysis, backtesting, and live trading
- Supports multiple asset classes including stocks, futures, and cryptocurrencies
- Integrates with various data sources and exchanges
- Active community and regular updates
Cons
- Steep learning curve for beginners due to its extensive features
- Documentation is primarily in Chinese, which may be challenging for non-Chinese speakers
- Some users report occasional stability issues with certain modules
- Performance can be slow for large-scale backtests without optimization
Code Examples
- Fetching stock data:
from QUANTAXIS import QA_fetch_stock_day_adv
data = QA_fetch_stock_day_adv('000001', '2020-01-01', '2021-01-01')
print(data.data)
- Creating a simple moving average strategy:
from QUANTAXIS import QA_Strategy
class MAStrategy(QA_Strategy):
def on_bar(self, data):
if data.close > data.close.rolling(20).mean():
self.buy(data.code, 100)
elif data.close < data.close.rolling(20).mean():
self.sell(data.code, 100)
strategy = MAStrategy(start='2020-01-01', end='2021-01-01', code='000001')
strategy.run()
- Backtesting a strategy:
from QUANTAXIS import QA_Backtest
backtest = QA_Backtest(strategy=MAStrategy, start='2020-01-01', end='2021-01-01', code_list=['000001', '600000'])
result = backtest.run()
backtest.analyze()
Getting Started
- Install QUANTAXIS:
pip install quantaxis
- Initialize the QUANTAXIS environment:
import QUANTAXIS as QA
QA.QA_util_log_info('Welcome to QUANTAXIS')
- Fetch and analyze data:
stock_data = QA.QA_fetch_stock_day_adv('000001', '2020-01-01', '2021-01-01')
print(stock_data.data.head())
- Run a simple backtest:
from QUANTAXIS.QAARP.QAStrategy import QA_Strategy
class SimpleStrategy(QA_Strategy):
def on_bar(self, data):
self.buy(data.code, 100)
backtest = QA.QA_Backtest(strategy=SimpleStrategy, start='2020-01-01', end='2021-01-01', code_list=['000001'])
result = backtest.run()
backtest.analyze()
Competitor Comparisons
Lean Algorithmic Trading Engine by QuantConnect (Python, C#)
Pros of Lean
- More extensive documentation and community support
- Broader range of supported asset classes and data sources
- Better integration with cloud platforms and live trading systems
Cons of Lean
- Steeper learning curve for beginners
- Requires more computational resources
- Less focus on Chinese markets compared to QUANTAXIS
Code Comparison
QUANTAXIS example:
import QUANTAXIS as QA
data = QA.QA_fetch_stock_day_adv('000001', '2019-01-01', '2019-12-31')
QA.QA_SU_save_stock_day('tdx')
Lean example:
public class MyAlgorithm : QCAlgorithm
{
public override void Initialize()
{
SetStartDate(2019, 1, 1);
SetEndDate(2019, 12, 31);
AddEquity("SPY", Resolution.Daily);
}
}
QUANTAXIS focuses on simplicity and ease of use for Chinese markets, while Lean offers a more comprehensive and flexible framework for algorithmic trading across various markets. QUANTAXIS provides straightforward data fetching and saving functions, whereas Lean requires a more structured approach with algorithm initialization and asset addition.
Qlib is an AI-oriented Quant investment platform that aims to use AI tech to empower Quant Research, from exploring ideas to implementing productions. Qlib supports diverse ML modeling paradigms, including supervised learning, market dynamics modeling, and RL, and is now equipped with https://github.com/microsoft/RD-Agent to automate R&D process.
Pros of Qlib
- More extensive documentation and examples
- Stronger focus on machine learning and AI-driven quantitative investment
- Backed by Microsoft, potentially leading to better long-term support and development
Cons of Qlib
- Steeper learning curve for beginners in quantitative finance
- Less comprehensive in terms of traditional financial analysis tools
- Primarily focused on the Chinese stock market, which may limit its applicability for global investors
Code Comparison
QUANTAXIS:
import QUANTAXIS as QA
data = QA.QA_fetch_stock_day_adv('000001', '2017-01-01', '2017-12-31')
QA.QA_SU_save_stock_day('tdx')
Qlib:
from qlib.data import D
from qlib.config import REG_CN
D.calendar(start_time='2010-01-01', end_time='2017-12-31', freq='day')
D.features(["SH600000"], ["$close", "$volume"], start_time='2010-01-01', end_time='2017-12-31')
Both repositories offer powerful tools for quantitative finance, but they cater to slightly different audiences. QUANTAXIS provides a more comprehensive suite of traditional financial analysis tools, while Qlib focuses on leveraging machine learning for quantitative investment strategies. The choice between the two depends on the user's specific needs and level of expertise in both finance and machine learning.
An Algorithmic Trading Library for Crypto-Assets in Python
Pros of Catalyst
- Focuses on cryptocurrency trading and backtesting
- Provides integration with popular exchanges like Binance and Coinbase
- Offers a more specialized toolset for crypto-specific strategies
Cons of Catalyst
- Limited to cryptocurrency markets, less versatile for traditional assets
- Smaller community and fewer resources compared to QUANTAXIS
- Less frequent updates and maintenance
Code Comparison
QUANTAXIS:
from QUANTAXIS import QA_Backtest
backtest = QA_Backtest()
backtest.strategy = myStrategy
backtest.run()
Catalyst:
from catalyst import run_algorithm
run_algorithm(
capital_base=10000,
data_frequency='daily',
initialize=initialize,
handle_data=handle_data,
exchange_name='poloniex'
)
Both repositories provide quantitative trading frameworks, but they cater to different markets and use cases. QUANTAXIS offers a more comprehensive solution for Chinese markets and traditional assets, while Catalyst specializes in cryptocurrency trading. QUANTAXIS has a larger community and more frequent updates, making it potentially more suitable for general quantitative trading needs. Catalyst, on the other hand, provides a more focused approach for crypto enthusiasts and traders looking to implement strategies specifically for digital assets.
Portfolio analytics for quants, written in Python
Pros of QuantStats
- Focused on performance analytics and risk metrics
- Generates detailed HTML reports for portfolio analysis
- Lightweight and easy to integrate into existing Python projects
Cons of QuantStats
- Limited to post-trade analysis and reporting
- Lacks real-time data fetching and trading capabilities
- Smaller community and fewer contributors compared to QUANTAXIS
Code Comparison
QuantStats:
import quantstats as qs
# Extend pandas functionality with metrics
qs.extend_pandas()
# Generate tearsheet
qs.reports.html(returns, output='tearsheet.html')
QUANTAXIS:
import QUANTAXIS as QA
# Fetch stock data
data = QA.QA_fetch_stock_day_adv('000001', '2019-01-01', '2020-01-01')
# Perform backtest
backtest = QA.QA_Backtest(strategy=MyStrategy, benchmark_code='000300')
backtest.run()
Summary
QuantStats excels in performance analysis and reporting, making it ideal for portfolio managers and analysts. QUANTAXIS offers a more comprehensive suite of tools for quantitative trading, including data fetching, backtesting, and real-time trading capabilities. QuantStats is more accessible for beginners and those focused on post-trade analysis, while QUANTAXIS caters to more advanced users requiring a full-stack quantitative trading platform.
🔎 📈 🐍 💰 Backtest trading strategies in Python.
Pros of backtesting.py
- Lightweight and easy to use, with a focus on simplicity
- Fast execution due to optimized Cython implementation
- Extensive documentation and examples for quick start
Cons of backtesting.py
- Limited to backtesting only, lacks real-time trading capabilities
- Fewer built-in indicators and analysis tools compared to QUANTAXIS
- Less comprehensive ecosystem and community support
Code Comparison
QUANTAXIS:
import QUANTAXIS as QA
data = QA.QA_fetch_stock_day_adv('000001', '2010-01-01', '2019-01-01')
QA.QA_Risk_analysis(data)
backtesting.py:
from backtesting import Backtest, Strategy
from backtesting.lib import crossover
class SmaCross(Strategy):
def init(self):
self.sma1 = self.I(SMA, self.data.Close, 10)
self.sma2 = self.I(SMA, self.data.Close, 20)
def next(self):
if crossover(self.sma1, self.sma2):
self.buy()
elif crossover(self.sma2, self.sma1):
self.sell()
Summary
QUANTAXIS offers a more comprehensive suite of tools for quantitative analysis and trading, including real-time capabilities and a broader ecosystem. backtesting.py, on the other hand, provides a lightweight and fast solution specifically for backtesting trading strategies, with a focus on simplicity and ease of use. The choice between the two depends on the specific needs of the project and the user's preference for either a more comprehensive toolkit or a specialized backtesting solution.
Convert
designs to code with AI
Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.
Try Visual CopilotREADME
QUANTAXIS 2.1.0-alpha2
â 妿è¿ä¸ªé¡¹ç®å¯¹æ¨æå¸®å©ï¼è¯·ç¹å»Staræ¯ææä»¬ï¼
ð Forkæ¬é¡¹ç®å¼å§æ¨çéå交æä¹æ ï¼
Made with â¤ï¸ by @yutiansut and contributors
© 2016-2025 QUANTAXIS. Released under the MIT License.
ð å ¨æ°å级: Python 3.9+ãQARS2 Rustæ ¸å¿éæã100xæ§è½æå
ææ°çæ¬: v2.1.0-alpha2 | Python: 3.9-3.12 | æ´æ°æ¥æ: 2025-10-25
ð æ°ç¹æ§ (v2.1.0)
â¡ QARS2 Rustæ ¸å¿éæ - æ§è½é£è·
- 100xè´¦æ·æä½å é: å建账æ·ä»50mséè³0.5ms
- 10xåæµé度æå: 10å¹´æ¥çº¿åæµä»30ç§éè³3ç§
- 90%å åä¼å: å¤§è§æ¨¡æä»å åå ç¨éä½90%
- æ ç¼éæ: å®å ¨å ¼å®¹QIFIåè®®ï¼èªå¨åéPythonå®ç°
ð§ Python 3.9-3.12 ç°ä»£å
- ä¾èµå级: 60+æ ¸å¿ä¾èµç°ä»£å (pymongo 4.10+, pandas 2.0+, pyarrow 15.0+)
- æ§è½ä¼å: å©ç¨Python 3.11+çæ§è½æå
- ç±»åå®å ¨: æ´å¥½çç±»åæç¤ºæ¯æ
ð¦ QARSBridge - Rustæ¡¥æ¥å±
from QUANTAXIS.QARSBridge import QARSAccount, has_qars_support
# èªå¨æ£æµå¹¶ä½¿ç¨Rust髿§è½çæ¬
if has_qars_support():
print("⨠使ç¨QARS2 Rustçæ¬ (100xæ§è½)")
account = QARSAccount("my_account", init_cash=1000000)
# APIå®å
¨å
¼å®¹ï¼æ éä¿®æ¹ä»£ç
account.buy("000001", 10.5, "2025-01-15", 1000)
ð ç¸å ³é¡¹ç®çæ
æ ¸å¿é¡¹ç®
- ð¦ QARS2 - QUANTAXIS Rustæ ¸å¿ (髿§è½è´¦æ·ã念弿)
- â¡ QADataSwap - è·¨è¯è¨é¶æ·è´éä¿¡ (Python/Rust/C++)
- ðï¸ QAEXCHANGE-RS - Rustäº¤ææ + HTAPæ··åæ°æ®åº
æ©å±å®ç°
- ð QAUltra-cpp - QUANTAXIS C++å®ç°
- ð¥ QAUltra-rs - QUANTAXIS Rustå®ç° (é¨å弿º)
[ç¹å»å³ä¸è§StaråWatchæ¥è·è¸ªé¡¹ç®è¿å±! ç¹å»Forkæ¥å建å±äºä½ çQUANTAXIS!]

ð èç³»æ¹å¼
- 项ç®ä¸»é¡µ: https://github.com/yutiansut/QUANTAXIS
- ä½è : yutiansut
- Email: yutiansut@qq.com
- å¾®ä¿¡å ¬ä¼å·: QAPRO
- 微信: quantitativeanalysis
æ´å¤ææ¡£å¨QABook Release
Quantitative Financial FrameWork
ð æ ¸å¿æ¨¡å
1. ð¦ QARSBridge - Rustæ¡¥æ¥å± (v2.1æ°å¢)
QARS2 Rustæ ¸å¿çPythonå è£ å¨ï¼æä¾100xæ§è½æå
-
QARSAccount: 髿§è½QIFIè´¦æ·ç³»ç»
- è¡ç¥¨äº¤æ:
buy(),sell() - æè´§äº¤æ:
buy_open(),sell_open(),buy_close(),sell_close() - è´¦æ·æ¥è¯¢:
get_qifi(),get_positions(),get_account_info() - å®å ¨å ¼å®¹QIFIåè®®ï¼è·¨è¯è¨ä¸è´æ§ (Python/Rust/C++)
- è¡ç¥¨äº¤æ:
-
QARSBacktest: Rust念弿
- 10xåæµé度æå
- æ¯æèªå®ä¹çç¥ (
QARSStrategyåºç±») - å åå ç¨éä½90%
-
èªå¨åéæºå¶: QARS2æªå®è£ æ¶èªå¨ä½¿ç¨çº¯Pythonå®ç°
# 宿´ç¤ºä¾
from QUANTAXIS.QARSBridge import QARSAccount
account = QARSAccount("test", init_cash=1000000)
account.buy("000001", 10.5, "2025-01-15", 1000) # è¡ç¥¨ä¹°å
¥
account.buy_open("IF2512", 4500.0, "2025-01-15", 2) # æè´§å¼ä»
positions = account.get_positions() # æ¥è¯¢æä»
ð è¯¦ç»ææ¡£: QARSBridge README
2. ð QADataBridge - é¶æ·è´æ°æ®äº¤æ¢ (v2.1æ°å¢)
åºäºQADataSwapçè·¨è¯è¨é¶æ·è´æ°æ®ä¼ è¾ï¼5-10xæ§è½æå
-
é¶æ·è´è½¬æ¢:
- Pandas â Polars (2.5xå é)
- Pandas â Arrow (é¶æ·è´)
- Polars â Arrow (é¶æ·è´)
- æ¹éè½¬æ¢æ¯æ
-
å ±äº«å åéä¿¡:
- è·¨è¿ç¨æ°æ®ä¼ è¾ (7xå é)
- 宿¶è¡æ åå
- çç¥é´æ°æ®å ±äº«
-
èªå¨åéæºå¶: QADataSwapæªå®è£ æ¶èªå¨ä½¿ç¨æ å转æ¢
# é¶æ·è´è½¬æ¢ç¤ºä¾
from QUANTAXIS.QADataBridge import convert_pandas_to_polars
import pandas as pd
df_pandas = pd.DataFrame({'price': [10.5, 20.3], 'volume': [1000, 2000]})
df_polars = convert_pandas_to_polars(df_pandas) # é¶æ·è´ï¼2.5xå é
# å
±äº«å
å示ä¾
from QUANTAXIS.QADataBridge import SharedMemoryWriter, SharedMemoryReader
# è¿ç¨Aï¼åå
¥æ°æ®
writer = SharedMemoryWriter("market_data", size_mb=50)
writer.write(df_polars)
# è¿ç¨Bï¼è¯»åæ°æ®
reader = SharedMemoryReader("market_data")
df = reader.read(timeout_ms=5000) # é¶æ·è´ï¼7xå é
ð è¯¦ç»ææ¡£: QADataBridge README
3. ð¾ QASU / QAFetch - å¤å¸åºæ°æ®
- æ¯æMongoDB / ClickHouseåå¨
- èªå¨è¿ç»´åæ°æ®æ´æ°
- Tick / L2 Order / Transactionæ°æ®æ ¼å¼
- å ååæ°æ®ç»æ
4. ð QAUtil - å·¥å ·å½æ°
- äº¤ææ¶é´ãäº¤ææ¥å
- æ¶é´ååå忍ç®
- å¸åºè¯å«ãDataFrame转æ¢
5. ð¼ QIFI / QAMarket - ç»ä¸è´¦æ·ä½ç³»
å¤å¸åºãå¤è¯è¨ç»ä¸è´¦æ·åè®®
- qifiaccount: æ åQIFIè´¦æ·ï¼ä¸Rust/C++çæ¬ä¿æ100%ä¸è´
- qifimanager: å¤è´¦æ·ç®¡çç³»ç»
- qaposition: åæ çç²¾åä»ä½ç®¡ç (å¥å©/CTA/è¡ç¥¨)
- marketpreset: å¸åºé¢å¶åºç±» (tick大å°/ä¿è¯é/æç»è´¹)
QIFIåè®®ç¹ç¹:
- è·¨è¯è¨å ¼å®¹ (Python/Rust/C++)
- 宿´è´¦æ·ç¶æ (è´¦æ·/æä»/订å/æäº¤)
- å¢éæ´æ°æ¯æ (Diffæºå¶)
- MongoDBå好
6. ð QAFactor - å åç ç©¶
- åå åç ç©¶å ¥åº
- å å管çãæµè¯
- å ååå¹¶
- ä¼åå¨ [å¼åä¸]
7. ð QAData - å åæ°æ®åº
夿 çå¤å¸åºæ°æ®ç»æï¼æ¯æï¼
- 宿¶è®¡ç®
- 念弿
- 髿§è½æ°æ®è®¿é®
8. ð QAIndicator - èªå®ä¹ææ
- æ¯æèªå®ä¹ææ ç¼å
- æ¹éå ¨å¸åºapply
- å åè¡¨è¾¾å¼æå»º
9. âï¸ QAEngine - 弿¥è®¡ç®
- èªå®ä¹çº¿ç¨/è¿ç¨åºç±»
- 弿¥è®¡ç®æ¯æ
- å±åç½åå¸å¼è®¡ç®agent
10. ð® QAPubSub - æ¶æ¯éå
åºäºRabbitMQçæ¶æ¯ç³»ç»ï¼
- 1-1 / 1-n / n-n æ¶æ¯åå
- 计ç®ä»»å¡ååæ¶é
- 宿¶è®¢åæµ
11. ð¯ QAStrategy - åæµå¥ä»¶
- CTAçç¥åæµ
- å¥å©çç¥åæµ
- 宿´QIFIæ¨¡å¼æ¯æ
12. ð QAWebServer - å¾®æå¡
- Tornado Webæå¡å¨
- ä¸å°å¾®æå¡æå»º
- RESTful API
13. ð QASchedule - ä»»å¡è°åº¦
- åå°ä»»å¡è°åº¦
- èªå¨è¿ç»´
- è¿ç¨ä»»å¡è°åº¦
ð çæ¬æ´æ°è¯´æ
v2.1.0 (2025-10-25) - é大æ§è½å级
ð æ ¸å¿å级
1. QARS2 Rustæ ¸å¿éæ
- â QARSBridgeæ¡¥æ¥å± - 100xæ§è½æå
- â å®å ¨å ¼å®¹QIFIåè®®
- â èªå¨fallbackå°Pythonå®ç°
- â è´¦æ·æä½: 50ms â 0.5ms
- â åæµé度: 30s â 3s (10å¹´æ¥çº¿)
- â å åä¼å: -90%
2. Pythonç°ä»£å
- â Pythonçæ¬: 3.5-3.10 â 3.9-3.12
- â
ä¾èµå级: 60+æ ¸å¿ä¾èµç°ä»£å
- pymongo: 3.11.2 â 4.10.0+
- pandas: 1.1.5 â 2.0.0+
- pyarrow: 6.0.1 â 15.0.0+
- tornado: 6.3.2 â 6.4.0+
- â ç§»é¤è¿æ¶ä¾èµ: delegator.py, six, pyconvert
3. æ°å¢æ¨¡å
- â
QARSBridge/: QARS2æ¡¥æ¥å±qars_account.py: 髿§è½è´¦æ·å è£ å¨qars_backtest.py: Rust念弿QIFI_PROTOCOL.md: 宿´åè®®è§è
- â
examples/qarsbridge_example.py: 宿´ä½¿ç¨ç¤ºä¾
4. å®è£ æ¹å¼ä¼å
# åºç¡å®è£
pip install -e .
# å
å«Rustç»ä»¶ (æ¨è)
pip install -e .[rust]
# å
嫿§è½ä¼åå
pip install -e .[performance]
# 宿´å®è£
pip install -e .[full]
ð åçº§ææ¡£
- â UPGRADE_PLAN.md - 宿´å级计å
- â PHASE1_COMPLETE.md - Phase 1宿æ¥å
- â PHASE2_COMPLETE.md - Phase 2宿æ¥å
- â QIFI_PROTOCOL.md - QIFIåè®®è§è
v2.0.0 - æ¶æéæ
æ¬çæ¬ä¸ºä¸å ¼å®¹åçº§ï¼æ¶åéå¤§æ¶ææ¹åï¼
æ°æ®å±æ¹è¿
- â ClickHouse客æ·ç«¯éæ
- â Tabularæ°æ®æ¯æ
- â å ååæ°æ®ç»æ
- â Tick / L2 Order / Transactionæ ¼å¼
å¾®æå¡æ¶æ
- â QAWebServer - Tornado Webæå¡
- â QASchedule - 卿任å¡è°åº¦
- â DAG Pipeline模å
- â QAPubSub - RabbitMQæ¶æ¯éå
è´¦æ·ç³»ç»å级
- â ï¸ ç§»é¤QAARP (ä¸åç»´æ¤èçæ¬)
- â
宿´QIFI模å
- ä¿è¯é模å
- è¡ç¥¨/æè´§æ¯æ
- ææ [å¼åä¸]
å®ç/模æç
- â QIFIç»æå¯¹æ¥
- â CTPæ¥å£ (æè´§/ææ)
- â QMTå¯¹æ¥ (è¡ç¥¨)
- â æ¯åè´¦æ·OMS
- â OrderGateway飿§
å¤è¯è¨éæ
- â QUANTAXIS Rustçæ¬éä¿¡
- â
Apache Arrowè·¨è¯è¨æ°æ®äº¤æ¢
- pyarrow (Python)
- arrow-rs (Rust)
- libarrow (C++)
- â Rust/C++è´¦æ·æ¯æ
- â Rust Job Worker
ð å¿«éå¼å§
ç³»ç»è¦æ±
- Python: 3.9 - 3.12 (æ¨è3.11+)
- æä½ç³»ç»: Linux / macOS / Windows
- å å: æä½4GBï¼æ¨è8GB+
- æ°æ®åº: MongoDB 4.0+ / ClickHouse 20.0+ (å¯é)
å®è£
1. åºç¡å®è£
# å
éä»åº
git clone https://github.com/QUANTAXIS/QUANTAXIS.git
cd QUANTAXIS
# å®è£
ä¾èµ
pip install -e .
2. å å«Rustç»ä»¶ (æ¨è - 100xæ§è½)
# å®è£
QUANTAXIS + QARS2
pip install -e .[rust]
# ææå¨å®è£
QARS2
cd /home/quantaxis/qars2
pip install -e .
3. 宿´å®è£
# å®è£
ææç»ä»¶
pip install -e .[full]
# å
å«:
# - QARS2 Rustæ ¸å¿
# - QADataSwapè·¨è¯è¨éä¿¡
# - Polars髿§è½DataFrame
# - ææå¯éä¾èµ
4. éªè¯å®è£
import QUANTAXIS as QA
from QUANTAXIS.QARSBridge import has_qars_support
print(f"QUANTAXISçæ¬: {QA.__version__}")
print(f"QARS2æ¯æ: {has_qars_support()}")
# 颿è¾åº:
# QUANTAXISçæ¬: 2.1.0.alpha2
# QARS2æ¯æ: True
å¿«é示ä¾
from QUANTAXIS.QARSBridge import QARSAccount
# åå»ºé«æ§è½è´¦æ· (èªå¨ä½¿ç¨Rustæ ¸å¿)
account = QARSAccount(
account_cookie="my_strategy",
init_cash=1000000.0
)
# è¡ç¥¨äº¤æ
account.buy("000001", 10.5, "2025-01-15", 1000)
account.sell("000001", 10.8, "2025-01-16", 500)
# æè´§äº¤æ
account.buy_open("IF2512", 4500.0, "2025-01-15", 2)
account.sell_close("IF2512", 4520.0, "2025-01-16", 1)
# æ¥è¯¢æä»
positions = account.get_positions()
print(positions)
# è·åQIFIæ ¼å¼è´¦æ·æ°æ®
qifi = account.get_qifi()
print(f"è´¦æ·æç: {qifi['accounts']['balance']}")
print(f"å¯ç¨èµé: {qifi['accounts']['available']}")
æ°æ®åºé ç½®
# MongoDBé
ç½®
import QUANTAXIS as QA
# 设置MongoDBè¿æ¥
QA.DATABASE = QA.QAUtil.QALogs.QA_Setting.MONGO_URI
# é»è®¤: mongodb://localhost:27017/quantaxis
# ClickHouseé
ç½®
QA.CLICKHOUSE_HOST = 'localhost'
QA.CLICKHOUSE_PORT = 9000
ð ææ¡£
ð ææ¡£ä¸å¿
宿´ææ¡£è¯·è®¿é® ææ¡£ä¸å¿ (Documentation Hub)
å¿«é导èª
ð å ¥é¨æå
- å¿«éå¼å§ - 10åé䏿æç¨
- å®è£ æå - 详ç»å®è£ æ¥éª¤
ð APIåè
- APIæ¦è§ - 宿´APIææ¡£
- QAFetch - æ°æ®è·å
- QAData - æ°æ®ç»æ
- QAMarket/QIFI - è´¦æ·ä½ç³»
ð§ é«çº§åè½
- èµæºç®¡çå¨ - ç»ä¸èµæºç®¡ç
- Rustéæ - 髿§è½ç»ä»¶
- æ°æ®æ¡¥æ¥ - é¶æ·è´æ°æ®äº¤æ¢
ð³ é¨ç½²æå
- Dockeré¨ç½² - 容å¨åé¨ç½²
- Kubernetesé¨ç½² - K8sé群é¨ç½²
- é¨ç½²æ¦è§ - 宿´é¨ç½²æå
ð¦ è¿ç§»æå
- 2.0 â 2.1 è¿ç§» - å级æ¥éª¤å注æäºé¡¹
- å ¼å®¹æ§ç¶æ - 100%ååå ¼å®¹
ð¨âð» å¼åè
- è´¡ç®æå - å¦ä½åä¸å¼å
- æä½³å®è·µ - ç产ç¯å¢å»ºè®®
- å¼åæå (CLAUDE.md) - AIè¾ å©å¼å
ð å ¶ä»èµæº
- 宿´æå (QABook PDF)
- 示ä¾ä»£ç - 宿´ç¤ºä¾éå
ð¤ 社åºä¸æ¯æ
GitHub
QUANTAXIS æ¯ä¸ä¸ªå¼æ¾ç项ç®, å¨å¼æºç3年䏿大éçå°ä¼ä¼´å å ¥äºæ, å¹¶æäº¤äºç¸å ³ç代ç , æè°¢ä»¥ä¸çåå¦ä»¬
é®é¢åé¦:
- ð¬ GitHub Issues - æäº¤Bugååè½è¯·æ±
- ð GitHub Discussions - ææ¯è®¨è®º
社群
QQ群
- ð¬ QUANTAXIS交æµç¾¤: 563280067 ç¾¤é¾æ¥
- ð¨âð» QUANTAXISå¼å群: 773602202 (è´¡ç®ä»£ç è¯·å æ¤ç¾¤ï¼é夿³¨GitHub ID)
- ð¥ æè´§å®çé¨ç½²ç¾¤: 945822690 (ä» éæ¬å°å¤è´¦æ·é¨ç½²ç¨æ·)
Discord
论å
- ð QUANTAXIS CLUB论å
- 论åæé®äº«ææé«åå¤ä¼å 级
å ¬ä¼å·
- ð± å
³æ³¨å
¬ä¼å·è·åææ°å¨æåå
è´¹ä¸åæ¨éæ¥å£
- åå¤
tradeè·åä¸åæ¥å£
- åå¤
ð æ§è½å¯¹æ¯
QARS2 Rust vs Python
| æä½ | Pythonçæ¬ | QARS2 Rust | å 鿝 |
|---|---|---|---|
| å建1000ä¸ªè´¦æ· | ~50ç§ | ~0.5ç§ | 100x â¡ |
| åé10000个订å | ~50ç§ | ~0.5ç§ | 100x â¡ |
| è´¦æ·ç»ç® | ~200ms | ~2ms | 100x â¡ |
| 10å¹´æ¥çº¿åæµ | ~30ç§ | ~3ç§ | 10x ð |
| å åå ç¨(åè´¦æ·) | ~2MB | ~200KB | -90% ð¾ |
| å åå ç¨(1000æä») | ~50MB | ~5MB | -90% ð¾ |
Pythonçæ¬æ§è½
| Pythonçæ¬ | æ§è½æå | æ¨è度 |
|---|---|---|
| Python 3.9 | åºå | âââ |
| Python 3.10 | +10% | ââââ |
| Python 3.11 | +25% | âââââ æä½³ |
| Python 3.12 | +20% | âââââ ææ° |
ð° é¡¹ç®æ¯æ
æèµ
å代ç 䏿...请ä½è 忝åå¡å? â

注: æ¯ä»æ¶è¯·å¤æ³¨æ¨çåå/æµç§°ï¼æä»¬ä¼ç»´æ¤ä¸ä¸ªèµå©å表æè°¢æ¨çæ¯æï¼
ä¼ä¸èµå©
å¦éä¼ä¸çº§æ¯æãå®å¶å¼åæææ¯å¨è¯¢ï¼è¯·èç³»:
- ð§ Email: yutiansut@qq.com
- ð¼ ä¼ä¸æå¡: æä¾å®å¶åéå交æè§£å³æ¹æ¡
ð 许å¯è¯
æ¬é¡¹ç®éç¨ MIT License 弿ºè®¸å¯è¯ã
Copyright (c) 2016-2025 yutiansut/QUANTAXIS
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction...
宿´è®¸å¯è¯è¯·æ¥ç LICENSE æä»¶ã
ð è´è°¢
æ ¸å¿è´¡ç®è
ç¹å«æè°¢ææä¸ºQUANTAXISååºè´¡ç®çå¼åè ï¼
ææ¯æ
QUANTAXISå¾ä»¥å®ç°ç¦»ä¸å¼ä»¥ä¸ä¼ç§ç弿ºé¡¹ç®:
- Pythonçæ: pandas, numpy, scipy, matplotlib
- æ°æ®åº: MongoDB, ClickHouse, Redis
- Webæ¡æ¶: Tornado, Flask
- æ¶æ¯éå: RabbitMQ (pika)
- Rustçæ: PyO3, Polars, Arrow
- éèæ°æ®: tushare, pytdx
ç¹å«é¸£è°¢
- QARS2项ç®ç»: æä¾é«æ§è½Rustæ ¸å¿
- 社åºè´¡ç®è : æææäº¤PRåIssueçæå们
- æ©æç¨æ·: å¨é¡¹ç®åæå°±ç»äºæ¯æååé¦çç¨æ·
ðºï¸ 路线å¾
v2.1.x (å½å)
- â QARS2 Rustæ ¸å¿éæ
- â Python 3.9-3.12æ¯æ
- â QARSBridgeæ¡¥æ¥å±
- ð QADataSwapè·¨è¯è¨éä¿¡ (è¿è¡ä¸)
- ð å®åææ¡£å示ä¾
v2.2.0 (计åä¸)
- ð 宿´çQADataSwapéæ
- ð¥ Polarså ¨é¢æ¿ä»£pandas (å¯é)
- â¡ æ´å¤Rustå 鿍¡å
- 𧪠å¢å¼ºç念弿
v3.0.0 (æªæ¥)
- ð¤ AI驱å¨ççç¥ä¼å
- ð åå¸å¼åæµç³»ç»
- ð± ç§»å¨ç«¯æ¯æ
- âï¸ äºåçé¨ç½²
Top Related Projects
Lean Algorithmic Trading Engine by QuantConnect (Python, C#)
Qlib is an AI-oriented Quant investment platform that aims to use AI tech to empower Quant Research, from exploring ideas to implementing productions. Qlib supports diverse ML modeling paradigms, including supervised learning, market dynamics modeling, and RL, and is now equipped with https://github.com/microsoft/RD-Agent to automate R&D process.
An Algorithmic Trading Library for Crypto-Assets in Python
Portfolio analytics for quants, written in Python
🔎 📈 🐍 💰 Backtest trading strategies in Python.
Convert
designs to code with AI
Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.
Try Visual Copilot