通达信操盘马力主图指标(源码)
BCTC:=BARSCOUNT(C);
LC:=REF(CLOSE,1);
MID:=(3*CLOSE+LOW+OPEN+HIGH)/6;
BBI:=(MA(CLOSE,3)+MA(CLOSE,6)+MA(CLOSE,12)+MA(CLOSE,24))/4,COLORAA16FF;
顶UPR:=BBI+3*STD(BBI,13),COLOR004AFF;
底DWN:=BBI-3*STD(BBI,13),COLOR67FF00;
爆发临界:=BBI>REF(BBI,1) AND LLV(顶UPR-底DWN,3)=(顶UPR-底DWN) AND CROSS(C,顶UPR),COLORRED,LINESTICK;
DRAWBAND(BBI,RGB(57,55,00),底DWN,RGB(57,55,00));
DRAWBAND(BBI,RGB(25,45,55),顶UPR,RGB(25,45,55));
PE:MID/FINANCE(33),COLOR1816FF,NODRAW;{年市盈率}
BBI线:(MA(CLOSE,5)+MA(CLOSE,10)+MA(CLOSE,15)+MA(CLOSE,20))/4,COLORFFAA16;
DRAWKLINE(HIGH,OPEN,LOW,CLOSE);
{量能平台}
HV:=HHV(V,20)=V OR V/REF(V,1)>=5 ;
FT:=BARSLAST(HV);
量能平台1:IF(HV,C,REF(C,FT)),COLOR18AFAF,POINTDOT;{白点DOTLINE}
{量能平台2}
PTN:=10;
PT1:=CONST(HHVBARS(V,10)),COLOR0000FF,LINETHICK1;
量能平台:IF(CURRBARSCOUNT<=PTN+7,CONST(IF(PT1=0,C,REF(C,PT1))),DRAWNULL),COLOR1FFFFF,LINETHICK1,DOTLINE;{CURRBARSCOUNT<=PTN+15}
DRAWTEXT(ISLASTBAR,量能平台," 量台"),COLOR18FFFF;
CPX40:=WMA(MID,40);
CPX30:=WMA(MID,30);
CPX20:=WMA(MID,20);
CPX15:=WMA(MID,15);
CPX10:=WMA(MID,10);
CPX5:=WMA(MID,5);
CPX3:=WMA(MID,3);
STZF:=(MAX(CLOSE,OPEN)/MIN(CLOSE,OPEN)-1)*100;
均STZF:=(SUM(STZF,21)-STZF)/20;
DYX:=CLOSE<LC AND (100*(LC-CLOSE)/LC>(均STZF*2.5));
ZNCPX3:=IFF(DYX,(6*CLOSE+2*REF(MID,1)+1*REF(MID,2))/9,CPX3);
DYKX:=CLOSE>LC AND (100*(CLOSE-LC)/LC>(均STZF*2.5));
ZNCPX5:=IFF(DYKX,(6*CLOSE+2*REF(MID,1)+1*REF(MID,2))/9,CPX5);
CPMXK:=CPX20;
CPMXM:=CPX30;
CPKXM:=ZNCPX3;
CPKXK:=ZNCPX3;
UP:=CPX30>REF(CPX30,1);
DOWN:=CPX30<REF(CPX30,1);
CPXM:=IFF(UP,CPMXK,IFF(DOWN,CPMXM,0));
CPXK:=IFF(UP,CPKXM,IFF(DOWN,CPKXK,0));
D:=CPXK> CPXM;
K:=CPXK<=CPXM;
长:=WMA(MID,30);
中:=WMA(MID,20);
短:=WMA(MID,10);
SXX:=短>REF(短,1) AND 中<REF(中,1) AND 长<REF(长,1);
SMX:=短>REF(短,1) AND 中>REF(中,1) AND 长<REF(长,1);
SML:=短>REF(短,1) AND 中>REF(中,1) AND 长>REF(长,1);
SXL:=短>REF(短,1) AND 中<REF(中,1) AND 长>REF(长,1);
XML:=短<REF(短,1) AND 中>REF(中,1) AND 长>REF(长,1);
XXL:=短<REF(短,1) AND 中<REF(中,1) AND 长>REF(长,1);
XXX:=短<REF(短,1) AND 中<REF(中,1) AND 长<REF(长,1);
均线最大:=MAX(CPX5,MAX(CPX10,MAX(CPX20,MAX(CPX30,CPX40))));
均线最小:=MIN(CPX5,MIN(CPX10,MIN(CPX20,MIN(CPX30,CPX40))));
高缠绕度:=1000*(均线最大/均线最小-1)<27;
低缠绕度:=1000*(均线最大/均线最小-1)>=27;
投机:=10;
试盘:=IFF(SXX,20,0);
加仓:=IFF(SMX AND D,40,IFF(SMX AND K,20,0));
重仓:=IFF(SML AND D AND 低缠绕度,90,IFF(SML AND D AND 高缠绕度,60,IFF(SML AND K,20,0)));
高仓:=IFF(SXL AND D AND 低缠绕度,70,IFF(SXL AND D AND 高缠绕度,40,IFF(SXL AND K,20,0)));
减仓:=IFF(XML AND D,60,IFF(XML AND K,20,0));
轻仓:=IFF(XXL AND D,30,IFF(XXL AND K,20,0));
空仓:=IFF(XXX,0,0);
仓位1:=IFF(SML AND D AND 低缠绕度,90,IFF(SXL AND D AND 低缠绕度,70,IFF((XML AND D) OR (SML AND D AND 高缠绕度),60,IFF((1/2)==10,50,IFF((SMX AND D) OR (SXL AND D AND 高缠绕度),40,IFF(XXL AND D,30,0))))));
仓位2:=IFF(SXX OR (SMX AND K) OR (SML AND K) OR (SXL AND K) OR
(XML AND K) OR (XXL AND K),20,10);
仓位A:=MAX(仓位1,仓位2);
配置仓位:=IFF(((REF(仓位A,1)==90) OR (REF(仓位A,1)==70)) AND (仓位A<=50 AND 仓位A>=30),60,仓位A),NODRAW,COLORWHITE;
修正一天:=COUNT(配置仓位>=70,2)==1 AND COUNT(配置仓位>=30 AND 配置仓位<=60,2)==1;
修正二天:=COUNT(配置仓位>=70,3)==1 AND COUNT(配置仓位>=30 AND 配置仓位<=60,3)==2;
修正三天:=COUNT(配置仓位>=70,4)==1 AND COUNT(配置仓位>=30 AND 配置仓位<=60,4)==3;
修正四天:=COUNT(配置仓位>=70,5)==1 AND COUNT(配置仓位>=30 AND 配置仓位<=60,5)==4;
修正五天:=COUNT(配置仓位>=70,6)==1 AND COUNT(配置仓位>=30 AND 配置仓位<=60,6)==5;
修正六天:=COUNT(配置仓位>=70,7)==1 AND COUNT(配置仓位>=30 AND 配置仓位<=60,7)==6;
修正七天:=COUNT(配置仓位>=70,8)==1 AND COUNT(配置仓位>=30 AND 配置仓位<=60,8)==7;
修正八天:=COUNT(配置仓位>=70,9)==1 AND COUNT(配置仓位>=30 AND 配置仓位<=60,9)==8;
修正九天:=COUNT(配置仓位>=70,10)==1 AND COUNT(配置仓位>=30 AND 配置仓位<=60,10)==9;
修正十天:=COUNT(配置仓位>=70,11)==1 AND COUNT(配置仓位>=30 AND 配置仓位<=60,11)==10;
修正十一天:=COUNT(配置仓位>=70,12)==1 AND COUNT(配置仓位>=30 AND 配置仓位<=60,12)==11;
修正十二天:=COUNT(配置仓位>=70,13)==1 AND COUNT(配置仓位>=30 AND 配置仓位<=60,13)==12;
修正十三天:=COUNT(配置仓位>=70,14)==1 AND COUNT(配置仓位>=30 AND 配置仓位<=60,14)==13;
蓝:=配置仓位<=20;
红:=(配置仓位>=70) OR 修正一天 OR 修正二天 OR 修正三天 OR 修正四天 OR 修正五天 OR 修正六天 OR
修正七天 OR 修正八天 OR 修正九天 OR 修正十天 OR 修正十一天 OR 修正十二天 OR 修正十三天;
黄:=(红==0) AND (蓝==0);
VAR1:=EMA(EMA(CLOSE,9),9);
控盘:=((VAR1-REF(VAR1,1))/REF(VAR1,1)*1000)>0;
- 上一篇公式:通达信牛逼主图及选股指标(源码)
- 下一篇公式:通达信波动级别指标(源码)