<div align="center">
<img alt="Billerikay Logo" src="https://raw.githubusercontent.com/billpwchan/futu_algo/master/docs/img/author-logo.png" width="400px" />
**billpwchan/futu-algo API Reference Documentation**
[![Issues](https://img.shields.io/github/issues/billpwchan/futu_algo?style=for-the-badge)](https://github.com/billpwchan/futu_algo/issues)
[![License](https://img.shields.io/github/license/billpwchan/futu_algo?style=for-the-badge)](https://github.com/billpwchan/futu_algo/blob/master/LICENSE)
[![Downloads](https://img.shields.io/github/downloads/billpwchan/futu_algo/total?style=for-the-badge)](https://github.com/billpwchan/futu_algo)
[![CommitActivity](https://img.shields.io/github/commit-activity/y/billpwchan/futu_algo?style=for-the-badge)](https://github.com/billpwchan/futu_algo/commits/master)
[![RepoSize](https://img.shields.io/github/repo-size/billpwchan/futu_algo?style=for-the-badge)](https://github.com/billpwchan/futu_algo)
[![Languages](https://img.shields.io/github/languages/top/billpwchan/futu_algo?style=for-the-badge)](https://github.com/billpwchan/futu_algo)
</div>
## Features
- Developed based on FutoOpenD and FutuOpenAPI
- Low-latency Trading Support (up to 1M level)
- Daily Stock Filtering and Email Notification
- Strategy Backtesting and Reporting
## Issues
- [x] ~~[ADX & RSI Trading Strategy Support](https://github.com/billpwchan/futu_algo/issues/1)~~
## Releases
**Important:** Program still in Alpha Phase now.
## Version Guidance
| FutuAlgo Release | Futu OpenAPI Specification |
|:-----------------|:---------------------------|
| 0.0.2-alpha.x | 4.0 |
## Deployment
### Pre-Requisite: Configuration File (Config.ini)
```ini
[FutuOpenD.Config]
Host = <OpenD Host>
Port = <OpenD Port>
WebSocketPort = <OpenD WebSocketPort>
WebSocketKey = <OpenD WebSocketKey>
TrdEnv = <SIMULATE or REAL>
[FutuOpenD.Credential]
Username = <Futu Login Username>
Password_md5 = <Futu Login Password Md5 Value>
[FutuOpenD.DataFormat]
HistoryDataFormat = ["code","time_key","open","close","high","low","pe_ratio","turnover_rate","volume","turnover","change_rate","last_close"]
SubscribedDataFormat = None
[Database]
Database_path = <Your SQLite Database File Path>
[TradePreference]
Lot_size_multiplier = <# of Stocks to Buy per Signal>
StockList = <Subscribed Stocks in List Format>
[Backtesting.Commission.HK]
Fixed_Charge = <Fixed Transaction Fee and Tax in HKD - 15.5>
Perc_Charge = <Percentage Transaction Fee in % - 0.1097>
[Email]
Port = <Server SMTP Setting>
Smtp_server = <Server SMTP Setting>
Sender = <Sender Email Address - account1@example.com>
Login = <Sender Email Address - account1@example.com>
Password = <Sender Email Password>
SubscriptionList = ["account1@example.com", "account2@example.com"]
```
**IMPORTANT NOTE:** The format may be changed in later commits. Please refer to this README if exception is raised.
### 1. Install Dependencies
Install using [conda](https://docs.conda.io/en/latest/):
conda create --name <env> --file requirements.txt
### 2. Install FutuOpenD
For **Windows/MacOS/CentOS/Ubuntu**:
https://www.futunn.com/download/OpenAPI
### 3. Initialize SQLite Database
Go to [SQLite official website](https://www.sqlite.org/quickstart.html) and follow the QuickStart instruction to install
SQLite tools in the device.
Create a folder named 'database' in the root folder, and execute the SQLite DDL file stored in *./util/database_ddl.sql*
.
```
./
├── database
│ └── stock_data.sqlite
```
### 4. Download Data (e.g. 1M Data for max. 2 Years)
For **Windows**:
python main.py -u
For **MacOS/Linux**:
python3 main.py -u
### 4. Enjoy :smile:
## Usages
Update all `K_1M` and `K_DAY` interval historical K-line data
python main.py -u / python main.py --update
**IMPORTANT NOTE:** This will not override existing historical data if the file exists.
If you want to refresh all data, use the following command instead (WITH CAUTION!)
python main.py -fu / python main.py --force_update
Store all data from CSV to SQLite Database
python main.py -d / python main.py --database
Execute High-Frequency Trading (HFT) with a Pre-defined Strategy
python main.py -s MACD_Cross / python main.py --strategy MACD_Cross
Execute Stock Filtering with Pre-defined Filtering Strategies
python main.py -f Volume_Threshold Price_Threshold / python main.py --filter Volume_Threshold Price_Threshold
-----------
## Contributor
[Bill Chan -- Main Developer](https://github.com/billpwchan/)
没有合适的资源?快使用搜索试试~ 我知道了~
futu_algo:Futu算法交易框架(Python)基于富途OpenApi所开发的量化交易框架
共40个文件
py:28个
md:3个
csv:2个
5星 · 超过95%的资源 需积分: 5 20 下载量 83 浏览量
2021-03-18
09:14:35
上传
评论 1
收藏 398KB ZIP 举报
温馨提示
billpwchan / futu-algo API参考文档 特征 基于FutoOpenD和FutuOpenAPI开发 低延迟交易支持(最高1M级别) 每日库存过滤和电子邮件通知 策略回测和报告 问题 发行版 重要提示:现在,程序仍处于Alpha阶段。 版本指导 FutuAlgo发布 Futu OpenAPI规范 0.0.2-alpha.x 4.0 部署方式 先决条件:配置文件(Config.ini) [FutuOpenD.Config] Host = <OpenD> Port = <OpenD> WebSocketPort = <OpenD> WebSocketKey = <OpenD> TrdEnv = <SIMULATE> [FutuOpenD.Credential] Username =
资源详情
资源评论
资源推荐
收起资源包目录
futu_algo-master.zip (40个子文件)
futu_algo-master
handlers
rt_data_handler.py 2KB
cur_kline_handler.py 2KB
__init__.py 273B
stock_quote_handler.py 3KB
main.py 8KB
docs
img
author-logo.png 454KB
futu_algo.yml 4KB
strategies
Strategies.py 2KB
__init__.py 273B
EMA_Ribbon.py 5KB
KDJ_Cross.py 5KB
RSI_Threshold.py 5KB
MACD_Cross.py 5KB
.github
ISSUE_TEMPLATE
bug_report.md 834B
feature_request.md 595B
test
test_trading_engine.py 445B
test_strategy.py 1KB
__init__.py 273B
test_data
HK.09988_2020_1D.csv 31KB
test_data.csv 31KB
LICENSE 11KB
config_template.ini 815B
engines
stock_filter_engine.py 5KB
data_engine.py 8KB
trading_util.py 14KB
__init__.py 273B
email_engine.py 5KB
backtesting_engine.py 8KB
trading_engine.py 18KB
requirements.txt 4KB
.gitignore 2KB
filters
Volume_Threshold.py 1KB
MA_Simple.py 1KB
Price_Threshold.py 1KB
Triple_Cross.py 2KB
Filters.py 875B
__init__.py 273B
README.md 4KB
util
logger.py 1KB
database_ddl.sql 1KB
共 40 条
- 1
樊康康
- 粉丝: 32
- 资源: 4691
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
评论2