通达信k线合并(主图源码贴图)通达信公式
{K线合并}
T1:=REF(C<O,1) AND C>=O;
T2:=REF(C<O,2) AND REF(C>=O,1) AND C>=O;
T3:=REF(C<O,3) AND REF(C>=O,2) AND REF(C>=O,1) AND C>=O;
T4:=REF(C<O,4) AND REF(C>=O,3) AND REF(C>=O,2) AND REF(C>=O,1) AND C>=O;
T5:=REF(C<O,5) AND REF(C>=O,4) AND REF(C>=O,3) AND REF(C>=O,2) AND REF(C>=O,1) AND C>=O;
T6:=REF(C<O,6) AND REF(C>=O,5) AND REF(C>=O,4) AND REF(C>=O,3) AND REF(C>=O,2) AND REF(C>=O,1) AND C>=O;
T7:=REF(C<O,7) AND REF(C>=O,6) AND REF(C>=O,5) AND REF(C>=O,4) AND REF(C>=O,3) AND REF(C>=O,2) AND REF(C>=O,1) AND C>=O;
T8:=REF(C<O,8) AND REF(C>=O,7) AND REF(C>=O,6) AND REF(C>=O,5) AND REF(C>=O,4) AND REF(C>=O,3) AND REF(C>=O,2) AND REF(C>=O,1) AND C>=O;
STICKLINE(T1,H,L,0,0)COLORRED;
STICKLINE(T1,C,O,3,1)COLORRED;
STICKLINE(T2,MAX(H,REF(H,1)),MIN(L,REF(L,1)),0,0)COLORRED;
STICKLINE(T2,REF(O,1),C,3,1)COLORRED;
STICKLINE(T3,MAX(MAX(H,REF(H,1)),REF(H,2)),MIN(MIN(L,REF(L,1)),REF(L,2)),0,0)COLORRED;
STICKLINE(T3,REF(O,2),C,3,1)COLORRED;
STICKLINE(T4,MAX(MAX(MAX(H,REF(H,1)),REF(H,2)),REF(H,3)),MIN(MIN(MIN(L,REF(L,1)),REF(L,2)),REF(L,3)),0,0)COLORRED;
STICKLINE(T4,REF(O,3),C,3,1)COLORRED;
STICKLINE(T5,MAX(MAX(MAX(MAX(H,REF(H,1)),REF(H,2)),REF(H,3)),REF(H,4)),MIN(MIN(MIN(MIN(L,REF(L,1)),REF(L,2)),REF(L,3)),REF(L,4)),0,0)COLORRED;
STICKLINE(T5,REF(O,4),C,3,1)COLORRED;
STICKLINE(T6,MAX(MAX(MAX(MAX(MAX(H,REF(H,1)),REF(H,2)),REF(H,3)),REF(H,4)),REF(H,5)),MIN(MIN(MIN(MIN(MIN(L,REF(L,1)),REF(L,2)),REF(L,3)),REF(L,4)),REF(L,5)),0,0)COLORRED;
STICKLINE(T6,REF(O,5),C,3,1)COLORRED;
STICKLINE(T7,MAX(MAX(MAX(MAX(MAX(MAX(H,REF(H,1)),REF(H,2)),REF(H,3)),REF(H,4)),REF(H,5)),REF(H,6)),MIN(MIN(MIN(MIN(MIN(MIN(L,REF(L,1)),REF(L,2)),REF(L,3)),REF(L,4)),REF(L,5)),REF(L,6)),0,0)COLORRED;
STICKLINE(T7,REF(O,6),C,3,1)COLORRED;
STICKLINE(T8,MAX(MAX(MAX(MAX(MAX(MAX(MAX(H,REF(H,1)),REF(H,2)),REF(H,3)),REF(H,4)),REF(H,5)),REF(H,6)),REF(H,7)),MIN(MIN(MIN(MIN(MIN(MIN(MIN(L,REF(L,1)),REF(L,2)),REF(L,3)),REF(L,4)),REF(L,5)),REF(L,6)),REF(L,7)),0,0)COLORRED;
STICKLINE(T8,REF(O,7),C,3,1)COLORRED;
TT1:=REF(C>=O,1) AND C<O;
TT2:=REF(C>=O,2) AND REF(C<O,1) AND C<O;
TT3:=REF(C>=O,3) AND REF(C<O,2) AND REF(C<O,1) AND C<O;
TT4:=REF(C>=O,4) AND REF(C<O,3) AND REF(C<O,2) AND REF(C<O,1) AND C<O;
TT5:=REF(C>=O,5) AND REF(C<O,4) AND REF(C<O,3) AND REF(C<O,2) AND REF(C<O,1) AND C<O;
TT6:=REF(C>=O,6) AND REF(C<O,5) AND REF(C<O,4) AND REF(C<O,3) AND REF(C<O,2) AND REF(C<O,1) AND C<O;
TT7:=REF(C>=O,7) AND REF(C<O,6) AND REF(C<O,5) AND REF(C<O,4) AND REF(C<O,3) AND REF(C<O,2) AND REF(C<O,1) AND C<O;
TT8:=REF(C>=O,8) AND REF(C<O,7) AND REF(C<O,6) AND REF(C<O,5) AND REF(C<O,4) AND REF(C<O,3) AND REF(C<O,2) AND REF(C<O,1) AND C<O;
STICKLINE(TT1,H,L,0,0)COLORCYAN;
STICKLINE(TT1,C,O,3,0)COLORCYAN;
STICKLINE(TT2,MAX(H,REF(H,1)),MIN(L,REF(L,1)),0,0)COLORCYAN;
STICKLINE(TT2,REF(O,1),C,3,0)COLORCYAN;
STICKLINE(TT3,MAX(MAX(H,REF(H,1)),REF(H,2)),MIN(MIN(L,REF(L,1)),REF(L,2)),0,0)COLORCYAN;
STICKLINE(TT3,REF(O,2),C,3,0)COLORCYAN;
STICKLINE(TT4,MAX(MAX(MAX(H,REF(H,1)),REF(H,2)),REF(H,3)),MIN(MIN(MIN(L,REF(L,1)),REF(L,2)),REF(L,3)),0,0)COLORCYAN;
STICKLINE(TT4,REF(O,3),C,3,0)COLORCYAN;
STICKLINE(TT5,MAX(MAX(MAX(MAX(H,REF(H,1)),REF(H,2)),REF(H,3)),REF(H,4)),MIN(MIN(MIN(MIN(L,REF(L,1)),REF(L,2)),REF(L,3)),REF(L,4)),0,0)COLORCYAN;
STICKLINE(TT5,REF(O,4),C,3,0)COLORCYAN;
STICKLINE(TT6,MAX(MAX(MAX(MAX(MAX(H,REF(H,1)),REF(H,2)),REF(H,3)),REF(H,4)),REF(H,5)),MIN(MIN(MIN(MIN(MIN(L,REF(L,1)),REF(L,2)),REF(L,3)),REF(L,4)),REF(L,5)),0,0)COLORCYAN;
STICKLINE(TT6,REF(O,5),C,3,0)COLORCYAN;
STICKLINE(TT7,MAX(MAX(MAX(MAX(MAX(MAX(H,REF(H,1)),REF(H,2)),REF(H,3)),REF(H,4)),REF(H,5)),REF(H,6)),MIN(MIN(MIN(MIN(MIN(MIN(L,REF(L,1)),REF(L,2)),REF(L,3)),REF(L,4)),REF(L,5)),REF(L,6)),0,0)COLORCYAN;
STICKLINE(TT7,REF(O,6),C,3,0)COLORCYAN;
STICKLINE(TT8,MAX(MAX(MAX(MAX(MAX(MAX(MAX(H,REF(H,1)),REF(H,2)),REF(H,3)),REF(H,4)),REF(H,5)),REF(H,6)),REF(H,7)),MIN(MIN(MIN(MIN(MIN(MIN(MIN(L,REF(L,1)),REF(L,2)),REF(L,3)),REF(L,4)),REF(L,5)),REF(L,6)),REF(L,7)),0,0)COLORCYAN;
STICKLINE(TT8,REF(O,7),C,3,0)COLORCYAN;
M5:MA(C,5);
M10:MA(C,10);
M20:MA(C,20);
M30:MA(C,30);
M60:MA(C,60);
M120:MA(C,120);
MA250:MA(C,250);