把通达信的“突破瞬间”主图指标改成大智慧的
2020/1/21 18:22:06
公式编写说明:
获利%:WINNER(CLOSE)*100,NODRAW,COLORWHITE;DRAWTEXT_FIX(获利%>=95 AND ISLASTBAR,0.97,0.97,0,'高危'),COLORRED;DRAWTEXT_FIX(获利%>=80 AND 获利%<95 AND ISLASTBAR,0.97,0.97,0,'风险'),COLORYELLOW;DRAWTEXT_FIX(获利%>=50 AND 获利%<80 AND ISLASTBAR,0.97,0.97,0,'安全'),COLORGREEN;DRAWTEXT_FIX(获利%<50 AND ISLASTBAR,0.97,0.97,0,'空头'),COLORBLUE;STICKLINE((C-REF(C,1))*100/REF(C,1)>=(10-0.01*100/REF(C,1)),OPEN,CLOSE,3,0),COLOR0055FF;STICKLINE((REF(C,1)-C)*100/REF(C,1)>=(10-0.01*100/REF(C,1)),OPEN,CLOSE,3,0),COLOR00FF00;N:=10;T1:=CONST(HHVBARS(V,N));T0:IF(CURRBARSCOUNT<=N+3,CONST(IF(T1=0,C,REF(C,T1))),DRAWNULL),COLORFF00FF;IF(CURRBARSCOUNT=T1+1,T0,DRAWNULL),CIRCLEDOT,COLORFF00FF;DRAWTEXT(ISLASTBAR,T0,' 量能平台'),COLORCC00CC;M:=10;Q1:=CONST(REF(HHVBARS(V,M),T1+1)+T1+1);Q0:IF(CURRBARSCOUNT<=T1+M+3 AND CURRBARSCOUNT>=T1+1,CONST(REF(C,Q1)),DRAWNULL),COLOR009900;IF(CURRBARSCOUNT=Q1+1,Q0,DRAWNULL),CIRCLEDOT,COLOR00CC00;M1:=CONST(LLVBARS(V,M));M0:IF(CURRBARSCOUNT<=M+7,CONST(IF(M1=0,O,REF(O,M1))),DRAWNULL); IF(CURRBARSCOUNT=M1+1,M0,DRAWNULL),CIRCLEDOT;DRAWTEXT(ISLASTBAR,M0,' 地量反量能平台');HV:=HHV(V,8)=V OR V/REF(V,1)>=2;FT:=BARSLAST(HV);量能平台:IF(HV,C,REF(C,FT)),COLORYELLOW,LINETHICK2;DP:=IF(C=INDEXC,0,1);GJ:=AMOUNT/V/100;【明日阻力】:L+(GJ-L)+(C-L),COLORRED,NODRAW;【明日支撑】:L+(C-GJ),NODRAW;年:=YEAR,NODRAW;月:=MONTH,NODRAW;星期:=WEEKDAY,NODRAW;日1:=DATETODAY(DATE);上市日:=REF(DATE,TOTALBARSCOUNT-CURRBARSCOUNT);自然日:=日1-DATETODAY(上市日)+1;ZB:=(自然日-REF(自然日,1))!=星期-REF(星期,1)OR TOTALBARSCOUNT-CURRBARSCOUNT=0;本周第几天:=BARSLAST(ZB)+1;本月第几天:=BARSLAST(年*100+月!=REF(年*100+月,1))+1;MA1:=REF(C,本周第几天);MA2:=REF(MA1,本周第几天);MA3:=REF(MA2,本周第几天);MA4:=REF(MA3,本周第几天);MA5:=REF(MA4,本周第几天);MA6:=REF(MA5,本周第几天);MA7:=REF(MA6,本周第几天);MA8:=REF(MA7,本周第几天);MA9:=REF(MA8,本周第几天);十周价:=(C+MA1+MA2+MA3+MA4+MA5+MA6+MA7+MA8+MA9)/10;决策:REFDATE(十周价,DATE),COLORYELLOW,LINETHICK1;DRAWTEXT(ISLASTBAR,决策,' 决策线'),COLORYELLOW;
公式源码示例:
获利%:WINNER(CLOSE)*100,LINETHICK0,COLORWHITE;
SS:=FLOOR(获利%)/100;
DRAWRECTABS(20,5,200*SS,30,RGB(200,200,200));
DRAWRECTABS(20,5,200,30,0),COLORGREEN;
DRAWRECTABS(20,5,100,30,0),COLORGREEN;
DRAWRECTABS(20,5,160,30,0),COLORGREEN;
DRAWRECTABS(20,5,190,30,0),COLORGREEN;
DRAWTEXTREL(25,105,'↑空头'+' '+'↑安全'+' '+'↑风险'+''+'↑高危'),COLORWHITE;
N:=10;
T1:=BACKSET(DISPSTATUS=2,HHVBARS(V,N));
T2:=BACKSET(DISPSTATUS=2,HHVBARS(V,N)+1);
T3:=BACKSET(DISPSTATUS=2,N+3);
T0:HHVALL((DISPSTATUS=2)*REF(C,BARSLAST(T1=0))),LINETHICK0,COLORFF00FF;
POLYLINE(T3>0,T0),COLORFF00FF;
DRAWTEXT(T2>REF(T2,1),MIN(C,O)/1.005,'◆'),COLORFF00FF,ALIGN1;
DRAWTEXT(T3>REF(T3,1),T0/1.005,'量能平台'),COLORCC00CC;
M:=10;
Q1:=REF(HHVBARS(V,M),HHVBARS(V,M)+1)+HHVBARS(V,M)+1;
Q2:=BACKSET(DISPSTATUS=2,Q1);
Q3:=BACKSET(DISPSTATUS=2,Q1+1);
Q4:=BACKSET(DISPSTATUS=2,Q1+3);
Q0:HHVALL((DISPSTATUS=2)*REF(C,BARSLAST(Q2=0))),LINETHICK0,COLOR009900;
DRAWTEXT(Q3>REF(Q3,1),MAX(C,O),'◆'),COLOR009900,ALIGN1;
POLYLINE(Q4>0 AND T2=0,Q0),COLOR009900;
M1:=BACKSET(DISPSTATUS=2,LLVBARS(V,M));
M2:=BACKSET(DISPSTATUS=2,LLVBARS(V,M)+1);
M3:=BACKSET(DISPSTATUS=2,M+7);
M0:HHVALL((DISPSTATUS=2)*REF(MIN(C,O),BARSLAST(M1=0))),LINETHICK0,ColorC8C8C8;
DRAWTEXT(M2>REF(M2,1),MIN(C,O)/1.005,'◆'),ColorC8C8C8,ALIGN1;
POLYLINE(M3>0,M0),ColorC8C8C8;
DRAWTEXT(M3>REF(M3,1),M0/1.005,'地量反量能平台'),ColorC8C8C8;
HV:=HHV(V,8)=V OR V/REF(V,1)>=2;
FT:=BARSLAST(HV);
量能平台:IF(HV,C,REF(C,FT)),COLORYELLOW,LINETHICK2;
DP:=IF(C=INDEXC,0,1);
GJ:=AMOUNT/V/100;
【明日阻力】:L+(GJ-L)+(C-L),COLORRED,LINETHICK0;
【明日支撑】:L+(C-GJ),LINETHICK0;
年:=YEAR;
月:=MONTH;
星期:=WEEKDAY;
日1:=DATETOD1970(DATE);
上市日:=REF(DATE,BARPOS-1);
自然日:=日1-DATETOD1970(上市日)+1;
ZB:=(自然日-REF(自然日,1))<>星期-REF(星期,1) OR BARPOS=1;
本周第几天:=BARSLAST(ZB)+1;
本月第几天:=BARSLAST(年*100+月<>REF(年*100+月,1))+1;
MA1:=REF(C,本周第几天);
MA2:=REF(MA1,本周第几天);
MA3:=REF(MA2,本周第几天);
MA4:=REF(MA3,本周第几天);
MA5:=REF(MA4,本周第几天);
MA6:=REF(MA5,本周第几天);
MA7:=REF(MA6,本周第几天);
MA8:=REF(MA7,本周第几天);
MA9:=REF(MA8,本周第几天);
十周价:=(C+MA1+MA2+MA3+MA4+MA5+MA6+MA7+MA8+MA9)/10;
决策:HHVALL(IF(DISPSTATUS=2,十周价,0)),COLORYELLOW;
DRAWTEXT(BARSLAST(DISPSTATUS=1)=3,决策/1.005,'决策线'),COLORYELLOW,LINETHICK2;
看 股吧公式 www.k anguba.com
其它股票公式列表