想计算一下多空的周期,是这么写的、
dt:barslast(HIGH>=ref(hh,1) and LOW>=ref(ll,1)),NODRAW;
kt:BARSLAST(HIGH<=ref(hh,1) and LOW<=ref(ll,1)),NODRAW;此主题相关图片如下:qq图片20150114103555.jpg
在我截图的区域
第一根阳线的高低点是 3547.2 和3473.2 下一根阴线的高低点是3560.6 和 3473.3 up=hh down=ll 计算等于高低点
这个时候 高点上移 低点也上移 符合dt的标准 dt的值应该归零 kt应该继续计数。 但事实上dt没有归零 请问一下原因是什么 该怎么解决
确定是满足的 up 和down的定义就是 hh 和ll 就这两个条件。 而这两个值都确定是 增大了。 哪怕是相等 也应该是归零的。 但没有
up:hh;
down:ll;
要不 加个qq 你远程一下看看?
是股指指数 60m 12月30日 14:15 的k线
把全部代码都贴一下
VARIABLE:hh=0,ll=0,oll=0,ohh=0,dth=0,dtl=0,kth=0,ktl=0,zs=0;
dt:barslast(HIGH>=ref(hh,1) and LOW>=ref(ll,1)),NODRAW;
kt:BARSLAST(HIGH<=ref(hh,1) and LOW<=ref(ll,1)),NODRAW;
dth:=hhv(h,dt+2);
dtl:=hhv(l,dt+2);
kth:=llv(h,kt+2);
ktl:=llv(l,kt+2);
if hh=0 and ll=0 then
begin
hh:=high;
ll:=low;
end;
if kt<=dt then
if hh<=high and ll>=low then
BEGIN
ll:=ktl;
hh:=kth;
end;
if hh>high and ll<low then
BEGIN
hh:=kth;
ll:=ktl;
end;
if hh<high and ll<low then
begin
hh:=high;
ll:=low;
end;
if hh>high and ll>low then
begin
hh:=high;
ll:=low;
end;
if kt>dt then
if hh<=high and ll>=low then
begin
hh:=dth;
ll:=dtl;
end;
if hh>high and ll<low then
begin
ll:=dtl;
hh:=dth;
end;
if hh<high and ll<low then
begin
hh:=HIGH;
ll:=LOW;
end;
if hh>high and ll>low then
begin
hh:=high;
ll:=low;
end;
up:hh;
down:ll;
60分钟线上没有14:15这一根k线
调整图形大小对 数据没影响