以文本方式查看主题

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

--  作者:z7c9
--  发布时间:2011/10/2 23:28:39
--  [交易系统]肯特纳系统

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

 

runmode:0;

input:avglength(40),atrlength(40);

ma1:=ref(ma((high+low+close)/3,avglength),1);

upperband:=ma1+ref(ma(tr,atrlength),1);
lowerband:=ma1-ref(ma(tr,atrlength),1);

entrylongcond:=ma1>ref(ma1,1) and high>=upperband;
exitlongcond:=low<=ma1;

entryshortcond:=ma1<ref(ma1,1) and low<=lowerband;
exitshortcond:=high>=ma1;

if holding=0 then begin
 if entrylongcond then
  buy(1,1,limitr,max(open,upperband));
end

if holding=0 then begin
 if entryshortcond then
  buyshort(1,1,limitr,min(open,lowerband));
end

if holding>0 then begin
 if exitlongcond then
  sell(1,holding,limitr,min(open,ma1));
end

if holding<0 then begin
 if exitshortcond then
  sellshort(1,holding,limitr,max(open,ma1));
end

盈亏:asset-50000,noaxis,colorred,linethick2;


--  作者:辣椒
--  发布时间:2012/4/1 16:06:42
--  
谢谢分享,学习!