Rss & SiteMap

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

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

标题:[交易系统]单均线穿越

1楼
z7c9 发表于:2011/2/6 12:50:25

图片点击可在新窗口打开查看

 

以下内容为程序代码:

1 runmode:0;
2
3 input:period(100,5,100,5);
4
5 variable:myasset=30000;
6
7 entertime:=time>=092500 and time<=145500;
8 exittime:=time>=150000;
9
10 buycond:=entertime and ref(cross(close,ma(close,period)),1);
11 buyprice:=open;
12
13 buyshortcond:=entertime and ref(cross(ma(close,period),close),1);
14 buyshortprice:=open;
15
16 if holding=0 and buycond then begin
17     buy(1,1,limitr,buyprice);
18 end
19
20 if holding=0 and buyshortcond then begin
21     buyshort(1,1,limitr,buyshortprice);
22 end
23
24 if holding>0 and exittime then begin
25     sell(1,holding,limitr,close);
26 end
27
28 if holding<0 and exittime then begin
29     sellshort(1,holding,limitr,close);
30 end
31
32 if exittime then
33     myasset:=asset;
34     
35 资产:myasset,noaxis,colormagenta;
36 次数:totaltrade,linethick0;
37 收益:(myasset-30000)/30000,linethick0;
38 胜率:percentwin,linethick0;
39 出击:totaltrade/(count(date<>ref(date,1),0)+1),linethick0;
40 连亏:maxseqloss,linethick0;
41 连赢:maxseqwin,linethick0;
42

[此贴子已经被作者于2011-10-3 11:29:44编辑过]
共1 条记录, 每页显示 10 条, 页签: [1]


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