Rss & SiteMap

金字塔客服中心 - 专业程序化交易软件提供商 http://www.weistock.com/bbs/

专业程序化软件提供商
共1 条记录, 每页显示 10 条, 页签: [1]
[浏览完整版]

标题:[交易系统]红黑三兵

1楼
z7c9 发表于:2011/1/29 10:40:04
以下内容为程序代码:

1 runmode:0;
2
3 variable:myholding=0;
4
5 buycond:=ref(all(isup,3),1);
6 buyshortcond:=ref(all(isdown,3),1);
7
8 if myholding=0 and buycond then begin
9     lots:=cash(0)/(open*multiplier*0.1);
10     buy(1,lots,limitr,open);
11     myholding:=lots;
12 end
13
14 if myholding=0 and buyshortcond then begin
15     lots:=cash(0)/(open*multiplier*0.1);
16     buyshort(1,lots,limitr,open);
17     myholding:=-lots;
18 end
19
20 if myholding>0 and time=closetime(0) then begin
21     sell(1,myholding,limitr,close);
22     myholding:=0;
23 end
24
25 if myholding<0 and time=closetime(0) then begin
26     sellshort(1,myholding,limitr,close);
27     myholding:=0;
28 end
[此贴子已经被作者于2011-10-3 11:30:44编辑过]
共1 条记录, 每页显示 10 条, 页签: [1]


Powered By Dvbbs Version 8.3.0
Processed in .56250 s, 2 queries.