DeltaTrader is a minimalist, user-friendly framework for algorithmic trading, designed to help individual investors optimize their trading systems.
It focuses on four core modules: retrieving market data (data
), creating trading strategies (strategy
), performing backtests with evaluation metrics (backtest
), and executing simulated live trades (trader
).
- 🎓 Tutorial: https://coding.imooc.com/class/494.html
- 📂 Source Code: https://github.com/Delta-F/DeltaTrader
Interested in refactoring or enhancing features? Let’s collaborate: leek_li@outlook.com
DeltaTrader is an open-source interface for quantitative trading. Automated trading has never been so easy.
With fewer than 10 lines of code, you can retrieve A-share stock data and execute automated strategies.
Clone the repository to get started:
git clone https://github.com/Delta-F/DeltaTrader.git
Retrieve stock price data with:
import data.stock as st
data = st.get_single_price(code='000001.XSHE',
time_freq='daily',
start_date='2021-01-01',
end_date='2021-02-01')
Export the data as a CSV file:
import data.stock as st
data = st.get_single_price(code='000001.XSHE')
st.export_data(data=data, filename='000001.XSHE', type='price')
- 📊 Market Data: Supports two sources (JQData API and web scraping)
- ⚙️ Strategy Models: Create strategies based on simple logic
- 🤖 Automated Trading: Supports simulated live trading
- deltaf: Framework architect and Python 3 maintainer
- ACE: Market data crawler for financial websites
(More contributors welcome!)
If you have any issues or suggestions, feel free to open a discussion on the Issues page.
DeltaTrader,致力于打造一个极简好用的程序化交易框架,便于个人投资者优化自己的交易系统。
主要包含 4 大核心模块:行情数据(data)、交易策略(strategy)、回测(backtest)、以及模拟实盘交易(trader)。
如果你对重构本项目或添加新功能有兴趣,欢迎联系我:leek_li@outlook.com
DeltaTrader 是一个开源的量化交易接口,实现自动交易从未如此简单。
不到 10 行代码,你就可以获取任意 A 股数据,并实现自动化交易。
直接 clone 项目代码即可使用:
git clone https://github.com/Delta-F/DeltaTrader.git
获取股票价格数据:
import data.stock as st
data = st.get_single_price(code='000001.XSHE',
time_freq='daily',
start_date='2021-01-01',
end_date='2021-02-01')
将数据导出为 CSV 文件:
import data.stock as st
data = st.get_single_price(code='000001.XSHE')
st.export_data(data=data, filename='000001.XSHE', type='price')
- 📊 行情数据:支持两个数据源(聚宽 JQData、财经网站爬虫)
- ⚙️ 策略模型:基于简单的规则创建交易策略
- 🤖 自动交易:支持模拟实盘测试
- deltaf:框架设计及 Python 3 版本维护
- ACE:财经网站行情爬虫模块
(欢迎补充更多贡献者)
如果你在使用中遇到问题或有建议,欢迎通过 Issues 区 交流反馈。