当前位置: 网站首页 > 股票软件公式 > 通达信公式 > 文章 当前位置: 通达信公式 > 文章

通达信源码:划线主图,极品波段主图副图,T+0分时交易高低提示

点击: 次    来源:顶尖财经    作者:股市狙击 - 小 + 大

通达信划线主图:
 
本人是懒人一个,不想一个一个手工画,所以动手编写写了一个划线公式,通达信的!
 
UR:=IF(周期=1,13,IF(周期=2,55,IF(周期=3,144,5)));
LR:=IF(周期=1,13,IF(周期=2,55,IF(周期=3,144,5)));
TC1:=IF(H=HHV(H,8*UR),H,DRAWNULL);
TC2:=CONST(BARSLAST(TC1=H))+1;
UPPER:=CONST(IF(TC2=1,H,REF(H,TC2-1)));
BC1:=IF(L=LLV(L,8*LR),L,DRAWNULL);
BC2:=CONST(BARSLAST(BC1=L))+1;
LOWER:=CONST(IF(BC2=1,L,REF(L,BC2-1)));
LP:=CURRBARSCOUNT<=BC2 AND L=LOWER;{低点定位}
HP:=CURRBARSCOUNT<=TC2 AND H=UPPER;{高点定位}
NOD:=(IF(TC2>BC2,TC2,BC2)-IF(TC2>BC2,BC2,TC2));{用时}
LR1:=FORCAST(C,NOD+1);
NP:=IF(CURRBARSCOUNT<=MAX(BC2,TC2),CONST(IF(MIN(TC2,BC2)=1,LR1,REF(LR1,MIN(TC2,BC2)-1))),DRAWNULL),POINTDOT,COLOR93BDA8;{近点}
LR2:=SLOPE(C,NOD+1);
LR3:=CONST(IF(MIN(TC2,BC2)=1,LR2,REF(LR2,MIN(TC2,BC2)-1)));
FP:=NP-LR3*(NOD),POINTDOT,COLOR93BDA8;{远点}
EQU:=(NP+FP)/2,POINTDOT,COLOR93BDA8;
AD:=ABS(NP-FP);{高差};
DBL:=BARSLAST(BC1!=DRAWNULL)+1;
DBH:=BARSLAST(TC1!=DRAWNULL)+1;
BSP:=IF(BC2>TC2,DBL,DBH)-1;
LRL:=IF(NP>FP,FP+AD/NOD*BSP,FP-AD/NOD*BSP);
AT1:=IF(BETWEEN(CURRBARSCOUNT,BC2,TC2) AND H>LRL,H,LRL);
AT2:=HHV(AT1-LRL,MAX(BC2,TC2));
AT3:=CONST(BARSLAST(AT1-LRL=AT2));
AT4:=CONST(IF(AT3=0,H,REF(H,AT3)));
AT5:=CONST(IF(AT3=0,AT1-LRL,REF(AT1-LRL,AT3)));
ATL:=LRL+AT5;
UT1:=IF(BETWEEN(CURRBARSCOUNT,BC2,TC2) AND L<LRL,L,LRL);
UT2:=HHV(LRL-UT1,MAX(BC2,TC2));
UT3:=CONST(BARSLAST(LRL-UT1=UT2));
UT4:=CONST(IF(UT3=0,H,REF(H,UT3)));
UT5:=CONST(IF(UT3=0,LRL-UT1,REF(LRL-UT1,UT3)));
UTL:=LRL-UT5;
RH:=IF(CURRBARSCOUNT>=MIN(BC2,TC2)-10,ATL,CONST(REF(ATL,MIN(BC2,TC2)-11)));{限制高}
RL:=IF(CURRBARSCOUNT>=MIN(BC2,TC2)-10,UTL,CONST(REF(UTL,MIN(BC2,TC2)-11)));{限制低}
中轨:IF(NP>FP AND 线控=1,IF(LRL<=RH,LRL,DRAWNULL),IF(LRL>=RL,LRL,DRAWNULL)),COLORYELLOW,DOTLINE;
上轨:IF(NP>FP AND 线控=1,IF(ATL<=RH,ATL,DRAWNULL),IF(ATL>=RL,ATL,DRAWNULL)),COLORCYAN,DOTLINE;
下轨:IF(NP>FP AND 线控=1,IF(UTL<=RH,UTL,DRAWNULL),IF(UTL>=RL,UTL,DRAWNULL)),COLORBROWN,DOTLINE;
N10:=IF(大小压力切换=1,13,IF(大小压力切换=2,55,IF(大小压力切换=3,89,IF(大小压力切换=0,144,DRAWNULL))));
M:=INTPART(3*N10/5);
AAA:=REF(H,M)=HHV(H,2*M+1);
QYY:=BACKSET(AAA,M+1);
CCC:=FILTER(QYY,M) AND H=HHV(H,M+1);
DDDD:=BARSLAST(CCC),NODRAW;
GDTSS:=IF(CCC,CURRBARSCOUNT,0);
DINGBUTSS:=IF(DDDD,REF(GDTSS,DDDD),GDTSS);
GDCS11:=CONST(DINGBUTSS);
DINGBUTS11:=REF(DINGBUTSS,DDDD+1);
GDCS22:=CONST(DINGBUTS11);
AA11:=REF(L,M)=LLV(L,2*M+1);
QY11:=BACKSET(AA11,M+1);
CC11:=FILTER(QY11,M) AND L=LLV(L,M+1);
DD11:=BARSLAST(CC11);
DDTSS:=IF(CC11,CURRBARSCOUNT,0);
DDTS11:=IF(DD11,REF(DDTSS,DD11),DDTSS);
DDCS11:=CONST(DDTS11);
DDTS22:=REF(DDTS11,DD11+1);
DDCS22:=CONST(DDTS22);
FJTJ:=REF(H,CURRBARSCOUNT=GDCS22)-REF(L,CURRBARSCOUNT=DDCS22);
FJTJ2:=REF(H,CURRBARSCOUNT=GDCS11)-FJTJ;
顶:DRAWLINE(CURRBARSCOUNT=GDCS22  AND 线控=1,H,CURRBARSCOUNT=GDCS11,H,1),COLORB48246,LINETHICK1;
底:DRAWLINE(CURRBARSCOUNT=DDCS22 AND 线控=1,L,CURRBARSCOUNT=DDCS11,FJTJ2,1) COLOR0000C0,LINETHICK1;
N:=IF(原点控制=1,21,IF(原点控制=2,55,IF(原点控制=3,144,IF(原点控制=0,DRAWNULL,13))));
{通达信公式大全 分析家公式网www.70822.com}
A1:=REF(H,N)=HHV(H,2*N+1);
B1:=FILTER(A1,N);
C1:=BACKSET(B1,N+1);
D1:=FILTER(C1,N);{高点}
R11:=BACKSET(ISLASTBAR,BARSLAST(D1)+1); 
S11:=R11>REF(R11,1);
A2:=REF(L,N)=LLV(L,2*N+1);
B2:=FILTER(A2,N);
C2:=BACKSET(B2,N+1);
D2:=FILTER(C2,N);{低点}
T11:=BACKSET(ISLASTBAR,BARSLAST(D2)+1);
U11:=T11>REF(T11,1);
MM:=INTPART(3*N/5);
A12:=REF(H,MM)=HHV(H,2*MM+1);
B12:=FILTER(A12,MM);
C12:=BACKSET(B12,MM+1);
D12:=FILTER(C12,MM);{高点}
R112:=BACKSET(ISLASTBAR,BARSLAST(D12)+1); S112:=R112>REF(R112,1);
A22:=REF(L,MM)=LLV(L,2*MM+1);
B22:=FILTER(A22,MM);
C22:=BACKSET(B22,MM+1);
D22:=FILTER(C22,MM);{低点}
线1:DRAWLINE(D1 AND 线控=1,H,S112,H,1),COLOR00FF00,LINETHICK1;
线2:DRAWLINE(D2 AND 线控=1,L,S112,H,1),COLORYELLOW,LINETHICK1;
线3:DRAWLINE(D22 AND 线控=1,L,S112,H,1),COLOR0000FF,LINETHICK1;
线4:DRAWLINE(D12 AND 线控=1,H,S112,H,1),COLOR808000,LINETHICK1;
DRAWTEXT(S112 AND 线控=1,H*1.01,'◎'),COLORYELLOW;




极品波段 主图 和副图:

{极品波段}

VAR1:=EMA(CLOSE,15);

VAR2:=EMA(CLOSE,60);

红多:(CLOSE-VAR1)*2/(15+1)+VAR1,LINETHICK1, COLORRED;

VAR3:=(CLOSE-VAR2)*2/(60+1)+VAR2;

绿空:IF(红多>VAR3,VAR3,红多),LINETHICK1, COLORGREEN;

生命线:VAR3,LINETHICK2, COLORYELLOW;

HX:=HHV(HIGH,3);

LX:=LLV(LOW,3);

H1:=IF(HX<REF(HX,1)&&HX<REF(HX,2)&&HX<REF(HX,4)&&LX<REF(LX,1)&&LX<REF(LX,3)&&LX<REF(LX,5)&&OPEN>CLOSE&&(HHV(OPEN,0)-CLOSE)>0,REF(HX,4),0);

L1:=IF(LX>REF(LX,1)&&LX>REF(LX,3)&&LX>REF(LX,5)&&HX>REF(HX,1)&&HX>REF(HX,2)&&HX>REF(HX,4)&&OPEN<CLOSE&&(CLOSE-LLV(OPEN,0))>0,REF(LX,4),0);

H2:=VALUEWHEN(H1>0,H1);

L2:=VALUEWHEN(L1>0,L1);

K1:=IF(CLOSE>H2,-3,IF(CLOSE<L2,1,0));

K2:=VALUEWHEN(K1<>0,K1);

G:=IF(K2=1,H2,L2);

G1:=VALUEWHEN(ISLASTBAR,G);

TMP:=K2;

W1:=K2;

W2:=OPEN-CLOSE;

HT:=IF(OPEN>CLOSE,OPEN,CLOSE);

LT:=IF(OPEN<CLOSE,OPEN,CLOSE);

STICKLINE(W1=1,HIGH,HT,0,0),COLORCYAN;

STICKLINE(W1=1,LOW,LT,0,0),COLORCYAN;

STICKLINE(W1=-3,HIGH,HT,0,0),COLORRED;

STICKLINE(W1=-3,LOW,LT,0,0),COLORRED;

STICKLINE(W1>0,OPEN,CLOSE,3,1),COLORCYAN;

STICKLINE(W1<=0,OPEN,CLOSE,3,1),COLORRED;

STICKLINE(W2>0&&W1<=0,OPEN,CLOSE,3,0),COLORRED;

STICKLINE(W2>0&&W1>0,OPEN,CLOSE,3,0),COLORCYAN;

A:=WMA(HIGH,30);

B:=WMA(LOW,30);

A1:=WMA(HIGH,150),LINETHICK2;

B1:=WMA(LOW,150);

S1:=CROSS(CLOSE,WMA(HIGH,150));

X1:=CROSS(WMA(LOW,150),CLOSE);

WS1:=BARSLAST(S1)+1;

WX1:=BARSLAST(X1)+1;

SS1:=CROSS(SUM(S1,WX1),0.5);

XX1:=CROSS(SUM(X1,WS1),0.5);

S:=CROSS(CLOSE,WMA(HIGH,30));

X:=CROSS(WMA(LOW,30),CLOSE),LINETHICK2;

WS:=BARSLAST(S)+1,LINETHICK2;

WX:=BARSLAST(X)+1,LINETHICK2;

SS:=CROSS(SUM(S,WX),0.5);

XX:=CROSS(SUM(X,WS),0.5);

{STICKLINE(CLOSE>WMA(HIGH,30),WMA(HIGH,30),WMA(LOW,30),3,1),COLORMAGENTA;

STICKLINE(CLOSE<WMA(LOW,30),WMA(LOW,30),WMA(HIGH,30),3,1),COLORGREEN;}

STICKLINE(CLOSE>WMA(HIGH,150),WMA(HIGH,150),WMA(LOW,150),3,1),COLORRED;

STICKLINE(CLOSE<WMA(LOW,150),WMA(LOW,150),WMA(HIGH,150),3,1),COLORBLUE;

{IF(CLOSE>WMA(HIGH,30),WMA(HIGH,30),DRAWNULL),COLORMAGENTA;

IF(CLOSE<WMA(HIGH,30),WMA(HIGH,30),DRAWNULL),COLORGREEN;

IF(CLOSE>WMA(LOW,30),WMA(LOW,30),DRAWNULL),COLORMAGENTA;

IF(CLOSE<WMA(LOW,30),WMA(LOW,30),DRAWNULL),COLORGREEN;}

IF(CLOSE>WMA(HIGH,150),WMA(HIGH,150),DRAWNULL),COLORRED;

IF(CLOSE<WMA(HIGH,150),WMA(HIGH,150),DRAWNULL),COLORBLUE;

IF(CLOSE>WMA(LOW,150),WMA(LOW,150),DRAWNULL),COLORRED;

IF(CLOSE<WMA(LOW,150),WMA(LOW,150),DRAWNULL),COLORBLUE;

{STICKLINE(SUM(X,WS)>0.5 && CLOSE>=OPEN,OPEN,CLOSE,3,1),COLORCYAN;

STICKLINE(SUM(X,WS)>0.5 && CLOSE<OPEN,OPEN,CLOSE,3,0),COLORCYAN;

STICKLINE(SUM(X,WS)>0.5 AND CLOSE>OPEN,HIGH,CLOSE,0,0),COLORCYAN;

STICKLINE(SUM(X,WS)>0.5 AND CLOSE>OPEN,LOW,OPEN,0,0),COLORCYAN;

STICKLINE(SUM(X,WS)>0.5 AND CLOSE<OPEN,HIGH,OPEN,0,0),COLORCYAN;

STICKLINE(SUM(X,WS)>0.5 AND CLOSE<OPEN,LOW,CLOSE,0,0),COLORCYAN;

STICKLINE(SUM(X,WS)>0.5 AND CLOSE=OPEN,HIGH,LOW,0,0),COLORCYAN;

STICKLINE(SUM(S,WX)>0.5 && CLOSE>=OPEN,OPEN,CLOSE,3,1),COLORRED;

STICKLINE(SUM(S,WX)>0.5 && CLOSE<OPEN,OPEN,CLOSE,3,0),COLORRED;

STICKLINE(SUM(S,WX)>0.5 AND CLOSE>OPEN,HIGH,CLOSE,0,0),COLORRED;

STICKLINE(SUM(S,WX)>0.5 AND CLOSE>OPEN,LOW,OPEN,0,0),COLORRED;

STICKLINE(SUM(S,WX)>0.5 AND CLOSE<OPEN,HIGH,OPEN,0,0),COLORRED;

STICKLINE(SUM(S,WX)>0.5 AND CLOSE<OPEN,LOW,CLOSE,0,0),COLORRED;

STICKLINE(SUM(S,WX)>0.5 AND CLOSE=OPEN,HIGH,LOW,0,0),COLORRED;)

{//DRAWTEXT(SS,LOW-(LOW*0.002*LHS),'买');

//DRAWTEXT(XX,HIGH+(CLOSE*0.0015*LHS),'卖');};

YJD:=IF(DATE+19000000>20200413,1,0);

 DRAWTEXT_FIX(ISLASTBAR=1 AND YJD,0.1,0.2,0,'股票学校'),COLORYELLOW;





T+0分时交易高低提示:

几率很高!尤其是在股票和大盘在下降通道时候,几率更大!( 顶尖财经 股票学院: http://www.58188.com )

MA30:=EMA(CLOSE,30);
强弱:EMA(CLOSE,900);
STICKLINE((MA30>强弱),MA30,强弱,1,0),COLOR0000FF;
STICKLINE((MA30<强弱),MA30,强弱,1,0),COLOR00FF00;
H1:=MAX(DYNAINFO(3),DYNAINFO(5));
L1:=MIN(DYNAINFO(3),DYNAINFO(6));
P1:=H1-L1;
阻力:L1+P1*7/8,COLOR00DD00;
支撑:L1+P1*0.5/8,COLOR00DD00;
现价:CLOSE,COLORWHITE,LINETHICK1;
STICKLINE(CROSS(支撑,现价),支撑,阻力,1,0),COLORYELLOW;
DRAWTEXT(LONGCROSS(支撑,现价,2),支撑*1.001,'★B'),COLORYELLOW;{吸};
DRAWTEXT(LONGCROSS(现价,阻力,2),现价,'★'),COLORRED;{抛};

上一篇:通达信源码:趋势判牛支撑压力线,准波段王,精准波段背离

下一篇:通达信源码:抄底骑牛,龙线筹码主图,六轮定位