通达信龙虎榜副图指标 公式源码
公式解读:
[源码注释]通达信公式动态公式解读
市盈率赋值:收盘价/每股收益(全年折算)
年化收益赋值:1/市盈率*100
年化收益 =30
公式解读:
{参数N:7;M:135}
AA:=C-MA(C,N);
UP1:=FINDHIGH(AA,0,M,1);
UP2:=FINDHIGH(AA,0,M,2);
UP3:=FINDHIGH(AA,0,M,3);
UP:=(UP1+UP2+UP3)/3;
DW1:=FINDLOW(AA,0,M,1);
DW2:=FINDLOW(AA,0,M,2);
DW3:=FINDLOW(AA,0,M,3);
DW:=(DW1+DW2+DW3)/3;
超买价:7/6*UP*0.9+REF(MA(H,6),1),LINETHICK1,COLORLIGREEN;
超卖价:7/6*DW*0.9+REF(MA(L,6),1),LINETHICK1,COLORLIGREEN;
中间价:REF(EMA(C,3),3),COLORFFFFFF;
DRAWICON(HIGH 超买价,HIGH*1.01,2);
DRAWICON(LOW 超卖价,LOW*0.99,1);
VAR1:=EMA(EMA(CLOSE,9),9);
VAR2:=100*WINNER(CLOSE*0.95);
控盘:=(VAR1-REF(VAR1,1))/REF(VAR1,1)*1000;
DIF:=EMA(CLOSE,12)-EMA(CLOSE,26),NODRAW,COLORWHITE;
DEA:=EMA(DIF,9);
MACD:(DIF-DEA)*2,NODRAW;
TR:=EXPMEMA(MAX(MAX(HIGH-LOW,ABS(HIGH-REF(CLOSE,1))),ABS(REF(CLOSE,1)-LOW)),14);
HD:=HIGH-REF(HIGH,1);
LD:=REF(LOW,1)-LOW;
DMP:=EXPMEMA(IF(HD 0 HD LD,HD,0),14);
DMM:=EXPMEMA(IF(LD 0 LD HD,LD,0),14);
PDI:=DMP*100/TR;
MDI:=DMM*100/TR;
DM:PDI-MDI,COLORWHITE,NODRAW;
ADX:EXPMEMA(ABS(MDI-PDI)/(MDI+PDI)*100,6),COLORFF00FF,NODRAW;
ADXR:EXPMEMA(ADX,6),COLORGREEN,NODRAW;
加速:IF(DM 0ANDADXR REF(ADXR,1)ANDADXR 20,控盘*1.1,DRAWNULL),CIRCLEDOT,COLORRED{持股};
盘升:IF(DM 0ANDADXR REF(ADXR,1)ANDADXR 20,控盘*1.2,DRAWNULL),CIRCLEDOT,COLORYELLOW;
空头:IF(控盘 0ANDDM 0,控盘*1.2,DRAWNULL),CROSSDOT,COLORGREEN;
多头:IF(DM 0ANDADXR REF(ADXR,1),控盘*1.2,DRAWNULL),CROSSDOT,COLORRED;
DRAWTEXT(CROSS(ADXR,ADX)ANDADXR 60AND控盘 0AND控盘 REF(控盘,1),控盘*1.3, ←改 ),COLORGREEN;
DRAWICON(CROSS(MDI,PDI)AND控盘 0,控盘*1.3,2);
DRAWTEXT(CROSS(ADXR,ADX)ANDADXR =20ANDADXR 60AND控盘 0AND控盘 REF(控盘,1),控盘*1.3, ←变 ),COLORYELLOW;
DRAWTEXT(CROSS(ADXR,ADX)ANDADXR 20ANDDM 0,控盘*1.3, ←变化 ),COLORWHITE;
STICKLINE(控盘 0AND控盘 REF(控盘,1),控盘,0,1.6,0),COLORWHITE;
无庄:IF(控盘 0,控盘,0),COLORWHITE,NODRAW;
STICKLINE(控盘 0AND控盘 REF(控盘,1),控盘,0,1.6,0),COLORFFCC66;
STICKLINE(控盘 REF(控盘,1)AND控盘 0,控盘,0,1.6,0),COLORRED;
有庄:IF(控盘 REF(控盘,1)AND控盘 0,控盘,0),COLORRED,NODRAW;
STICKLINE(VAR2 50ANDCOST(85) CLOSEAND控盘 0,控盘,0,1.6,0),COLORFF00FF;
高度:IF(VAR2 50ANDCOST(85) CLOSEAND控盘 0,控盘,0),COLORFF00FF,NODRAW;
STICKLINE(控盘 REF(控盘,1)AND控盘 0,控盘,0,1.6,0),COLOR00FF00;
出货:IF(控盘 REF(控盘,1)AND控盘 0,控盘,0),COLOR00FF00,NODRAW;
DRAWTEXT(CROSS(DIF,DEA)ANDDIF 0,控盘*1.1, B ),COLORRED;
DRAWTEXT(CROSS(DEA,DIF)ANDDIF 0,控盘*1.1, S ),COLORGREEN;
DRAWTEXT(CROSS(DIF,DEA)ANDDIF 0,控盘*1.1, ←B ),COLORRED;
DRAWTEXT(CROSS(DEA,DIF)ANDDIF 0,控盘*1.1, ←S ),COLORGREEN;
STICKLINE(ADXR REF(ADXR,1),控盘*0.382,0,1,0),COLORYELLOW;
STICKLINE(ADXR REF(ADXR,1),控盘*0.382,0,1,0),COLORBLUE;
启动1:=(CROSS(控盘,0)ANDDM 0ANDMACD 0)OR(CROSS(DM,0)AND控盘 0ANDMACD 0)OR(CROSS(MACD,0)ANDDM 0AND控盘
启动:IF(启动1,5,0),LINETHICK1,COLORYELLOW;
TODAY:=DYNAINFO(7)=CLOSEandDYNAINFO(10)=AMOUNTANDTIME0 55800;
特买:if(today, 55188@龙虎 (1), zxDATA@BIGORDER (1,3));
特卖:if(today, 55188@龙虎 (8), zxDATA@BIGORDER (2,3));
大买:if(today, 55188@龙虎 (2), zxDATA@bigorder (1,2)- zxDATA@bigorder (1,3));
大卖:if(today, 55188@龙虎 (7), zxDATA@bigorder (2,2)- zxDATA@bigorder (2,3));
中买:if(today, 55188@龙虎 (3), zxDATA@bigorder (1,1)- zxDATA@bigorder (1,2));
中卖:if(today, 55188@龙虎 (6), zxDATA@bigorder (2,1)- zxDATA@bigorder (2,2));
{凤凰龙虎榜}
BB:=BARPOS=SYSPARAM(1);
VARIABLE:WDAY[7]= 星期六
WDAY[1]:= 星期日
WDAY[2]:= 星期一
WDAY[3]:= 星期二
WDAY[4]:= 星期三
WDAY[5]:= 星期四
WDAY[6]:= 星期五
FY:=YEAR;
FM:=MONTH;
FD:=DAY;
WD:=WEEKDAY;
P:=SYSPARAM(1);
STR1:= + 今日: +NUMTOSTR(FY[P],0)+ 年 +NUMTOSTR(FM[P],0)+ 月 +NUMTOSTR(FD[P],0)+ 日 +WDAY[WD[P]+1];
DRAWTEXTEX(CLOSE,1,180,10,STR1),colorFF00;
沪昨金【亿元】:REF( SH1A0001$AMOUNT ,1)/100000000,LINETHICK0,PRECISION2,color91FFEF;
沪今量: SH1A0001$VOL ,LINETHICK0,PRECISION0,color91FFEF;
深昨金【亿元】:REF( SZ399001$AMOUNT ,1)/100000000,LINETHICK0,PRECISION2,color9CFF7A;
沪深A股:STKCOUNT( A股板块 ),LINETHICK0;
{分时监控}
N:=0;
中单买入:= FHLHB.中买#day
中单卖出:= FHLHB.中卖#day
大单买入:= FHLHB.大买#day
大单卖出:= FHLHB.大卖#day
特大买入:= FHLHB.特买#day
特大卖出:= FHLHB.特卖#day
小单买入:=1-(中单买入+大单买入+特大买入);
小单卖出:=1-中单卖出-大单卖出-特大卖出;
主力买入:=特大买入+大单买入;
主力卖出:=特大卖出+大单卖出;
中单买:=AMOUNT*中单买入/10000;
中单卖:=AMOUNT*中单卖出/10000;
大单买:=AMOUNT*大单买入/10000;
大单卖:=AMOUNT*大单卖出/10000;
特大买:=AMOUNT*特大买入/10000;
特大卖:=AMOUNT*特大卖出/10000;
小单买:=AMOUNT*小单买入/10000;
小单卖:=AMOUNT*小单卖出/10000;
主力买:=特大买+大单买;
主力卖:=特大卖+大单卖;
小单净买:=SUM(小单买-小单卖,N);
中单净买:=SUM(中单买-中单卖,N);
大单净买:=SUM(大单买-大单卖,N);
特大净买:=SUM(特大买-特大卖,N);
主力净买:=SUM(主力买-主力卖,N);
散户:=小单净买,LINETHICK1,colorgreen;
中户:=中单净买,LINETHICK1,colorcyan;
大户:=大单净买,LINETHICK1,colormagenta;
超大:=特大净买,LINETHICK1,colorred;
主力:=主力净买,LINETHICK1,coloryellow;
KS:=DATACOUNT;
DRAWTEXT(BARPOS=KS-18,0, 主力n +NUMTOSTR(主力/(IF(CAPITAL 1,CAPITAL,0))*100,2)),ALIGN5,PXUP48,coloryellow;
DRAWTEXT(BARPOS=KS-15,0, 超大n +NUMTOSTR(超大/(IF(CAPITAL 1,0,CAPITAL))*100,2)),ALIGN5,PXUP48,colorred;
DRAWTEXT(BARPOS=KS-11,0, 大户n +NUMTOSTR(大户/(IF(CAPITAL 1,0,CAPITAL))*100,2)),ALIGN5,PXUP48,colormagenta;
DRAWTEXT(BARPOS=KS-8,0, 中户n +NUMTOSTR(中户/(IF(CAPITAL 1,0,CAPITAL))*100,2)),ALIGN5,PXUP48,colorcyan;
DRAWTEXT(BARPOS=KS-5,0, 散户n +NUMTOSTR(散户/(IF(CAPITAL 1,0,CAPITAL))*100,2)),ALIGN5,PXUP48,colorgreen;
STICKLINE(BARPOS=DATACOUNT-18,0,主力[P],20,0),coloryellow;
STICKLINE(BARPOS=DATACOUNT-15,0,超大[P],20,0),colorred;
STICKLINE(BARPOS=DATACOUNT-11,0,大户[P],20,0),colormagenta;
STICKLINE(BARPOS=DATACOUNT-8,0,中户[P],20,0),colorcyan;
STICKLINE(BARPOS=DATACOUNT-5,0,散户[P],20,0),colorgreen;
DRAWTEXTEX(CLOSE,1,10,10,STKLABEL+ +STKNAME+ ),colorFF00;
DRAWTEXTEX(CLOSE,1,10,150, 主力: + +NUMTOSTR(主力[P],0)),coloryellow;
DRAWTEXTEX(CLOSE,1,10,300, 超大: + +NUMTOSTR(超大[P],0)),colorred;
DRAWTEXTEX(CLOSE,1,10,450, 大户: + +NUMTOSTR(大户[P],0)),colormagenta;
DRAWTEXTEX(CLOSE,1,10,600, 中户: + +NUMTOSTR(中户[P],0)),colorcyan;
DRAWTEXTEX(CLOSE,1,10,750, 散户: +NUMTOSTR(散户[P],0)),colorgreen;