以文本方式查看主题

-  金字塔客服中心 - 专业程序化交易软件提供商  (http://weistock.com/bbs/index.asp)
--  交易策略发布专区  (http://weistock.com/bbs/list.asp?boardid=10)
----  [交易系统]三重滤网策略  (http://weistock.com/bbs/dispbbs.asp?boardid=10&id=5302)

--  作者:z7c9
--  发布时间:2011/2/26 12:02:49
--  [交易系统]三重滤网策略


 

 

input:n1(60,5,120,5);
input:n2(20,5,120,5);
input:n3(5,5,120,5);

ma1:=ma(close,n1);
ma2:=ma(close,n2);
ma3:=ma(close,n3);

longcond:=ref(all(ma1>ref(ma1,1),2) and all(ma2<ref(ma2,1),2) and all(ma3>ref(ma3,1),2),1);

shortcond:=ref(all(ma1<ref(ma1,1),2) and all(ma2>ref(ma2,1),2) and all(ma3<ref(ma3,1),2),1);


if holding=0 then begin
 if longcond then
  buy(1,1,limitr,open);
end

if holding=0 then begin
 if shortcond then
  buyshort(1,1,limitr,open);
end

if holding>0 then begin
 if shortcond then begin
  sell(1,holding,limitr,open);
  buyshort(1,1,limitr,open);
 end 
 
 if time=150000 then
  sell(1,holding,limitr,open);
end

if holding<0 then begin
 if longcond then begin
  sellshort(1,holding,limitr,open);
  buy(1,1,limitr,open);
 end
 
 if time=150000 then
  sellshort(1,holding,limitr,open);
end
    
收益:asset,noaxis,colorred;
次数:totaltrade,linethick0;
胜率:percentwin,linethick0;
连亏:maxseqloss,linethick0;
连赢:maxseqwin,linethick0;

[此贴子已经被作者于2011-10-3 11:24:25编辑过]