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


金字塔客服中心 - 专业程序化交易软件提供商金字塔软件公式模型编写问题提交 → 交易系统编译不通过怎么回事?

   

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


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

主题:交易系统编译不通过怎么回事?

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


加好友 发短信
等级:新手上路 帖子:55 积分:0 威望:0 精华:0 注册:2016/9/6 14:28:48
交易系统编译不通过怎么回事?  发帖心情 Post By:2017/11/12 14:01:49    Post IP:115.60.60.220[只看该作者]

下面是交易系统,下面红色的一行代码出错,说后面没有分号,好奇怪。



VARIABLE:times:=0,p1:=0,p2:=0,p3:=0,p4:=0,p5:=0;
INPUT:m(14,1,30,1);
//cci指标
TYP := (HIGH + LOW + CLOSE)/3;
cci:=(TYP-MA(TYP,M))/(0.015*AVEDEV(TYP,M));
//买入条件
lots:=cash(0)/(5-times);
buy_con:=cross(cci,100);
sell_con=cross(100,cci);
sell_con1:=cross(100,cci) and c/ENTERPRICE>1.001;
sell_con2:=cross(100,cci) and c/p1>1.001;
sell_con3:=cross(100,cci) and times=5; 
if buy_con and times<=4 then begin
   BUY(1 ,lots,THISCLOSE);
   times:=times+1;
    if times=1 then begin
        p1:=close;
        end 
    if times=2 then BEGIN
      p2:=p1;
      p1:=close;
      end 
    if times=3 then begin
      p3:=p2;
      p2:=p1;
      p1:=close;
      end 
    if times=4 then begin
      p4:=p3;
      p3:=p2;
      p2:=p1;
      p1:=close;
      end 
    if times=5 then begin
      p5:=p4;
      p4:=p3;
      p3:=p2;
      p2:=p1;
      P1:=CLOSE;
      end
end
if sell_con and times>0 then  begin
   if c>ENTERPRICE>1.001 then begin
       lots:=1/times
       sell(1,lots,THISCLOSE);
       times:=times-1;
       end 
   if times=5 then begin
       sell(1,40%,THISCLOSE);
       times:=3;
       end 
   if times>=2 and times<=4 then BEGIN
      if times=2 and c/p1>1.001 and c/p2>1.001 then BEGIN
          sell(1,100%,THISCLOSE);
          times:=0; 
          end
      if times=3 and c/p1>1.001 and c/p2>1.001 and c/p3>1.001 then BEGIN
          sell(1,100%,THISCLOSE);
          times:=0; 
          end
      if times=4 and c/p1>1.001 and c/p2>1.001 and c/p3>1.001 and c/p4>1.001 then BEGIN
          sell(1,100%,THISCLOSE);
          times:=0; 
          end
      if times=5 and c/p1>1.001 and c/p2>1.001 and c/p3>1.001 and c/p4>1.001 and c/p5>1.001 then BEGIN
          sell(1,100%,THISCLOSE);
          times:=0; 
          end
      end 
     end 


 回到顶部