设为首页收藏本站

 找回密码
 注册
查看: 770|回复: 0
打印 上一主题 下一主题

关于函数使用的奇怪的问题,谁遇见过, 编程语言有什么特性么 [复制链接]

Rank: 1

精华
0
UID
213916
积分
2
帖子
1
主题
1
阅读权限
10
注册时间
2015-7-15
最后登录
2020-7-30
跳转到指定楼层
1#
发表于 2019-4-24 11:43:35 |只看该作者 |倒序浏览
Params

Vars
        //此处添加变量

        NumericSeries OH(0);
        NumericSeries OL(0);
               
        Numeric PP_LOW(0);
        Numeric KK(0);
        Numeric i(0);
Begin
     i =         CurrentBar;
       
        //HBarIndex = HighestBarIndex(High);
        //LBarIndex = LowestBarIndex(Low);       
       
       
        //OH = H;
        //OL = L;
       
        FileAppend("C:\\Formula-7.log","i-----------= "+Text(i));
        //TestA(CurrentBar,PP_LOW);
        Test_HH(HBarIndex,LBarIndex,OH,OL,i);  
             //HFenXing(HBarIndex,LBarIndex,OH,OL,i,PP_TOP);
         //Test_HH(HBarIndex,LBarIndex,OH,OL,i);  
         //Test_HH(HBarIndex,LBarIndex,OH,OL,i);

             
                if(PP_LOW > 2){
               FileAppend("C:\\Formula-7.log","i= "+Text(i));
                        FileAppend("C:\\Formula-7.log","----- ");
                        FileAppend("C:\\Formula-7.log","PP_LOW= "+Text(PP_LOW));        
                         
                        while(i >=0 ){
                                        FileAppend("C:\\Formula-7.log","Index000000= "+Text(i));          
                                        FileAppend("C:\\Formula-7.log","LBarIndex-0000000= "+Text(Low[i]));        
                                        i = i -1;
                        }                       
                         
                        Test_HH(High,Low,High,Low,CurrentBar);
                        i = CurrentBar;
                        while(i >=0 ){
                                        FileAppend("C:\\Formula-7.log","Index000000= "+Text(i));          
                                        FileAppend("C:\\Formula-7.log","LBarIndex-0000000= "+Text(Low[i]));        
                                        i = i -1;
                        }               
                }
         
End

上边是我的测试程序, 发现 在加了  if (PP_low > 2 ){
        Test_HH(High,Low,High,Low,CurrentBar);
}   

这个 Test_HH 的 high  序列会丢失数据

这个是第一次调用   Test_HH(HBarIndex,LBarIndex,OH,OL,i);    在 最开始的地方,  Index000000= 3
LBarIndex-0000000= 3759
Index000000= 2
LBarIndex-0000000= 3763
Index000000= 1
LBarIndex-0000000= 3772
Index000000= 0
LBarIndex-0000000= 3780

而 if 里边的数据同样的函数  输出会变成  
Index000000= 3
LBarIndex-0000000= 3780
Index000000= 2
LBarIndex-0000000= 3780
Index000000= 1
LBarIndex-0000000= 3780
Index000000= 0
LBarIndex-0000000= 3780

数据全部变成了 0 索引的那个数据, 为啥

有什么特殊的要求么 这个语言 。

您需要登录后才可以回帖 登录 | 注册

bottom

静态版|手机版|联系我们|交易开拓者 ( 粤ICP备07044698   

GMT+8, 2024-4-19 16:51

Powered by Discuz! X2 LicensedChrome插件扩展

© 2011-2012 交易开拓者 Inc.

回顶部