欢迎使用金字塔普通技术服务论坛,您可以在相关区域发表技术支持贴。
我司技术服务人员将优先处理 VIP客服论坛 服务贴,普通区问题处理速度慢,请耐心等待。谢谢您对我们的支持与理解。


金字塔客服中心 - 专业程序化交易软件提供商金字塔软件公式模型编写问题提交 → 请看看问题在哪里2

   

欢迎使用金字塔普通技术服务论坛,您可以在相关区域发表技术支持贴。
我司技术服务人员将优先处理 VIP客服论坛 服务贴,普通区问题处理速度慢,请耐心等待。谢谢您对我们的支持与理解。    


  共有4659人关注过本帖平板打印复制链接

主题:请看看问题在哪里2

帅哥哟,离线,有人找我吗?
tonybig
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信 量化投资
等级:论坛游民 帖子:148 积分:653 威望:0 精华:0 注册:2010/9/27 16:08:27
请看看问题在哪里2  发帖心情 Post By:2011/11/4 12:03:36    Post IP:116.25.201.171[只看该作者]

请看看问题在哪里,用在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编辑过]

 回到顶部