Rss & SiteMap

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

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

标题:[交易系统]肯特纳系统

1楼
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;

2楼
辣椒 发表于:2012/4/1 16:06:42
谢谢分享,学习!
共2 条记录, 每页显示 10 条, 页签: [1]


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