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


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

   

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


  共有4909人关注过本帖树形打印复制链接

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

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


加好友 发短信
等级:管理员 帖子:5082 积分:17642 威望:0 精华:6 注册:2010/7/15 9:05:58
  发帖心情 Post By:2011/11/4 13:50:07    Post IP:58.246.57.26[显示全部帖子]

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

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

 

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



金字塔—专业程序化交易量化投资平台

客户服务部

-----------------------------------------------------------

欢迎您参加我公司的技术培训,具体培训需求请发邮件到

service@weistock.com

您的宝贵建议或者投诉,请发往邮箱:weiwei@weistock.com

 回到顶部