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


金字塔客服中心 - 专业程序化交易软件提供商金字塔软件公式模型编写问题提交 → FILTERX 函数在逐K线模式下运行出错

   

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


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

主题:FILTERX 函数在逐K线模式下运行出错

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


加好友 发短信
等级:论坛游侠 帖子:193 积分:0 威望:0 精华:0 注册:2018/12/18 15:40:26
FILTERX 函数在逐K线模式下运行出错  发帖心情 Post By:2019/4/27 15:07:21    Post IP:123.168.88.72[只看该作者]


图片点击可在新窗口打开查看此主题相关图片如下:qq截图20190427150432.png
图片点击可在新窗口打开查看

请问这个函数是不能在逐K模式下运行,还是我用的方法不对啊?图片点击可在新窗口打开查看

代码原文如下:


i:=0;//i是序列值,在循环语句中,每个循环会+1. 
pen:=0;//当前笔
VARIABLE:s_czsc_high:=0;
VARIABLE:s_czsc_low:=0;
VARIABLE:direction:=0;
s_direction:=ref(direction,1);
s_direction_2:=ref(direction,2);
s_status:=0;
s_pen:=ref(pen,1); ;//前一笔  
p:=0;
shan:=FILTERX(p,i+1); 
s_czsc_high_1:=ref(s_czsc_high,1);    
s_czsc_high_i:=ref(s_czsc_high,(i+2));  
s_czsc_low_i:=ref(s_czsc_low,(i+2)); 
s_czsc_low_2:=ref(s_czsc_low,2); 
        
fb1:=s_status=0;
fb1_1:=i<50;
fb2:=s_pen=11 or s_pen=-11;
fb3:=s_pen=10 or s_pen=-10;
fb4:=s_direction>0;
fb5:=i<3;
fb6:=s_direction=1 and s_pen=11;
fb7:=ref(s_czsc_low,1)<ref(s_czsc_low,(i+2));
fb8:=s_direction=-1 and s_pen=-11;
fb9:=s_czsc_high_1>s_czsc_high_i;
fb10:=s_direction>0;
fb11:=s_czsc_high_1<s_czsc_low_i;
fb12:=s_czsc_low_2>s_czsc_high_i;
               
    //第一组    
        If fb1 then begin    //如果前一K线不是顶或者底儿
            pen:=s_direction*10; //赋值pen为前K方向值乘以10.因为s_direction初值为0.所以第一根K线判定时,pen也为0,pen为当前K线所在的趋势。
            //但最迟第三根K线开始s_direction就为1或者-1,所以pen的值也成为10或者-10.
        end //这个IF语句结束,不参与后边的多层嵌套
     //1,2循环判断
               
           While fb1=0 and fb1_1 do begin 
            If fb2 then  BREAK;
            i:=i+1; 
            end  //回溯50个处理完包含关系到K线,直至符合条件中断(50可根据周期自定义)  
      //第二组 
        If fb1=0 and fb3 and fb4 then begin            //如果回溯50个仍没符合条件的则延续状态
                    pen:=s_direction*10+s_status;
                    DRAWTEXT(h>0,l,'s_czsc_low'),colorwhite;
                    ll:=s_czsc_low;//原文是l,但是l是保留字,所以改成了ll
              end  
      //第三 组
        If fb1=0 and fb3=0 and fb4=0 then begin    
                    pen:=s_direction*10-s_status;
                    DRAWTEXT(h>0,H,'s_czsc_high'),colorwhite;
                    u:=s_czsc_high;
              end  
       //第四组       
        If fb1=0 and fb3=0 and fb5 then begin         
                    pen:=s_direction_2*10;
               end
       //第五组   
        If fb1=0 and fb3=0 and fb5=0 and fb6 and fb7 then begin         
             pen:=s_direction*10+s_status;
              DRAWTEXT(h>0,H,l,'s_czsc_low'),colorwhite;
              shan=1;
             p:=s_czsc_low;
               end
       //第六组   
        If fb1=0 and fb3=0 and fb5=0 and fb6 and fb7=0 then begin         
             pen:=s_direction_2*10;
                end
       //第七组  
        If fb1=0 and fb3=0 and fb5=0 and fb6=0 and fb8 and fb9 then begin     
        pen:=s_direction*10-s_status;
            DRAWTEXT(h>0,H,'s_czsc_high'),colorwhite;
            u:=s_czsc_high;
            shan=1;
            p:=s_czsc_high;
                end
     //第八组 
         If fb1=0 and fb3=0 and fb5=0 and fb6=0 and fb8 and fb9=0 then begin 
             pen:=s_direction_2*10;
                end  
     //第九组 
         If fb1=0 and fb3=0 and fb5=0 and fb6=0 and fb8=0 and fb10 and fb11 then begin  
          pen:=s_direction*10+s_status;
            DRAWTEXT(h>0,H,l,'s_czsc_low'),colorwhite;
            ll:=s_czsc_low;
            p:=s_czsc_low;
                end
     //第十组 
         If fb1=0 and fb3=0 and fb5=0 and fb6=0 and fb8=0 and fb10 and fb11=0 then begin  
          pen:=s_direction_2*10; 
              end
     //第十一组 
         If fb1=0 and fb3=0 and fb5=0 and fb6=0 and fb8=0 and fb10=0 and fb12 then begin  
          pen:=s_direction*10-s_status;
             DRAWTEXT(h>0,H,'s_czsc_high'),colorwhite;
             u:=s_czsc_high;
             shan=1;
             p:=s_czsc_high;
              end     
     //第十二组 
      If fb1=0 and fb3=0 and fb5=0 and fb6=0 and fb8=0 and fb10=0 and fb12=0 then begin 
             pen:=s_direction_2*10; 
              end
     
      

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


加好友 发短信
等级:管理员 帖子:26632 积分:0 威望:0 精华:7 注册:2015/4/9 14:59:07
  发帖心情 Post By:2019/4/28 9:03:13    Post IP:180.169.30.6[只看该作者]

该函数只能用在序列模式下。


编程无捷径,技巧靠积累。
 回到顶部
帅哥哟,离线,有人找我吗?
FireScript
  3楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:超级版主 帖子:14496 积分:0 威望:0 精华:0 注册:2017/7/4 13:40:18
  发帖心情 Post By:2019/4/28 9:05:04    Post IP:180.169.30.6[只看该作者]

 是的,因为这个函数是未来函数的缘故。


命数如织,当如磐石。
 回到顶部