-
Notifications
You must be signed in to change notification settings - Fork 375
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
8 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
function [ ] = OnOrder( order ) | ||
msg = sprintf('order status changed to %d, filled volume = %d', order(1, 'status'), order(1, 'filled_volume')) | ||
disp(msg); | ||
|
||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
clear; | ||
% 请注意修改成您的注册掘金用户名和密码 | ||
username = '[email protected]'; | ||
pwd = '123456'; | ||
|
||
|
@@ -7,6 +8,7 @@ | |
global MA5; | ||
global MA20; | ||
|
||
% 请注意第五个参数strategy_id需要更改成您本地终端生成的ID,否则在终端上看不到策略的连接状态和下单。 | ||
ret = gm.Init(username,pwd,MDMode.MD_MODE_SIMULATED,'SZSE.000001.bar.60','110ca5d6-a8a1-11e5-a82d-bc855616490f','localhost:8001'); | ||
|
||
if ret ~= 0 | ||
|
@@ -18,5 +20,6 @@ | |
gm.SetBarHandle(@OnBar); | ||
gm.SetLoginHandle(@OnLogin); | ||
gm.SetErrorHandle(@OnError); | ||
gm.SetOrderHandle(@OnOrder); | ||
|
||
gm.Run(); |