├── .gitignore ├── README.md ├── index.js └── package.json /.gitignore: -------------------------------------------------------------------------------- 1 | ignore 2 | 3 | node_modules 4 | 5 | .DS_Store 6 | yarn.lock 7 | package-lock.json 8 | yarn-error.log 9 | npm-debug.log* -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ### 手把手教你用 nodejs 打造完整的量化交易系统 - 系统源码部分 2 | 3 | 4 | 系列文章: 5 | 6 | 手把手教你用 nodejs 打造完整的量化交易系统 - 序章 - https://zhuanlan.zhihu.com/p/70341673 -------------------------------------------------------------------------------- /index.js: -------------------------------------------------------------------------------- 1 | const FutuQuant = require('futuquant'); 2 | 3 | const config = require('./ignore/config'); 4 | 5 | const ft = new FutuQuant(config); 6 | 7 | const init = async () => { 8 | await ft.init(); 9 | 10 | const security = { code: '00700', market: 1 }; 11 | // 每支股票订阅一个类型占用一个额度。 12 | // 订阅额度上限与用户等级相关,一级: 1000, 二级: 300 , 三级: 100 13 | 14 | // 先订阅基础报价,才能获取基础行情 15 | await ft.qotSub({ 16 | securityList: [security], 17 | subTypeList: [1] // 基础报价 18 | }); 19 | const [basicQot] = await ft.qotGetBasicQot([security]); 20 | console.log('00700基本行情', basicQot); 21 | console.log('00700当前价格', basicQot.curPrice); 22 | }; 23 | 24 | init(); 25 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "node-quant", 3 | "version": "1.0.0", 4 | "main": "index.js", 5 | "scripts": { 6 | "test": "echo \"Error: no test specified\" && exit 1" 7 | }, 8 | "keywords": [], 9 | "author": "", 10 | "license": "ISC", 11 | "dependencies": { 12 | "futuquant": "^3.2.5" 13 | }, 14 | "devDependencies": {}, 15 | "description": "" 16 | } 17 | --------------------------------------------------------------------------------