以文本方式查看主题

-  金字塔客服中心 - 专业程序化交易软件提供商  (http://weistock.com/bbs/index.asp)
--  交易策略发布专区  (http://weistock.com/bbs/list.asp?boardid=10)
----  [交易系统]肯特纳通道突破  (http://weistock.com/bbs/dispbbs.asp?boardid=10&id=5274)

--  作者:z7c9
--  发布时间:2011/2/24 9:08:39
--  [交易系统]肯特纳通道突破

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

 

runmode:0;

input:length(20,1,100,1);
input:numatrs(1);

entertime:=time>=093500 and time<=145500;
exittime:=time>=150000;

tprice:=(high+low+close)/3;
avgvalue:=ma(tprice,length);
shiftvalue:=numatrs*ma(tr,length);
upperband:=avgvalue+shiftvalue;
lowerband:=avgvalue-shiftvalue;

longcond:=entertime and high>=trimprice(ref(upperband,1));
longprice:=max(trimprice(ref(upperband,1)),open);

shortcond:=entertime and low<=trimprice(ref(lowerband,1));
shortprice:=min(trimprice(ref(lowerband,1)),open);

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

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

if holding>0 then begin
 if exittime then
  sell(1,holding,limitr,close);
end

if holding<0 then begin
 if exittime then
  sellshort(1,holding,limitr,close);
end
     
收益:(asset-500000)/500000,noaxis,colormagenta;
次数:totaltrade,linethick0;
胜率:percentwin,linethick0;
连亏:maxseqloss,linethick0;
连赢:maxseqwin,linethick0;

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

--  作者:阿火
--  发布时间:2011/2/25 16:12:41
--  

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

牛,怎么不加个止损进去