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


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

   

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


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

主题:请帮忙看看错在哪里

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


加好友 发短信
等级:新手上路 帖子:13 积分:120 威望:0 精华:0 注册:2011/10/8 12:29:50
请帮忙看看错在哪里  发帖心情 Post By:2011/10/8 12:43:07    Post IP:112.85.235.173[只看该作者]

 我在mt4中编了一下缠论分笔的公式,拿到金字塔来,改了一下格式,为什么通不过呢。把前一段公式的代码贴在下面。请朋友们帮忙看看,有啥问题。本人刚刚接触金字塔。

 

 Highxiu:=high;

 Lowxiu:=low;

 IF NOT(ISLASTBAR) THEN EXIT; //为了加快运算速度,只有最后一个周期时才循环计算

 for Shi=1 to datacount do

  begin

      if Shi>=1 and xiangbao==0 then

        begin         

          if (Highxiu[Shi]>Highxiu[Shi-1] and Lowxiu[Shi]>Lowxiu[Shi-1]) then xiangbao:=1;

          if (Highxiu[Shi]<Highxiu[Shi-1] and Lowxiu[Shi]<Lowxiu[Shi-1]) then  xiangbao:=-1;

        end

      if xiangbao==1 then

        begin

          if Highxiu[Shi]>=Highxiu[Shi-1] and Lowxiu[Shi]<Lowxiu[Shi-1] then 

           begin

             Lowxiu[Shi]:=Lowxiu[Shi-1];

           end

          if Highxiu[Shi]<Highxiu[Shi-1] and Lowxiu[Shi]>=Lowxiu[Shi-1] then

            begin

             Highxiu[Shi]:=Highxiu[Shi-1];

            end

          if Highxiu[Shi]<Highxiu[Shi-1] and Lowxiu[Shi]<Lowxiu[Shi-1] then

            begin

              xiangbao:=-1;

            end

         end

      if xiangbao==-1 then

        begin

          if Highxiu[Shi]>Highxiu[Shi-1] and Lowxiu[Shi]<=Lowxiu[Shi-1] then

            begin

             Highxiu[Shi]:=Highxiu[Shi-1];

            end

          if Highxiu[Shi]<=Highxiu[Shi-1] and Lowxiu[Shi]>Lowxiu[Shi-1] then

            begin

             Lowxiu[Shi]:=Lowxiu[Shi-1];

            end

          if Highxiu[Shi]>Highxiu[Shi-1] and Lowxiu[Shi]>Lowxiu[Shi-1] then

            begin

              xiangbao:=1;

            end

         end

   end         //结束循环

 

测试的时候报错  第八行 无法识别的算数表达式。

[此贴子已经被作者于2011-10-8 12:46:11编辑过]

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


加好友 发短信
等级:管理员 帖子:5082 积分:17642 威望:0 精华:6 注册:2010/7/15 9:05:58
  发帖心情 Post By:2011/10/8 13:41:08    Post IP:58.246.57.26[只看该作者]

(1)判断一个变量是否为0,不是双=号,一个就够了,如   xiangbao=0

 

(2)你这里的xiangbao需要设置为全局变量,

详细请参考:  http://www.weistock.com/bbs/dispbbs.asp?boardid=4&Id=332  问题1



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

客户服务部

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

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

service@weistock.com

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

 回到顶部