Skip to content

Commit 537d9ac

Browse files
committedMar 31, 2015
简单修改帮助
1 parent ca5b6da commit 537d9ac

File tree

2 files changed

+51
-1
lines changed

2 files changed

+51
-1
lines changed
 

‎Matlab/test/test.asv

+44
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
%% ����C#�⣬�밴�Լ�Ŀ¼���е���
2+
cd 'd:\wukan\Documents\GitHub\QuantBox_XAPI\Matlab\test'
3+
NET.addAssembly(fullfile(cd,'QuantBox.XAPI.dll'));
4+
5+
import QuantBox.XAPI.Event.*;
6+
7+
%% ����
8+
global md;
9+
md = XApiWrapper('QuantBox_CTP_Quote.dll');
10+
md.Server.BrokerID = '1017';
11+
md.Server.Address = 'tcp://ctpmn1-front1.citicsf.com:51213;';
12+
13+
md.User.UserID = '00000015';
14+
md.User.Password = '123456';
15+
16+
addlistener(md,'OnConnectionStatus',@OnMdConnectionStatus);
17+
addlistener(md,'OnRtnDepthMarketData',@OnRtnDepthMarketData);
18+
19+
md.Connect();
20+
21+
%% ����
22+
global td;
23+
td = XApiWrapper('QuantBox_CTP_Trade.dll');
24+
td.Server.BrokerID = '1017';
25+
td.Server.Address = 'tcp://ctpmn1-front1.citicsf.com:51205;';
26+
27+
td.User.UserID = '00000015';
28+
td.User.Password = '123456';
29+
30+
addlistener(td,'OnConnectionStatus',@OnTdConnectionStatus);
31+
addlistener(td,'OnRtnOrder',@OnRtnOrder);
32+
33+
td.Connect();
34+
35+
%% �µ�
36+
order1 = BuyLimit('IF1502',1,3000)
37+
disp(order1)
38+
39+
%% ����
40+
td.CancelOrder(order1);
41+
42+
%% �˳�
43+
% md.Dispose() %�����˳�
44+
% td.Dispose() %�����˳�

‎README.md

+7-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
实现统一的结构体必然会有些API的特殊字段没法照顾到;调用方式统一则有些功能将不会实现,而有些功能需要几个请求,或本机模拟的方法来实现;加载方式以前C#层是用的P/Invoke,现在改用LoadLibraryEx/dlopen来实现。
1212

13-
## 如何使用
13+
## 如何使用C#版
1414
编译QuantBox.XAPI,有两种输出方式
1515

1616
1. 生成QuantBox.XAPI.dll,设置输出类型为类库,可以在其它项目中引用
@@ -38,6 +38,12 @@
3838

3939
4. 将CTP的两个文件\*.so前面加lib复制到/usr/lib下
4040

41+
## 如何使用C++版
42+
直接参考QuantBox_XAPI_TEST项目即可,简单的行情订阅,下单撤单
43+
44+
## 如何使用C版
45+
参考QuantBox_XAPI这个项目中的CXApi与CXSpi是如何实现的
46+
4147
## 如何开发新的接口
4248
1. 模仿已经提供的几个项目即可
4349

0 commit comments

Comments
 (0)
Please sign in to comment.