Rss & SiteMap

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

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

标题:[交易系统]趋势跟踪

1楼
z7c9 发表于:2011/3/12 8:59:23

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

 

input:period(60,5,120,5);
input:length(20,5,40,5);
input:trailingstop(3,1,6,1);

variable:stopline=0;

topband:=ref(hhv(high,period),1)+mindiff;
botband:=ref(llv(low,20),1)-mindiff;

atr:=ref(ma(tr,length),1);

trailingstopnum:=trimprice(trailingstop*atr);

if holding=0 then begin
 if barpos>period and high>=topband then
  buy(1,100%,limitr,close);
end

if holding>0 then begin
 if high-trailingstopnum>stopline then
  stopline:=high-trailingstopnum;
 
 if enterbars>=2 and low<=stopline then begin
  sell(1,holding,limitr,close); 
  stopline:=0;
 end 
end

partline(holding>0 and enterbars>=2,stopline,coloryellow,1);

盈亏:asset,noaxis,colormagenta;      
收益:(asset-500000)/500000,linethick0;
次数:totaltrade,linethick0;
胜率:percentwin,linethick0;
连亏:maxseqloss,linethick0;
连赢:maxseqwin,linethick0;

[此贴子已经被作者于2011-10-3 11:22:26编辑过]
2楼
a7777 发表于:2013/1/29 21:14:54
图片点击可在新窗口打开查看
共2 条记录, 每页显示 10 条, 页签: [1]


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