以文本方式查看主题

-  金字塔客服中心 - 专业程序化交易软件提供商  (http://weistock.com/bbs/index.asp)
--  公式模型编写问题提交  (http://weistock.com/bbs/list.asp?boardid=4)
----  请看看问题在哪里2  (http://weistock.com/bbs/dispbbs.asp?boardid=4&id=8802)

--  作者:tonybig
--  发布时间:2011/11/4 12:03:36
--  请看看问题在哪里2

请看看问题在哪里,用在1分钟图上 图中显示多处白色无效开仓图标。

 

runmode:0;

pre30dayshigh:=ref(hhv(h,30),1);

pre30dayslow:=ref(llv(l,30),1); 

 

stdrange:=std(c,30);   //偏差

centraline:(pre30dayshigh+pre30dayslow)/2; //中轨

uperband:centraline+stdrange; //上轨


dnband:centraline-stdrange;  //下轨

enterlongcond:=h>=uperband; //开多
entershortcond:=l<=dnband;  //开空

exitlongcond:=ref(c,1)<=centraline;   //多头止损
exitshortcond:=ref(c,1)>=centraline; // 空头止损

 


   if time<1458 and enterlongcond and centraline>=ref(centraline,1) and enterbars>=0 then begin
      sellshort(holding<0,0,limitr,uperband+mindiff);
      buy(holding=0,1,limitr,uperband+mindiff);
      end
     
   if time<1458 and entershortcond and centraline<=ref(centraline,1) and enterbars>=0 then begin
      sell(holding>0,0,limitr,dnband-mindiff);
      buyshort(holding=0,1,limitr,dnband-mindiff);
      end

//止损
   if exitlongcond then sell(holding>0,0,close);
   if exitshortcond then sellshort(holding<0,0,close);
  
//退出
   if time>145800 and time<150000 then begin
      sellshort(holding<0,0,close);
      sell(holding>0,0,close);
   end

[此贴子已经被作者于2011-11-4 12:04:21编辑过]

--  作者:26327756l
--  发布时间:2011/11/4 13:45:43
--  

没有看到白色无效开仓图标


--  作者:tonybig
--  发布时间:2011/11/4 13:47:48
--  
我加载在任何1分钟周期上就会有啊
--  作者:fly
--  发布时间:2011/11/4 13:50:07
--  

//有不懂的,对照函数列表好好看看.

//请您逐字逐句的看看每一句的区别.---之前工作人员帮您写了个策略的,您肯定是没仔细看,这个策略犯了很多低级错误,希望下次发帖,不要再出现.

 

runmode:0;

pre30dayshigh:=ref(hhv(h,30),1);
pre30dayslow:=ref(llv(l,30),1); 

 

stdrange:=std(c,30);   //偏差
centraline:(pre30dayshigh+pre30dayslow)/2; //中轨
uperband:centraline+stdrange; //上轨
dnband:centraline-stdrange;  //下轨

 

enterlongcond:=h>=uperband and time>093000 and time<145800; //开多
entershortcond:=l<=dnband and time>093000 and time<145800;  //开空

 

   if enterlongcond and centraline>=ref(centraline,1)  then
      begin
      sellshort(holding<0 and enterbars>0,0,limit,c+2*mindiff);
      buy(holding=0,1,limit,c+2*mindiff);
      end
     
   if entershortcond and centraline<=ref(centraline,1)  then
      begin
      sell(holding>0 and enterbars>0,0,limit,c-2*mindiff);
      buyshort(holding=0,1,limit,c-2*mindiff);
      end

 

//仓位止损
   if ref(c,1)<=centraline and holding>0 then sell(1,0,thisclose);
   if ref(c,1)>=centraline and holding<0 then sellshort(1,0,thisclose);
  
//收盘前平仓
   if time>=145800 then begin
      sellshort(holding<0,0,thisclose);
      sell(holding>0,0,thisclose);
   end


--  作者:tonybig
--  发布时间:2011/11/4 14:16:56
--  

谢谢回复,  技术是一点一点堆积的嘛~~  相信很快会熟练的。