以文本方式查看主题

-  金字塔客服中心 - 专业程序化交易软件提供商  (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=10801)

--  作者:admin
--  发布时间:2012/3/28 9:54:55
--  公布一个实盘稳定盈利的股指策略

感谢猎豹大周

 

runmode:0;
input:V1(1,1,100,1);
 input:f1(0.4);
 input:f2(0.07);
 input:f3(0.18);
 input:m(0.9);
 input:x(3,1,10,1);
 
variable:up=0;
 variable:bsetup=0;
 variable:senter=0;
 variable:benter=0;
 variable:bbreak=0;
 variable:sbreak=0;
 variable:ltoday=0;
 variable:h0=999999;
 variable:sn=0;
 variable:div=0;
 variable:rf=false;
 
i:=m*(callstock(stklabel,vtopen,6,0)/100);
 
if barpos=1 then begin
 sn:=0;
 div:=max(x,1);//xdiv
 end
 
hh:ref(h0,1),noaxis;

 cc:=ref(close,1);
 ll:=ref(ltoday,1);
 
if date>ref(date,1) then begin
 sn:=sn+1;
 
up:=hh+f1*(cc-ll);
 senter:=((1+f2)/2)*(hh+cc)-f2*ll;
 benter:=((1+f2)/2)*(ll+cc)-f2*hh;
 bsetup:=ll-f1*(hh-cc);
 bbreak:=up+f3*(up-bsetup);
 sbreak:=bsetup-f3*(up-bsetup);
 
h0:=high;
 ltoday:=low;
 
rf:=hh-cc>=0.2{rangemin};
 end
 
if high>h0 then h0:=high;
 if low<ltoday then ltoday:=low;
 
if time>=opentime(1) and time<closetime(0)-500 and sn>=2 and rf then begin
 if h0>=up and holding>=0 then begin
 if low<=senter+(h0-up)/div then begin
 sell(1,v1,thisclose);
 buyshort(1,v1,thisclose);
 end
end
 
if ltoday<=bsetup and holding<=0 then begin
 if high>=benter-(bsetup-ltoday)/div then begin
 if high>=benter-(bsetup-ltoday)/div then begin
 sellshort(1,v1,thisclose);
 buy(1,v1,thisclose);
 end
 end
 end
 
if holding<0 then begin
 if high-enterprice>=i then
 sellshort(1,v1,thisclose);
 end
 
if holding>0 then begin
 if enterprice-low>=i then
 sell(1,v1,thisclose);
 end
 
if holding=0 then begin
 if high>=bbreak then
 buy(1,v1);
 end
 
if holding=0 then begin
 if low<=sbreak then
 buyshort(1,v1);
 end
 end
 
if time>=closetime(0)-500 then begin
 if holding<0 then
 sellshort(1,v1);
 
if holding>0 then
 sell(1,v1);
end
资产:asset,noaxis,coloryellow,linethick2;


图片点击可在新窗口打开查看此主题相关图片如下:未命名.jpg
图片点击可在新窗口打开查看

--  作者:阿火
--  发布时间:2012/3/28 21:46:06
--  

--  作者:sdpeace
--  发布时间:2012/3/29 14:14:05
--  

谁能翻译一下呀,学习!多谢


--  作者:guotx2010
--  发布时间:2012/3/29 17:31:04
--  简单的后台模型,麻烦帮忙修改

欢迎大家都发些实盘策略来,可以互相学习借鉴。

 


--  作者:xian_0_9
--  发布时间:2012/3/30 9:55:02
--  
好像有些地方会反复发信号
--  作者:aback
--  发布时间:2012/3/30 14:29:10
--  

确实牛的!


--  作者:xiaoxiami
--  发布时间:2012/3/30 17:20:04
--  
提供了新思路,很好的模型。感谢猎豹大周。
--  作者:辣椒
--  发布时间:2012/4/1 14:40:26
--  
学习!多谢
--  作者:wangshijun78
--  发布时间:2012/4/19 11:04:47
--  
 不错,来验证一下有无信号漂移。
--  作者:livepu
--  发布时间:2012/4/20 21:39:41
--  
似乎回测参数有不一样啊。