设为首页收藏本站

 找回密码
 注册
查看: 1579|回复: 0

关于HIGHEST取值不正确无法解决的问题 [复制链接]

Rank: 1

精华
0
UID
225653
积分
31
帖子
14
主题
9
阅读权限
10
注册时间
2015-12-24
最后登录
2020-11-10
发表于 2017-12-13 22:11:37 |显示全部楼层
Params

Vars
Numeric hh;
Numeric ll;
Numeric i;
Numeric closetest;

Numeric hht;
Numeric llt;

Begin
If (CurrentBar% 10 == 0) PlotString("Bar#",Text(CURRENTBAR));

If (BarStatus == 0)
{
For i = 0 to 4
  {
  SetGlobalVar(i,0);
  }
}

If(CurrentBar% 10 == 0)
{
SetGlobalVar(0,CurrentBar);
For i = 0 to 3
  {
  SetGlobalVar(4-i,GetGlobalVar(3-i));
  }
}

closetest = CurrentBar - GetGlobalVar(2);
Commentary("closetest="+text(closetest));
Commentary("var0="+text(getglobalvar(0)));
Commentary("var1="+text(getglobalvar(1)));
Commentary("var2="+text(getglobalvar(2)));
Commentary("var3="+text(getglobalvar(3)));
Commentary("var4="+text(getglobalvar(4)));

hh = Highest(close[CurrentBar-GetGlobalVar(2)],5);
ll = Lowest(close[CurrentBar-GetGlobalVar(2)],5);

PlotNumeric("hh",hh,0,-1,0);
PlotNumeric("ll",ll,0,-1,0);

hht = Highest(close[10],5);
llt = Lowest(close[10],5);

Commentary("hht="+text(hht));
Commentary("llt="+text(llt));

End

跪求各位高手,上面hh的取值不正确,为了对照,我做了hht,照理说,应该在每个10的倍数位置,hh应该等于hht,但是实际不是,可以复制公式代码输出一下更直观。我截了图,但是不知道如何上传。
求高手解决问题,谢谢!
您需要登录后才可以回帖 登录 | 注册

bottom

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

GMT+8, 2024-4-19 08:29

Powered by Discuz! X2 LicensedChrome插件扩展

© 2011-2012 交易开拓者 Inc.

回顶部