当前位置:分析家公式网 → 股票公式 → 通达信公式 → 一键转帖:通达信划线主图(通达信公式 主图 源码 测试图)
软件名称:[B]通达信划线主图(通达信公式 主图 源码 测试图)[/B]
软件类型:国产软件
运行环境:Win9X/Win2000/WinXP/Win2003/Win7/
软件语言:简体中文
授权方式:免费版
软件大小:0 Bytes
官方主页:Home Page
更新时间:2020-03-10 00:04:08
软件简介:
通达信划线主图
本人是懒人一个,不想一个一个手工画,所以动手编写写了一个划线公式,通达信的!
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;
[url=http://www.70822.com/soft/sort013/sort05/down-145812.html]通达信划线主图(通达信公式 主图 源码 测试图)[/url]