quantbox / quantbox.apiprovider Goto Github PK
View Code? Open in Web Editor NEWOpenQuant2014的XAPI插件
OpenQuant2014的XAPI插件
经过请教伍侃老师,终于弄清楚怎么引用新版XAPI3和APIProvider,写在这里作为记录,也指导一下新手吧。
1、在sfit下载最新版ctp_api
V6.6.1_P1_20210407_tradeapi
http://www.sfit.com.cn/DocumentDown/api_3/5_2_2/v6.6.1_P1_tradeapi.zip
2、压缩包内的win64目录下各种c++源文件覆盖XAPI3/include/CTP_SE/目录下的同名文件。
3、压缩包内的dl和lib复制到XAPI3/include/CTP_SE/win64目录
4、设置Release64模式编译,把编译后的CTP_SE_Quote_x64.dll和CTP_SE_Trade_x64.dll以及压缩包内的thostmduserapi_se.dll、thosttraderapi_se.dll放到D:\XAPI\CTP_SE(该目录可以自定义)
5、用X64模式编译XAPI_CSharp、QuantBox.APIProvider、QuantBox.Extension,把三个编译后的dll放到openquant2014安装目录。
6、编辑“C:\Users\xxx\AppData\Roaming\SmartQuant Ltd\OpenQuant 2014\config\configuration.xml”文件,在相关地方加入
<Provider>
<TypeName>QuantBox.APIProvider.ProviderHost, QuantBox.APIProvider</TypeName>
<Id>0</Id>
<X64>true</X64>
</Provider>
7、启动运行oq2014,会自动在C:\Users\xxx\AppData\Roaming\SmartQuant Ltd\OpenQuant 2014\config\目录下创建API_Host.json文件,编辑该文件,内容为:
[
{
"Id": 55,
"Name": "simnow"
}
]
8、重新启动oq2014,会自动创建目录C:\Users\xxx\AppData\Roaming\SmartQuant Ltd\OpenQuant 2014\config\simnow,在该目录下会自动新建4个文件,其中三个文件需要手工修改,分别是:
ApiList.json:
[
{
"DllPath": "d:\\XAPI\\CTP_SE\\CTP_SE_Quote_x64.dll",
"TypeName": "XAPI.Callback.XApi, XAPI_CSharp",
"Name": "CTP_SE",
"Version": "0.4.0.20190417",
"User": 0,
"Server": 0,
"LogPrefix": null,
"Type": 10,
"UseType": 10
},
{
"DllPath": "d:\\XAPI\\CTP_SE\\CTP_SE_Trade_x64.dll",
"TypeName": "XAPI.Callback.XApi, XAPI_CSharp",
"Name": "CTP_SE",
"Version": "0.4.0.20190418",
"User": 0,
"Server": 1,
"LogPrefix": null,
"Type": 97,
"UseType": 97
}
]
ServerList.json:
[
{
"Label": "simnow_m",
"Path": "d:\\XAPI\\CTP_SE\\server_m.json"
},
{
"Label": "simnow_t",
"Path": "d:\\XAPI\\CTP_SE\\server_t.json"
}
]
UserList.json:
[
{
"Label": "111111",
"Path": "d:\\XAPI\\CTP_SE\\user.json"
}
]
9、改好以上三个文件后,重新启动oq2014,会在D:\XAPI\CTP_SE目录自动创建三个文件,根据自己的实际情况填写文件内容。即可正常使用插件。
编译的时候,会提示找不到Order.SubSide的定义.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.