载入中...
在线检测未来函数
载入中...

在 缺口 指标中添加日期

来源:Internet,编辑:股旁网,2012-05-30

编写要求:

股旁网解答:

 网友求助:

请老师帮忙看能不能在 缺口值 前边把 缺口日期 也添加显示出来谢谢!!!!!
如下图中红色标识{红色标识是自行画上的}

在 缺口 指标中添加日期

在 缺口 指标中添加日期

指标源码
缺口
{向下跳空缺口}
I1:=0;
flag1:=0;
while I1<BARSLAST(DISPSTATUS=1)-BARSLAST(DISPSTATUS=2)
DO
IF REF(H,I1)<REF(L,I1+1) AND REF(L,I1+1)>HHV(H,I1+1)
THEN BEGIN FLAG1:=1;
S1:=I1;
I1:=BARSLAST(DISPSTATUS=1);
END
ELSE I1:=I1+1;
STICKLINE(FLAG1,REF(L,S1+1),HHV(H,S1+1),(s1+1)*20,0),Colorgray,ALIGN1,LAYER7;
DRAWTEXT(flag1,REF(L,s1+1),NUMTOSTRN(ref(h,s1+1),2)+'-'+NUMTOSTRN(hhV(h,S1+1),2)),ALIGN2,COLOR00ffff;
{向上跳空缺口}

I:=0;
flag:=0;
while I<BARSLAST(DISPSTATUS=1)-BARSLAST(DISPSTATUS=2)
DO
IF REF(L,I)>REF(H,I+1) AND REF(H,I+1)<LLV(LOW,I+1)
THEN BEGIN FLAG:=1;
S:=I;
I:=BARSLAST(DISPSTATUS=1);
END
ELSE I:=I+1;
STICKLINE(FLAG,REF(h,S+1),LLV(LOW,S+1),20*(s+1),500),Colorff000f,ALIGN1,LAYER7;
DRAWTEXT(FLAG,REF(H,s+1),NUMTOSTRN(ref(h,s+1),2)+'-'+NUMTOSTRN(LLV(LOW,S+1),2)),ALIGN2,COLOR00ffff;
 

 
解答如下:
I1:=0;
flag1:=0;
while I1<BARSLAST(DISPSTATUS=1)-BARSLAST(DISPSTATUS=2)
DO
IF REF(H,I1)<REF(L,I1+1) AND REF(L,I1+1)>HHV(H,I1+1)
THEN BEGIN FLAG1:=1;
S1:=I1;
I1:=BARSLAST(DISPSTATUS=1);
END
ELSE I1:=I1+1; T1:=REF(DATE,S1)+19000000;
STICKLINE(FLAG1,REF(L,S1+1),HHV(H,S1+1),(s1+1)*20,0),ColorC0C0C0,ALIGN1,LAYER7;
DRAWTEXT(flag1,REF(L,s1+1),STRLEFT(STR(T1),4)+'/'+STRMID(STR(T1),5,2)+'/'+STRRIGHT(STR(T1),2)+' '+NUMTOSTRN(ref(h,s1+1),2)+'-'+NUMTOSTRN(hhV(h,S1+1),2)),ALIGN2,COLORgreen;
I:=0;
flag:=0;
while I<BARSLAST(DISPSTATUS=1)-BARSLAST(DISPSTATUS=2)
DO
IF REF(L,I)>REF(H,I+1) AND REF(H,I+1)<LLV(LOW,I+1)
THEN BEGIN FLAG:=1;
S:=I;
I:=BARSLAST(DISPSTATUS=1);
END
ELSE I:=I+1; T:=REF(DATE,S)+19000000;
STICKLINE(FLAG,REF(h,S+1),LLV(LOW,S+1),20*(s+1),500),ColorC0C0C0,ALIGN1,LAYER7;
DRAWTEXT(FLAG,REF(H,s+1),STRLEFT(STR(T),4)+'/'+STRMID(STR(T),5,2)+'/'+STRRIGHT(STR(T),2)+''+NUMTOSTRN(ref(h,s+1),2)+'-'+NUMTOSTRN(LLV(LOW,S+1),2)),ALIGN2,COLORgreen;
 

 

相关文章