九毛八公式指标
公式模块:
{显示买卖}
BUYPRICE:="SHOWINV@BUYPRICE"(1);
buydate:="SHOWINV@date"(1);
DRAWTEXT(BUYPRICE> 0,BUYPRICE,'买入'+NUMTOSTR(BUYPRICE)),COLORffffff,linethick2;
SALEPRICE:="SHOWINV@SALEPRICE"(1);
DRAWTEXT(SALEPRICE> 0,SALEPRICE,'卖出'+NUMTOSTR(SALEPRICE)),COLORGREEN,linethick2;
DRAWTEXTABS(15,10,'【买入价:'),COLORffffff,linethick3;
IF BUYPRICE> 0 THEN BEGIN
DRAWTEXTABS(15,10,' '+NUMTOSTR(BUYPRICE)+'元 '),COLORffffff,linethick4;
DRAWTEXTABS(15,10,' 买入日期:'+NUMTOSTR(month)+'月'+NUMTOSTR(day)+'日】'), COLORwhite,LINETHICK3;
end
五日涨跌:(C-REF(CLOSE,5))/C*100,ColorFF00FF,LINETHICK0;
十日涨跌:(C-REF(CLOSE,10))/C*100,LINETHICK0;
WW:=BArslAST(DISPSTATUS=1);
低涨:(C/LLV(LOW,WW)-1)*100,COLOR0000FF,LINETHICK0,PRECIS2;
天:BARSLAST(L=LLV(LOW,WW)),COLOR00FFFF,LINETHICK0,PRECIS0;
{以下设置个股信息}
DRAWTEXTABS(15,50,'■所属板块:'+BKNAME),COLORFFFFFF;
DD:=FINANCE2(35)/10000;SS:=FINANCE2(37)/10000;
DRAWTEXTABS(15,65,'■总股本:'+NUMTOSTRN(DD,2)+'亿' +' 流通A股:'+NUMTOSTRN(SS,2)+'亿'),COLOR00FFFF;
DRAWTEXTABS(15,80,'■五日涨跌: '+NUMTOSTRN(ref(五日涨跌,0),2)+'% 十日涨跌: '+NUMTOSTRN(ref(十日涨跌,0),2)+'% 低点至今上涨:'+NUMTOSTRN(低涨,2)+'% '+NUMTOSTRN(天,0)+'天'),COLORD3A9FF;
a:="STSFunc@CALSTSL";
R1:="STSFunc@STS_RISK1";
R2:="STSFunc@STS_RISK2";
S1:="STSFunc@STS_STS1";
S2:="STSFunc@STS_STS2";
TBS:="STSFunc@STS_STSBS";
DN:="STSFunc@STS_STSDN";
UP:="STSFunc@STS_STSUP";
压力位:UP,linethick0,color0000ff,PRECIS2;
支撑位:DN,linethick0,color00ff00,PRECIS2;
警示位:IF(R1<>0,ABS(R1),IF(R2<>0,ABS(R2),0)),linethick0,colorff00ff,PRECIS2;
DRAWLINE(UP>0,UP,UP<>REF(UP,1) OR C=DYNAINFO(7),REF(ABS(UP),1),0),dotline,color0000ff,LINETHICK1;
DRAWLINE(DN>0,DN,DN<>REF(DN,1) OR C=DYNAINFO(7),REF(ABS(DN),1),0),dotline,color00ff00,LINETHICK1;
DRAWLINE(UP<0,-UP,UP<>REF(UP,1) OR C=DYNAINFO(7),REF(ABS(UP),1),0),color0000ff;
DRAWLINE(DN<0,-DN,DN<>REF(DN,1) OR C=DYNAINFO(7),REF(ABS(DN),1),0),color00ff00;
DRAWLINE(R1>0,R1,R1<>REF(R1,1) OR C=DYNAINFO(7),REF(ABS(R1),1),0),dotline,colorEE88ff;
DRAWLINE(R2>0,R2,R2<>REF(R2,1) OR C=DYNAINFO(7),REF(ABS(R2),1),0),dotline,colorEE88ff;
DRAWLINE(R1<0,-R1,R1<>REF(R1,1) OR C=DYNAINFO(7),REF(ABS(R1),1),0),colorEE88ff;
DRAWLINE(R2<0,-R2,R2<>REF(R2,1) OR C=DYNAINFO(7),REF(ABS(R2),1),0),colorEE88ff;
drawbmp(TBS=1,l*0.96,'STSbuy1.bmp'),align1,valign0;
drawbmp(TBS=-1,h*1.07,'STSsell1.bmp'),align1,valign0;
drawbmp(S2=14,l*0.94,'STSbuy.bmp'),align1,valign0;
drawbmp(S2=-14,h*1.09,'STSsell.bmp'),align1,valign0;
drawtext(S1>0,L,STR(S1)),color00FF00,LINETHICK1,align1,valign0;
drawtext(S1<0,H*1.03,STR(-S1)),color00FF00,LINETHICK1,align1,valign0;
drawtext(S2>0 and S2<13,l*0.97,STR(S2)),color0000FF,LINETHICK1,align1,valign0;
drawtext(S2<0 and S2>-13,H*1.06,STR(-S2)),color0000FF,LINETHICK1,align1,valign0;
drawtext(S2=13,l*0.97,'+'),color0000FF,LINETHICK1,align1,valign0;
drawtext(S2=14,l*0.97,'13'),color0000FF,LINETHICK1,align1,valign0;
drawtext(S2=-13,h*1.06,'+'),color0000FF,LINETHICK1,align1,valign0;
drawtext(S2=-14,h*1.06,'13'),color0000FF,LINETHICK1,align1,valign0;
DRAWGBK(v>=0,STRIP(RGB(18,19,51),RGB(1,155,155),0));
N:=2;
B1:=MA(CLOSE,1);
B2:=SMA(SMA(SMA(B1,2,1),2,1),2,1) ;
SMA2:=MA(B2,3) ;
FILLRGN(b2,sma2,b2>sma2),colorred;
FILLRGN(b2,sma2,b2<sma2),colorgreen;
a:="LTFunc6@FORLT2";
s1:="LTFunc6@LT_S1";
hs:="LTFunc6@LT_HS";
ls:="LTFunc6@LT_LS";
p1:="LTFunc6@LT_P1";
upp:="LTFunc6@LT_UPP";
udd:="LTFunc6@LT_UDD";
{hs;ls;hhs;lls;us;ds;s1;p1;p0;upp;udd};
xg:p1=1 and ref(p1,1)=0,linethick0;
d1:=ema(abs("ddx.ddx"),60);
d2:=max("ddx.ddx"/d1+7.5,7.5);
d3:=min("ddx.ddx"/d1,10);
fb:=if(s1=0,hs,ls);
tr0:=ifs(p1=1,'明日收盘价<'+numtostrn(udd,2)+',出现S点/n','若明日收盘价>'+numtostrn(upp,2)+',出现B点/n');
tr1:=ifs(s1=1,'明日收盘价<'+numtostrn(ls,2)+',短线卖出机会','若明日收盘价>'+numtostrn(hs,2)+'短线买入机会');
tr2:=ifs(p1=1,ifs(cross(p1,0),'B点','持股'),ifs(cross(1,p1),'S点','持币'));
tr3:=ifs(s1=0,'向下,','向上,');
tr4:='3.能量级别:'+numtostrn(d3,1)+'级';
bs:=''+datestr(date)+'买卖点决策系统提示/n'+'1.bs点:'+tr2+','+tr0+'2.短线:'+tr3+tr1+'/n'+tr4;
drawflagtext(1,fb,bs);
STICKLINE(CLOSE>OPEN or CLOSE=OPEN and CLOSE>REF(CLOSE,1),LOW,HIGH,0.1,0),colorred;
STICKLINE(CLOSE>OPEN or CLOSE=OPEN and CLOSE>REF(CLOSE,1),OPEN,CLOSE,7,0),colorred;
STICKLINE(CLOSE<OPEN or CLOSE=OPEN and CLOSE<=REF(CLOSE,1),LOW,HIGH,0.1,0),colorcyan;
STICKLINE(CLOSE<OPEN or CLOSE=OPEN and CLOSE<=REF(CLOSE,1),OPEN,CLOSE,7,0),colorcyan;
STICKLINE(OPEN>=CLOSE ,CLOSE ,OPEN,0,0 ),COLOR00FF00;
STICKLINE(OPEN>=CLOSE ,CLOSE ,OPEN,8,0 ),COLOR008800;
STICKLINE(OPEN>=CLOSE ,CLOSE ,OPEN,7,0 ),COLOR009900;
STICKLINE(OPEN>=CLOSE ,CLOSE ,OPEN,6,0 ),COLOR00AA00;
STICKLINE(OPEN>=CLOSE ,CLOSE ,OPEN,5,0 ),COLOR00BB00;
STICKLINE(OPEN>=CLOSE ,CLOSE ,OPEN,4,0 ),COLOR00CC00;
STICKLINE(OPEN>=CLOSE ,CLOSE ,OPEN,3,0 ),COLOR00DD00;
STICKLINE(OPEN>=CLOSE ,CLOSE ,OPEN,2,0 ),COLOR00EE00;
STICKLINE(OPEN>=CLOSE ,CLOSE ,OPEN,1,0 ),COLOR00FF00;
STICKLINE(CLOSE>OPEN,CLOSE,OPEN,0,0) ,COLORFFBBFF;
STICKLINE(CLOSE>OPEN,CLOSE,OPEN,6,0) ,COLORFF44FF;
STICKLINE(CLOSE>OPEN,CLOSE,OPEN,5,0) ,COLORFF66FF;
STICKLINE(CLOSE>OPEN,CLOSE,OPEN,4,0) ,COLORFF88FF;
STICKLINE(CLOSE>OPEN,CLOSE,OPEN,3,0) ,COLORFF99FF;
STICKLINE(CLOSE>OPEN,CLOSE,OPEN,2,0) ,COLORFFAAFF;
STICKLINE(CLOSE>OPEN,CLOSE,OPEN,1,0) ,COLORFFBBFF;
STICKLINE(p1=1 and c>=o and o<>0,c,o,d2,0),color5454ff;
STICKLINE(p1=1 and c>=o and o<>0,c,o,7.5,0),colorblack;
STICKLINE(p1=1 and c>=o and o<>0,c,c,7.5,0),color5454ff;
STICKLINE(p1=1 and c>=o and o<>0,o,o,7.5,0),color5454ff;
STICKLINE(p1=1 and c>=o and o<>0,o,c,7.5,1),color5454ff;
STICKLINE(p1=1 and c<=o,o,c,7.5,1),color5454ff;
STICKLINE(p1=1 and c<=o,l,c,0.5,1),color5454ff;
STICKLINE(p1=1 and c<=o,h,o,0.5,1),color5454ff;
STICKLINE((p1<>1 or barscount(c)<3) and c>=o,c,o,7.5,1),colorffff54;
STICKLINE((p1<>1 or barscount(c)<3) and c>=o,c,h,0.5,1),colorffff54;
STICKLINE((p1<>1 or barscount(c)<3) and c>=o,l,o,0.5,1),colorffff54;
drawbmp(p1=1 and ref(p1,1)=0,l,'buy1.bmp'),align1,valign0;
drawbmp(p1=0 and ref(p1,1)=1,h,'sell1.bmp'),align1,valign2;
drawbmp(s1=1 and ref(s1,1)=0 and (p1+ref(p1,1))<>1,l,'bs.bmp'),align1,valign0;
drawbmp(s1=0 and ref(s1,1)=1 and (p1+ref(p1,1))<>1,h,'ss.bmp'),align1,valign2;
背离解盘
SAT:=IF((AMOUNT/C)/(HHV(AMOUNT,20)/HHV(C,20))*100>100,100,(AMOUNT/C)/(HHV(AMOUNT,20)/HHV(C,20))*100);
DRAWTEXTREL(12,5,'量能饱和度:'+NUMTOSTRN(SAT,0)),LINETHICK3,Color8000FF;
AA10:MA(CLOSE,8),color0000FF;
AA12:MA(CLOSE,12),color0000FF;
BB10:=((ATAN((AA10 - REF(AA10,1))) * 3.1416) * 10);
BB12:=((ATAN((AA12 - REF(AA12,1))) * 3.1416) * 10);
MA13:=MA(CLOSE,13);
FILLRGN(AA10,AA12,(((AA12 <= AA10) AND (BB12 >= 1)) AND (BB10 >= 1))),Color0098FF;
FILLRGN(AA10,AA12,(((AA12 >= AA10) AND (BB10 <= 1)) AND (BB10 <= 1))),color00FF00;
x1:=(C+L+H)/3;
bb13:=atan(ema(x1,13)-ref(ema(x1,13),1))*3.1416*10;
ema8:=ema(c,8);
DRAWTEXT(filter(bb13>1 and ema(x1,13)>ref(ema(x1,8),1),10),
ema8,'∠45上升'),colorwhite;
压力:MA(REF(HHV(C,30),1),2),Color9DFFFF;
支撑:MA(REF(LLV(C,30),1),2),ColorABFF46;
AA1:=AMOUNT/V;
BB1:=L<AA1*0.9;
CC1:=(C-REF(C,1))/REF(C,1)*100>1.2;
DD1:=L<MA(C,5)*0.921;
EE1:=V<MA(V,5)*1.5;
FF1:=BB1 AND CC1 AND DD1 AND EE1;
DRAWTEXT(ff1,(LOW* 0.99),'老鼠仓'),Color4080FF;
A51:=3*SMA((C-LLV(L,55))/(HHV(H,55)-LLV(L,55))*100,5,1)-2*SMA((C-LLV(L,55))/(HHV(H,55)-LLV(L,55))*100,5,1);
黑马线:=EMA(A51,5);
A54:=((C-LLV(L,21))/(HHV(H,21)-LLV(L,21)))*100;
趋势线:=(MA(3*SMA(A54,6,1)-2*SMA(SMA(A54,5,1),5,1),2));
DRAWTEXT(CROSS(趋势线,0)AND 黑马线<40,(HIGH* 0.97),'▲大黑马'),COLORYELLOW;
LC:=REF(CLOSE,1);
rsi:=((SMA(MAX((CLOSE - LC),0),3,1) / SMA(ABS((CLOSE - LC)),3,1)) * 100);
FF:=EMA(CLOSE,3);
MA15:=EMA(CLOSE,21);
DRAWTEXT(CROSS(FF,MA15),(LOW * 0.99),'底背离'),ColorA6E500;
DRAWTEXT(CROSS(88,RSI),(HIGH * 1.02),'顶背离'),Color1880FF;
VAR2:=LLV(LOW,27);
VAR3:=HHV(HIGH,34);
VAR4:=EMA((CLOSE-Var2)/(Var3-Var2)*4,4)*25;
注意买:=IF((Var4<10),80,100);
RSV:=(C-LLV(L,9))/(HHV(H,9)-LLV(L,9))*100;
K:=SMA(RSV,3,1);
D:=SMA(K,3,1);
J:=3*K-2*D;
超跌:=IF(J<0,10,0);
BDDD:=LLV(J,2)=LLV(J,8);
买入:=IF(CROSS(J,REF(J+0.01,1)) AND BDDD AND J<20,30,0);
DRAWTEXT(买入 AND 注意买=100 AND 超跌=0,low,'短线'),Color8000FF;
mtm:=C-REF(C,1);
DX:=100*EMA(EMA(MTM,6),6)/EMA(EMA(ABS(MTM),6),6);
买:=IF(LLV(DX,2)=LLV(DX,7) AND COUNT(DX<0,2) AND CROSS(DX,MA(DX,2)),1,0);
DRAWTEXT(filter(买=1,5),LOW-0.03,'拉升'),ColorFFDE00;
STICKLINE(CLOSE>OPEN,OPEN,LOW,0.5,0 ),COLOR0000FF;
STICKLINE(CLOSE>OPEN,CLOSE,HIGH,0.5 ,0 ),COLOR0000FF;
STICKLINE(OPEN>=CLOSE,CLOSE,LOW,0.5 ,0 ),COLOR00FF00;
STICKLINE(OPEN>=CLOSE,OPEN,HIGH,0.5 ,0 ),COLOR00FF00;
STICKLINE(OPEN>=CLOSE ,CLOSE ,OPEN,7,0 ),COLORff7700;
STICKLINE(OPEN>=CLOSE ,CLOSE ,OPEN,6,0 ),COLORff9900;
STICKLINE(OPEN>=CLOSE ,CLOSE ,OPEN,5,0 ),COLORffbb00;
STICKLINE(OPEN>=CLOSE ,CLOSE ,OPEN,4,0 ),COLORffcc00;
STICKLINE(OPEN>=CLOSE ,CLOSE ,OPEN,3,0 ),COLORffdd00;
STICKLINE(OPEN>=CLOSE ,CLOSE ,OPEN,2,0 ),COLORffee00;
STICKLINE(OPEN>=CLOSE ,CLOSE ,OPEN,1,0 ),COLORffFF00;
STICKLINE(CLOSE>OPEN,CLOSE,OPEN,7,0) ,COLOR000055;
STICKLINE(CLOSE>OPEN,CLOSE,OPEN,6,0) ,COLOR000066;
STICKLINE(CLOSE>OPEN,CLOSE,OPEN,5,0) ,COLOR000077;
STICKLINE(CLOSE>OPEN,CLOSE,OPEN,4,0) ,COLOR000099;
STICKLINE(CLOSE>OPEN,CLOSE,OPEN,3,0) ,COLOR0000bb;
STICKLINE(CLOSE>OPEN,CLOSE,OPEN,2,0) ,COLOR0000dd;
STICKLINE(CLOSE>OPEN,CLOSE,OPEN,1,0) ,COLOR0000ff;
var9Q:=c= hhv(c,4)and (ref(c,1)>=ref(c,2) or ref(c,1)>=ref(c,3)) or ref(c,1)=hhv(c,4) and close>=ref(c,2)
or ref(c,2)=hhv(c,4) and ref(c,3)=llv(c,4) and c>=ref(c,1) or ref(c,3)=hhv(c,4) and c>=ref(c,1) and c>=ref(c,2);
stickline(var9Q,c,(o+c)/2,7,0),color000055;
stickline(var9Q,c,(o+c)/2,6,0),color000066;
stickline(var9Q,c,(o+c)/2,5,0),color000077;
stickline(var9Q,c,(o+c)/2,4,0),color000099;
stickline(var9Q,c,(o+c)/2,3,0),color0000bb;
{显示买卖}
BUYPRICE:="SHOWINV@BUYPRICE"(1);
buydate:="SHOWINV@date"(1);
DRAWTEXT(BUYPRICE> 0,BUYPRICE,'买入'+NUMTOSTR(BUYPRICE)),COLORffffff,linethick2;
SALEPRICE:="SHOWINV@SALEPRICE"(1);
DRAWTEXT(SALEPRICE> 0,SALEPRICE,'卖出'+NUMTOSTR(SALEPRICE)),COLORGREEN,linethick2;
DRAWTEXTABS(15,10,'【买入价:'),COLORffffff,linethick3;
IF BUYPRICE> 0 THEN BEGIN
DRAWTEXTABS(15,10,' '+NUMTOSTR(BUYPRICE)+'元 '),COLORffffff,linethick4;
DRAWTEXTABS(15,10,' 买入日期:'+NUMTOSTR(month)+'月'+NUMTOSTR(day)+'日】'), COLORwhite,LINETHICK3;
end
五日涨跌:(C-REF(CLOSE,5))/C*100,ColorFF00FF,LINETHICK0;
十日涨跌:(C-REF(CLOSE,10))/C*100,LINETHICK0;
WW:=BARSLAST(DISPSTATUS=1);
低涨:(C/LLV(LOW,WW)-1)*100,COLOR0000FF,LINETHICK0,PRECIS2;
天:BARSLAST(L=LLV(LOW,WW)),COLOR00FFFF,LINETHICK0,PRECIS0;
{以下设置个股信息}
DRAWTEXTABS(15,50,'■所属板块:'+BKNAME),COLORFFFFFF;
DD:=FINANCE2(35)/10000;SS:=FINANCE2(37)/10000;
DRAWTEXTABS(15,65,'■总股本:'+NUMTOSTRN(DD,2)+'亿' +' 流通A股:'+NUMTOSTRN(SS,2)+'亿'),COLOR00FFFF;
DRAWTEXTABS(15,80,'■五日涨跌: '+NUMTOSTRN(ref(五日涨跌,0),2)+'% 十日涨跌: '+NUMTOSTRN(ref(十日涨跌,0),2)+'% 低点至今上涨:'+NUMTOSTRN(低涨,2)+'% '+NUMTOSTRN(天,0)+'天'),COLORD3A9FF;
DRAWTEXTABS(15,95,'■目前可见k线:'+NUMTOSTRN(WW+1,0)+'天'),COLORffffff;
DRAWTEXTABS(15,110,'■建议查阅K线:短线30天,中长线120天!'),COLORffffff;
a:="STSFunc@CALSTSL";
R1:="STSFunc@STS_RISK1";
R2:="STSFunc@STS_RISK2";
S1:="STSFunc@STS_STS1";
S2:="STSFunc@STS_STS2";
TBS:="STSFunc@STS_STSBS";
DN:="STSFunc@STS_STSDN";
UP:="STSFunc@STS_STSUP";
压力位:UP,linethick0,color0000ff,PRECIS2;
支撑位:DN,linethick0,color00ff00,PRECIS2;
警示位:IF(R1<>0,ABS(R1),IF(R2<>0,ABS(R2),0)),linethick0,colorff00ff,PRECIS2;
stickline(var9Q,c,(o+c)/2,2,0),color0000dd;
stickline(var9Q,c,(o+c)/2,1,0),color0000ff;
varaQ:=c=hhv(c,4) and ref(c,1)=llv(c,4);
stickline(varaQ,c,(o+c)/2,7,0),colorff11ff;
stickline(varaQ,c,(o+c)/2,6,0),colorff33ff;
stickline(varaQ,c,(o+c)/2,5,0),colorff55ff;
stickline(varaQ,c,(o+c)/2,4,0),colorff77ff;
stickline(varaQ,c,(o+c)/2,3,0),colorff99ff;
stickline(varaQ,c,(o+c)/2,2,0),colorffbbff;
stickline(varaQ,c,(o+c)/2,1,0),colorffddff;
varbQ:=c=llv(c,4) and (ref(c,1)<ref(c,2) or ref(c,1)<ref(c,3)) or ref(c,1)=llv(c,4) and c<ref(c,2) or ref(c,2)=llv(c,4)
and ref(c,1)<>hhv(c,4) and c<ref(c,1) or ref(c,3)=llv(c,4) and c<ref(c,1) and c<ref(c,2);
stickline(varbQ,c,(o+c)/2,7,0),color333333;
stickline(varbQ,c,(o+c)/2,6,0),color555555;
stickline(varbQ,c,(o+c)/2,5,0),color777777;
stickline(varbQ,c,(o+c)/2,4,0),color999999;
stickline(varbQ,c,(o+c)/2,3,0),colorbbbbbb;
stickline(varbQ,c,(o+c)/2,2,0),colordddddd;
stickline(varbQ,c,(o+c)/2,1,0),colorffffff;
varcQ:=ref(c,1)=llv(c,4) and c>=ref(c,2) or ref(c,2)=llv(c,4) and ref(c,1)<=ref(c,3) and ref(c,2)<ref(c,4) and c>=ref(c,1);
stickline(varcQ,o,(o+c)/2,7,0),color003300;
stickline(varcQ,o,(o+c)/2,6,0),color005500;
stickline(varcQ,o,(o+c)/2,5,0),color007700;
stickline(varcQ,o,(o+c)/2,4,0),color009900;
stickline(varcQ,o,(o+c)/2,3,0),color00bb00;
stickline(varcQ,o,(o+c)/2,2,0),color00dd00;
stickline(varcQ,o,(o+c)/2,1,0),color00ff00;
vardQ:=ref(c,1)=hhv(c,4) and c<ref(c,2) or (ref(c,2)=hhv(c,4) and ref(c,1)>ref(c,3) or ref(c,3)=hhv(c,4) and
ref(c,1)>ref(c,2)) and ref(c,2)>=ref(c,4) and c<ref(c,1);
stickline(vardQ,o,(o+c)/2,7,0),colorff1100;
stickline(vardQ,o,(o+c)/2,6,0),colorff3300;
stickline(vardQ,o,(o+c)/2,5,0),colorff5500;
stickline(vardQ,o,(o+c)/2,4,0),colorff7700;
stickline(vardQ,o,(o+c)/2,3,0),colorff9900;
stickline(vardQ,o,(o+c)/2,2,0),colorffbb00;
stickline(vardQ,o,(o+c)/2,1,0),colorffdd00;(
{由于TBS用了大量的自定义数据,无法取得,只能这样了}
{DRAWGBK(v>=0,STRIP(RGB(18,19,51),RGB(1,155,155),0))};
B1:=MA(CLOSE,1);
B2:=SMA(SMA(SMA(B1,2,1),2,1),2,1) ;
SMA2:=MA(B2,3) ;
FILLRGN(b2,sma2,b2>sma2),colorred;
FILLRGN(b2,sma2,b2<sma2),colorgreen;
MA7:MA(C,7),COLORFFFFFF,LINETHICK3;
{背离解盘}
SAT:=IF((AMOUNT/C)/(HHV(AMOUNT,20)/HHV(C,20))*100>100,100,(AMOUNT/C)/(HHV(AMOUNT,20)/HHV(C,20))*100);
DRAWTEXTREL(12,5,'量能饱和度:'+NUMTOSTRN(SAT,0)),LINETHICK3,Color8000FF;
AA10:MA(CLOSE,8),color0000FF;
AA12:MA(CLOSE,12),color0000FF;
BB10:=((ATAN((AA10 - REF(AA10,1))) * 3.1416) * 10);
BB12:=((ATAN((AA12 - REF(AA12,1))) * 3.1416) * 10);
MA13:=MA(CLOSE,13);
FILLRGN(AA10,AA12,(((AA12 <= AA10) AND (BB12 >= 1)) AND (BB10 >= 1))),Color0098FF;
FILLRGN(AA10,AA12,(((AA12 >= AA10) AND (BB10 <= 1)) AND (BB10 <= 1))),color00FF00;
x1:=(C+L+H)/3;
bb13:=atan(ema(x1,13)-ref(ema(x1,13),1))*3.1416*10;
ema8:=ema(c,8);
DRAWTEXT(filter(bb13>1 and ema(x1,13)>ref(ema(x1,8),1),10),
ema8,'∠45上升'),colorwhite;
压力:MA(REF(HHV(C,30),1),2),Color9DFFFF;
支撑:MA(REF(LLV(C,30),1),2),ColorABFF46;
AA1:=AMOUNT/V;
BB1:=L<AA1*0.9;
CC1:=(C-REF(C,1))/REF(C,1)*100>1.2;
DD1:=L<MA(C,5)*0.921;
EE1:=V<MA(V,5)*1.5;
FF1:=BB1 AND CC1 AND DD1 AND EE1;
DRAWTEXT(ff1,(LOW* 0.99),'老鼠仓'),Color4080FF;
A51:=3*SMA((C-LLV(L,55))/(HHV(H,55)-LLV(L,55))*100,5,1)-2*SMA((C-LLV(L,55))/(HHV(H,55)-LLV(L,55))*100,5,1);
黑马线:=EMA(A51,5);
A54:=((C-LLV(L,21))/(HHV(H,21)-LLV(L,21)))*100;
趋势线:=(MA(3*SMA(A54,6,1)-2*SMA(SMA(A54,5,1),5,1),2));
DRAWTEXT(CROSS(趋势线,0)AND 黑马线<40,(HIGH* 0.97),'▲大黑马'),COLORYELLOW;
LC:=REF(CLOSE,1);
RSI:=((SMA(MAX((CLOSE - LC),0),3,1) / SMA(ABS((CLOSE - LC)),3,1)) * 100);
FF:=EMA(CLOSE,3);
MA15:=EMA(CLOSE,21);
DRAWTEXT(CROSS(FF,MA15),(LOW * 0.99),'底背离'),ColorA6E500;
DRAWTEXT(CROSS(88,RSI),(HIGH * 1.02),'顶背离'),Color1880FF;
VAR2:=LLV(LOW,27);
VAR3:=HHV(HIGH,34);
VAR4:=EMA((CLOSE-Var2)/(Var3-Var2)*4,4)*25;
注意买:=IF((Var4<10),80,100);
RSV:=(C-LLV(L,9))/(HHV(H,9)-LLV(L,9))*100;
K:=SMA(RSV,3,1);
D:=SMA(K,3,1);
J:=3*K-2*D;
超跌:=IF(J<0,10,0);
BDDD:=LLV(J,2)=LLV(J,8);
买入:=IF(CROSS(J,REF(J+0.01,1)) AND BDDD AND J<20,30,0);
DRAWTEXT(买入 AND 注意买=100 AND 超跌=0,low,'短线'),Color8000FF;
MTM:=C-REF(C,1);
DX:=100*EMA(EMA(MTM,6),6)/EMA(EMA(ABS(MTM),6),6);
买:=IF(LLV(DX,2)=LLV(DX,7) AND COUNT(DX<0,2) AND CROSS(DX,MA(DX,2)),1,0);
DRAWTEXT(filter(买=1,5),LOW-0.03,'拉升'),ColorFFDE00;
STICKLINE(CLOSE>OPEN,OPEN,LOW,0.5,0 ),COLOR0000FF;
STICKLINE(CLOSE>OPEN,CLOSE,HIGH,0.5 ,0 ),COLOR0000FF;
STICKLINE(OPEN>=CLOSE,CLOSE,LOW,0.5 ,0 ),COLOR00FF00;
STICKLINE(OPEN>=CLOSE,OPEN,HIGH,0.5 ,0 ),COLOR00FF00;
STICKLINE(OPEN>=CLOSE ,CLOSE ,OPEN,7,0 ),COLORff7700;
STICKLINE(OPEN>=CLOSE ,CLOSE ,OPEN,6,0 ),COLORff9900;
STICKLINE(OPEN>=CLOSE ,CLOSE ,OPEN,5,0 ),COLORffbb00;
STICKLINE(OPEN>=CLOSE ,CLOSE ,OPEN,4,0 ),COLORffcc00;
STICKLINE(OPEN>=CLOSE ,CLOSE ,OPEN,3,0 ),COLORffdd00;
STICKLINE(OPEN>=CLOSE ,CLOSE ,OPEN,2,0 ),COLORffee00;
STICKLINE(OPEN>=CLOSE ,CLOSE ,OPEN,1,0 ),COLORffFF00;
STICKLINE(CLOSE>OPEN,CLOSE,OPEN,7,0) ,COLOR000055;
STICKLINE(CLOSE>OPEN,CLOSE,OPEN,6,0) ,COLOR000066;
STICKLINE(CLOSE>OPEN,CLOSE,OPEN,5,0) ,COLOR000077;
STICKLINE(CLOSE>OPEN,CLOSE,OPEN,4,0) ,COLOR000099;
STICKLINE(CLOSE>OPEN,CLOSE,OPEN,3,0) ,COLOR0000bb;
STICKLINE(CLOSE>OPEN,CLOSE,OPEN,2,0) ,COLOR0000dd;
STICKLINE(CLOSE>OPEN,CLOSE,OPEN,1,0) ,COLOR0000ff;
var9Q:=c= hhv(c,4)and (ref(c,1)>=ref(c,2) or ref(c,1)>=ref(c,3)) or ref(c,1)=hhv(c,4) and close>=ref(c,2)
or ref(c,2)=hhv(c,4) and ref(c,3)=llv(c,4) and c>=ref(c,1) or ref(c,3)=hhv(c,4) and c>=ref(c,1) and c>=ref(c,2);
stickline(var9Q,c,(o+c)/2,7,0),color000055;
stickline(var9Q,c,(o+c)/2,6,0),color000066;
stickline(var9Q,c,(o+c)/2,5,0),color000077;
stickline(var9Q,c,(o+c)/2,4,0),color000099;
stickline(var9Q,c,(o+c)/2,3,0),color0000bb;
{显示买卖}
BUYPRICE:="SHOWINV@BUYPRICE"(1);
buydate:="SHOWINV@date"(1);
DRAWTEXT(BUYPRICE> 0,BUYPRICE,'买入'+NUMTOSTR(BUYPRICE)),COLORffffff,linethick2;
SALEPRICE:="SHOWINV@SALEPRICE"(1);
DRAWTEXT(SALEPRICE> 0,SALEPRICE,'卖出'+NUMTOSTR(SALEPRICE)),COLORGREEN,linethick2;
DRAWTEXTABS(15,10,'【买入价:'),COLORffffff,linethick3;
IF BUYPRICE> 0 THEN BEGIN
DRAWTEXTABS(15,10,' '+NUMTOSTR(BUYPRICE)+'元 '),COLORffffff,linethick4;
DRAWTEXTABS(15,10,' 买入日期:'+NUMTOSTR(month)+'月'+NUMTOSTR(day)+'日】'), COLORwhite,LINETHICK3;
end
五日涨跌:(C-REF(CLOSE,5))/C*100,ColorFF00FF,LINETHICK0;
十日涨跌:(C-REF(CLOSE,10))/C*100,LINETHICK0;
WW:=BARSLAST(DISPSTATUS=1);
低涨:(C/LLV(LOW,WW)-1)*100,COLOR0000FF,LINETHICK0,PRECIS2;
天:BARSLAST(L=LLV(LOW,WW)),COLOR00FFFF,LINETHICK0,PRECIS0;
{以下设置个股信息}
DRAWTEXTABS(15,50,'■所属板块:'+BKNAME),COLORFFFFFF;
DD:=FINANCE2(35)/10000;SS:=FINANCE2(37)/10000;
DRAWTEXTABS(15,65,'■总股本:'+NUMTOSTRN(DD,2)+'亿' +' 流通A股:'+NUMTOSTRN(SS,2)+'亿'),COLOR00FFFF;
DRAWTEXTABS(15,80,'■五日涨跌: '+NUMTOSTRN(ref(五日涨跌,0),2)+'% 十日涨跌: '+NUMTOSTRN(ref(十日涨跌,0),2)+'% 低点至今上涨:'+NUMTOSTRN(低涨,2)+'% '+NUMTOSTRN(天,0)+'天'),COLORD3A9FF;
DRAWTEXTABS(15,95,'■目前可见K线:'+NUMTOSTRN(WW+1,0)+'天'),COLORffffff;
DRAWTEXTABS(15,110,'■建议查阅K线:短线30天,中长线120天!'),COLORffffff;
a:="STSFunc@CALSTSL";
R1:="STSFunc@STS_RISK1";
R2:="STSFunc@STS_RISK2";
S1:="STSFunc@STS_STS1";
S2:="STSFunc@STS_STS2";
TBS:="STSFunc@STS_STSBS";
DN:="STSFunc@STS_STSDN";
UP:="STSFunc@STS_STSUP";
压力位:UP,linethick0,color0000ff,PRECIS2;
支撑位:DN,linethick0,color00ff00,PRECIS2;
警示位:IF(R1<>0,ABS(R1),IF(R2<>0,ABS(R2),0)),linethick0,colorff00ff,PRECIS2;
stickline(var9Q,c,(o+c)/2,2,0),color0000dd;
stickline(var9Q,c,(o+c)/2,1,0),color0000ff;
varaQ:=c=hhv(c,4) and ref(c,1)=llv(c,4);
stickline(varaQ,c,(o+c)/2,7,0),colorff11ff;
stickline(varaQ,c,(o+c)/2,6,0),colorff33ff;
stickline(varaQ,c,(o+c)/2,5,0),colorff55ff;
stickline(varaQ,c,(o+c)/2,4,0),colorff77ff;
stickline(varaQ,c,(o+c)/2,3,0),colorff99ff;
stickline(varaQ,c,(o+c)/2,2,0),colorffbbff;
stickline(varaQ,c,(o+c)/2,1,0),colorffddff;
varbQ:=c=llv(c,4) and (ref(c,1)<ref(c,2) or ref(c,1)<ref(c,3)) or ref(c,1)=llv(c,4) and c<ref(c,2) or ref(c,2)=llv(c,4)
and ref(c,1)<>hhv(c,4) and c<ref(c,1) or ref(c,3)=llv(c,4) and c<ref(c,1) and c<ref(c,2);
stickline(varbQ,c,(o+c)/2,7,0),color333333;
stickline(varbQ,c,(o+c)/2,6,0),color555555;
stickline(varbQ,c,(o+c)/2,5,0),color777777;
stickline(varbQ,c,(o+c)/2,4,0),color999999;
stickline(varbQ,c,(o+c)/2,3,0),colorbbbbbb;
stickline(varbQ,c,(o+c)/2,2,0),colordddddd;
stickline(varbQ,c,(o+c)/2,1,0),colorffffff;
varcQ:=ref(c,1)=llv(c,4) and c>=ref(c,2) or ref(c,2)=llv(c,4) and ref(c,1)<=ref(c,3) and ref(c,2)<ref(c,4) and c>=ref(c,1);
stickline(varcQ,o,(o+c)/2,7,0),color003300;
stickline(varcQ,o,(o+c)/2,6,0),color005500;
stickline(varcQ,o,(o+c)/2,5,0),color007700;
stickline(varcQ,o,(o+c)/2,4,0),color009900;
stickline(varcQ,o,(o+c)/2,3,0),color00bb00;
stickline(varcQ,o,(o+c)/2,2,0),color00dd00;
stickline(varcQ,o,(o+c)/2,1,0),color00ff00;
vardQ:=ref(c,1)=hhv(c,4) and c<ref(c,2) or (ref(c,2)=hhv(c,4) and ref(c,1)>ref(c,3) or ref(c,3)=hhv(c,4) and
ref(c,1)>ref(c,2)) and ref(c,2)>=ref(c,4) and c<ref(c,1);
stickline(vardQ,o,(o+c)/2,7,0),colorff1100;
stickline(vardQ,o,(o+c)/2,6,0),colorff3300;
stickline(vardQ,o,(o+c)/2,5,0),colorff5500;
stickline(vardQ,o,(o+c)/2,4,0),colorff7700;
stickline(vardQ,o,(o+c)/2,3,0),colorff9900;
stickline(vardQ,o,(o+c)/2,2,0),colorffbb00;
stickline(vardQ,o,(o+c)/2,1,0),colorffdd00;