通达信日出主图公式源码
{n: 1 100 8}
HHJSJDA:=(3*CLOSE+OPEN+LOW+HIGH)/6;
HHJSJDB:=(20*HHJSJDA+19*REF(HHJSJDA,1)+18*REF(HHJSJDA,2)+17*REF(HHJSJDA,3)+16*REF(HHJSJDA,4)+15*REF(HHJSJDA,5)+14*REF(HHJSJDA,6)
+13*REF(HHJSJDA,7)+12*REF(HHJSJDA,8)+11*REF(HHJSJDA,9)+10*REF(HHJSJDA,10)+9*REF(HHJSJDA,11)+8*REF(HHJSJDA,12)
+7*REF(HHJSJDA,13)+6*REF(HHJSJDA,14)+5*REF(HHJSJDA,15)+4*REF(HHJSJDA,16)+3*REF(HHJSJDA,17)+2*REF(HHJSJDA,18)+
REF(HHJSJDA,20))/210;
HHJSJDC:=MA(HHJSJDB,5);
STICKLINE(HHJSJDB>HHJSJDC,HHJSJDB,HHJSJDC,2,0),COLORYELLOW;
STICKLINE(HHJSJDC>HHJSJDB,HHJSJDB,HHJSJDC,2,0),COLORBLUE;
MA21:=EMA(CLOSE,21);
MID:=MA(CLOSE,21);
风险线:= MA(CLOSE,13);
止损线:= MA(CLOSE,27);
牛熊线:=EMA(C,250);
界:=MA(CLOSE,21);
DRAWTEXT(CROSS(MA5,界),(LOW * 0.95),'◇底背离'),COLORWHITE;
DRAWTEXT(CROSS(C,止损线)AND 止损线>风险线,(LOW * 0.96),'主升浪'),COLORRED,LINETHICK3;
DK:=MA(((SLOPE(C,20)*5)+C),20);
STICKLINE(DK<=C AND CLOSE>=OPEN,HIGH,LOW,0.1,1),COLORRED;
STICKLINE(DK<=C AND CLOSE>=OPEN,CLOSE,OPEN,3,1),COLORRED;
STICKLINE(DK<=C AND CLOSE<OPEN,HIGH,LOW,0.1,0),COLORRED;
STICKLINE(DK<=C AND CLOSE<OPEN,CLOSE,OPEN,3,0),COLORRED;
STICKLINE(DK>C AND CLOSE>=OPEN,HIGH,LOW,0.1,1),COLORGREEN;
STICKLINE(DK>C AND CLOSE>=OPEN,CLOSE,OPEN,3,1),COLORGREEN;
STICKLINE(DK>C AND CLOSE<OPEN,HIGH,LOW,0.1,0),COLORGREEN;
STICKLINE(DK>C AND CLOSE<OPEN,CLOSE,OPEN,3,0),COLORGREEN;
DRAWTEXT(CROSS(C,DK),LOW*0.99,'★B'),COLORMAGENTA;
DRAWTEXT(CROSS(DK,C),H*1.01,'☆S'),COLORYELLOW;
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;
{机构买入}
VAR30:=LLV(HIGH,240);
VAR40:=100*(CLOSE-VAR30)/VAR30;
VAR5:=(CLOSE-LLV(LOW,528))/(HHV(HIGH,528)-LLV(LOW,528))*100;
VAR6:=(CLOSE-LLV(CLOSE,530))/(HHV(CLOSE,530)-LLV(CLOSE,530))*100;
VAR7:=0;
VAR8:=SMA(MAX(CLOSE-REF(CLOSE,1),0),34,1)/SMA(ABS(CLOSE-REF(CLOSE,1)),7,1)*100;
VAR9:=SMA(MAX(CLOSE-REF(CLOSE,1),0),13,1)/SMA(ABS(CLOSE-REF(CLOSE,1)),13,1)*100;
VAR10:=IF(TROUGHBARS(3,16,1)=0 AND HIGH>LOW+0.04,4,0);
VAR11:=ZIG(3,6)>REF(ZIG(3,6),1) AND REF(ZIG(3,6),1)<=REF(ZIG(3,6),2) AND REF(ZIG(3,6),2)<=REF(ZIG(3,6),3);
VAR12:=ZIG(3,6)<REF(ZIG(3,6),1) AND REF(ZIG(3,6),1)>=REF(ZIG(3,6),2) AND REF(ZIG(3,6),2)>=REF(ZIG(3,6),3);
VAR13:=ZIG(3,22)>REF(ZIG(3,22),1) AND REF(ZIG(3,22),1)<=REF(ZIG(3,22),2) AND REF(ZIG(3,22),2)<=REF(ZIG(3,22),3);
VAR14:=ZIG(3,22)<REF(ZIG(3,22),1) AND REF(ZIG(3,22),1)>=REF(ZIG(3,22),2) AND REF(ZIG(3,22),2)>=REF(ZIG(3,22),3);
VAR15:=ZIG(3,51)>REF(ZIG(3,51),1) AND REF(ZIG(3,51),1)<=REF(ZIG(3,51),2) AND REF(ZIG(3,51),2)<=REF(ZIG(3,51),3);
VAR16:=ZIG(3,51)<REF(ZIG(3,51),1) AND REF(ZIG(3,51),1)>=REF(ZIG(3,51),2) AND REF(ZIG(3,51),2)>=REF(ZIG(3,51),3);
VAR17:=ZIG(3,72)>REF(ZIG(3,72),1) AND REF(ZIG(3,72),1)<=REF(ZIG(3,72),2) AND REF(ZIG(3,72),2)<=REF(ZIG(3,72),3);
VAR18:=ZIG(3,72)<REF(ZIG(3,72),1) AND REF(ZIG(3,72),1)>=REF(ZIG(3,72),2) AND REF(ZIG(3,72),2)>=REF(ZIG(3,72),3);
VAR19:=EMA(CLOSE,2)-EMA(CLOSE,150);
买1:=VAR10;
买2:=(VAR11+VAR13+VAR15+VAR17);
卖1:=(VAR12+VAR14+VAR16+VAR18);
B0:IF(买1>0 OR 买2>0,LOW*0.99,DRAWNULL),CROSSDOT,LINETHICK3,COLORYELLOW;
DRAWTEXT(买1>0 OR 买2>0,LOW*0.99,'买'),COLORRED;
{支撑跟阻力}
NN:=100;
AA:=REF(H,N)=HHV(H,2*N+1); AA1:=REF(L,N)=LLV(L,2*N+1);
QY:=BACKSET(AA,N+1); QY1:=BACKSET(AA1,N+1);
CC:=FILTER(QY,N) AND H=HHV(H,N+1); CC1:=FILTER(QY1,N) AND L=LLV(L,N+1);
DDD:=BARSLAST(CC); DD1:=BARSLAST(CC1);
GDTS:=IF(CC,CURRBARSCOUNT,0); DDTS:=IF(CC1,CURRBARSCOUNT,0);
DINGBUTS:=IF(DDD,REF(GDTS,DDD),GDTS); DDTS1:=IF(DD1,REF(DDTS,DD1),DDTS);
GDCS1:=CONST(DINGBUTS); DDCS1:=CONST(DDTS1);
GDCS13:=CONST(REF(HIGH,GDCS1-1)); DDCS13:=CONST(REF(L,DDCS1-1));
DINGBUTS1:=REF(DINGBUTS,DDD+1); DDTS2:=REF(DDTS1,DD1+1);
GDCS2:=CONST(DINGBUTS1); DDCS2:=CONST(DDTS2);
M:=INTPART(3*N/5);
AAAA:=REF(H,M)=HHV(H,2*M+1);
QYY:=BACKSET(AAAA,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);
ZGD:=HHV(H,60)*1.01.00;
ZGD2:=CONST(ZGD);
高点压力M:=DRAWLINE(CURRBARSCOUNT=GDCS22,H,CURRBARSCOUNT=GDCS11,H,1),COLORRED,LINETHICK2;
低点支撑M:=DRAWLINE(CURRBARSCOUNT=DDCS22,L,CURRBARSCOUNT=DDCS11,L,1) COLORRED,LINETHICK2;
高点压力1:=DRAWLINE(CURRBARSCOUNT=GDCS2,H,CURRBARSCOUNT=GDCS1,H,1) ,COLORBLUE,LINETHICK2;
低点支撑1:=DRAWLINE(CURRBARSCOUNT=DDCS2,L,CURRBARSCOUNT=DDCS1,L,1),COLORBLUE,LINETHICK2;
高点:=CONST(HHV(H,NN));
低点:=CONST(LLV(L,NN));
GJ:=(C+H+L+O)/4;
明日阻力:=L+(GJ-L)+(C-L);
明日支撑:=L+(C-GJ);
明日阻力2:=L+2*(GJ-L)+(C-L);
明日支撑2:=L+(C-GJ)-(GJ-L);
今日阻力:CONST(REF(明日阻力 , 1)),NODRAW;
今日支撑:CONST(REF(明日支撑 , 1)),NODRAW;
今日阻力2:CONST(REF(明日阻力2 , 1)),NODRAW;
今日支撑2:CONST(REF(明日支撑2 , 1)),NODRAW;
STICKLINE(ISLASTBAR,今日阻力,今日阻力2,10,0),COLOR555555;
DRAWTEXT(ISLASTBAR,今日阻力,' 阻'),COLOR0000FF;
STICKLINE(ISLASTBAR,今日支撑,今日支撑2,10,0),COLOR555555;
DRAWTEXT(ISLASTBAR,今日支撑,' 支'),COLOR00FF00;
IF(BETWEEN(高点压力M,高点,低点),高点压力M,DRAWNULL),COLORWHITE,LINETHICK2;
IF(BETWEEN(低点支撑M,高点,低点),低点支撑M,DRAWNULL),COLORMAGENTA,LINETHICK2;
IF(BETWEEN(高点压力1,高点,低点),高点压力1,DRAWNULL),COLORGREEN,LINETHICK2;
IF(BETWEEN(低点支撑1,高点,低点),低点支撑1,DRAWNULL),COLORRED,LINETHICK2;
AAA:=CONST(HHV(H,90));
A74:=MA(CLOSE,20);
A75:=(CLOSE > MA(CLOSE,5));
A76:=(MA(CLOSE,5) > MA(CLOSE,10));
A77:=(CLOSE > MA(CLOSE,10));
A78:=(MA(CLOSE,5) > MA(CLOSE,20));
A79:=(CLOSE > MA(CLOSE,20));
A710:=REF(A74,1);
A711:=(A74 > A710);
AVX:=(((((IF(A75,10,(0 - 10)) + IF(A76,10,(0 - 10))) + IF(A77,10,(0 - 10)))
+ IF(A78,10,(0 - 10))) + IF(A79,10,(0 - 10))) + IF(A711,10,(0 - 10)));
DSLX:=(CLOSE / INDEXC);
DSLX1:=MA(DSLX,5);
DSLX2:=MA(DSLX,10);
V1:=MA(VOL,5);
V2:=MA(VOL,10);
T1:=CONST(IF(C<200 AND ((CROSS(AVX,1) AND (V1 >= V2)) AND (DSLX >= DSLX1)),1,0));
T2:=CONST(IF(C<200 AND ((CROSS(AVX,1) AND (V1 < V2)) AND (DSLX >= DSLX1)),1,0));
T3:=CONST(IF(C<200 AND ((CROSS(AVX,1) AND (V1 > V2)) AND (DSLX < DSLX1)),1,0));
T4:=CONST(IF(C<200 AND ((CROSS(AVX,1) AND (V1 <= V2)) AND (DSLX < DSLX1)),1,0));
T5:=CONST(IF(C<200 AND ((CROSS(1,AVX) AND (V1 >= V2)) AND (DSLX >= DSLX1)),1,0));
T6:=CONST(IF(C<200 AND ((CROSS(1,AVX) AND (V1 < V2)) AND (DSLX >= DSLX1)),1,0));
T7:=CONST(IF(C<200 AND ((CROSS(1,AVX) AND (V1 >= V2)) AND (DSLX < DSLX1)),1,0));
T8:=CONST(IF(C<200 AND ((CROSS(1,AVX) AND (V1 < V2)) AND (DSLX < DSLX1)),1,0));
T9:=CONST(IF(C<200 AND ((((AVX >= 1) AND (REF(AVX,1) > 0)) AND (V1 >= V2)) AND (DSLX >= DSLX1)),1,0));
T10:=CONST(IF(C<200 AND ((((AVX >= 1) AND (REF(AVX,1) > 0)) AND (V1 < V2)) AND (DSLX >= DSLX1)),1,0));
T11:=CONST(IF(C<200 AND ((((AVX >= 1) AND (REF(AVX,1) > 0)) AND (V1 >= V2)) AND (DSLX < DSLX1)),1,0));
T12:=CONST(IF(C<200 AND ((((AVX >= 1) AND (REF(AVX,1) > 0)) AND (V1 < V2)) AND (DSLX < DSLX1)),1,0));
T13:=CONST(IF(C<200 AND ((((AVX < 1) AND (REF(AVX,1) < 0)) AND (V1 >= V2)) AND (DSLX >= DSLX1)),1,0));
T14:=CONST(IF( C<200 AND ((((AVX < 1) AND (REF(AVX,1) < 0)) AND (V1 < V2)) AND (DSLX >= DSLX1)),1,0));
T15:=CONST(IF(C<200 AND ((((AVX < 1) AND (REF(AVX,1) < 0)) AND (V1 >= V2)) AND (DSLX < DSLX1)),1,0));
T16:=CONST(IF(C<200 AND ((((AVX < 1) AND (REF(AVX,1) < 0)) AND (V1 < V2)) AND (DSLX < DSLX1)),1,0));
T17:=CONST(IF(C>200 AND (CROSS(AVX,1) AND (V1 >= V2)),1,0));
T18:=CONST(IF(C>200 AND (CROSS(AVX,1) AND (V1 >= V2)),1,0));
T19:=CONST(IF(C>200 AND (CROSS(AVX,1) AND (V1 < V2)),1,0));
T20:=CONST(IF(C>200 AND (CROSS(1,AVX) AND (V1 >= V2)),1,0));
T21:=CONST(IF(C>200 AND (CROSS(1,AVX) AND (V1 < V2)),1,0));
T22:=CONST(IF(C>200 AND (((AVX >= 1) AND (REF(AVX,1) > 0)) AND (V1 >= V2)),1,0));
T23:=CONST(IF(C>200 AND (((AVX >= 1) AND (REF(AVX,1) > 0)) AND (V1 < V2)),1,0));
T24:=CONST(IF(C>200 AND (((AVX < 1) AND (REF(AVX,1) < 0)) AND (V1 >= V2)),1,0));
T25:=CONST(IF(C>200 AND (((AVX < 1) AND (REF(AVX,1) < 0)) AND (V1 < V2)),1,0));
DRAWTEXT(T1=1 AND CURRBARSCOUNT=60,AAA-(AAA*0.03)
,'量能理想,明显走强,中线参与,仓位在2/3左右'),COLORFF00FF ;
DRAWTEXT(T2=1 AND CURRBARSCOUNT=60,AAA-(AAA*0.03)
,'走势趋强,还显不足,短线进场,仓位在1/2左右'),COLORFF00FF ;
DRAWTEXT(T3=1 AND CURRBARSCOUNT=60,AAA-(AAA*0.03)
,'量价良好,没有明显走强,短线进场,仓位1/2左右'),COLORFF00FF ;
DRAWTEXT(T4=1 AND CURRBARSCOUNT=60,AAA-(AAA*0.03)
,'形态尚可,量能不足,未完全走强,短线参与,仓位1/3左右'),COLORFF00FF ;
DRAWTEXT(T5=1 AND CURRBARSCOUNT=60,AAA-(AAA*0.03)
,'形态变坏,重仓者减持大半,清仓者观望'),COLORFF00FF ;
DRAWTEXT(T6=1 AND CURRBARSCOUNT=60,AAA*0.98
,'随大盘一起下跌,明显缩量走势,考虑到风险,减持或清仓'),COLORFF00FF ;
DRAWTEXT(T7=1 AND CURRBARSCOUNT=60,AAA-(AAA*0.03)
,'该股放量下跌,走势明显偏弱,离场观望'),COLORFF00FF ;
DRAWTEXT(T8=1 AND CURRBARSCOUNT=60,AAA-(AAA*0.03)
,'该股缩量下跌,走势偏弱,离场观望。'),COLORFF00FF ;
DRAWTEXT(T9=1 AND CURRBARSCOUNT=60,AAA-(AAA*0.03)
,'该股形态良好,强势明显,量能充足,可以继续持有'),COLORFF00FF ;
DRAWTEXT(T10=1 AND CURRBARSCOUNT=60,AAA-(AAA*0.03)
,'上行趋势不变,强势依然,量能开始转弱,注意风险'),COLORFF00FF ;
DRAWTEXT(T11=1 AND CURRBARSCOUNT=60,AAA-(AAA*0.03)
,'该股仍然具备上涨潜力,但股性偏弱,可考虑减仓'),COLORFF00FF ;
DRAWTEXT(T12=1 AND CURRBARSCOUNT=60,AAA-(AAA*0.03)
,'该股走势趋弱,量能不足,减持大部分筹码'),COLORFF00FF ;
DRAWTEXT(T13=1 AND CURRBARSCOUNT=60,AAA-(AAA*0.03)
,'该股形态不佳,注意成交量的变化,目前不适合参与'),COLORFF00FF ;
DRAWTEXT(T14=1 AND CURRBARSCOUNT=60,AAA-(AAA*0.03)
,'趋势不明,股价偏弱,注意量能变化,目前不宜参与'),COLORFF00FF ;
DRAWTEXT(T15=1 AND CURRBARSCOUNT=60,AAA-(AAA*0.03)
,'有走强迹象,但量能不足,趋势不明,不适合操作'),COLORFF00FF ;
DRAWTEXT(T16=1 AND CURRBARSCOUNT=60,AAA-(AAA*0.03)
,'该股走势太弱,没有参与价值。'),COLORFF00FF ;
DRAWTEXT(T17=1 AND CURRBARSCOUNT=60,AAA-(AAA*0.03)
,'大盘理想,有明显走强迹象,中线参与,仓位在2/3左右'),COLORFF00FF ;
DRAWTEXT(T18=1 AND CURRBARSCOUNT=60,AAA-(AAA*0.03)
,'如前期经过一轮下跌,最佳买点,前期有过一段涨幅需谨慎'),COLORFF00FF ;
DRAWTEXT(T19=1 AND CURRBARSCOUNT=60,AAA-(AAA*0.03)
,'考虑短线进场,仓位在1/2左右,一旦量能放大,加仓买入'),COLORFF00FF ;
DRAWTEXT(T20=1 AND CURRBARSCOUNT=60,AAA-(AAA*0.03)
,'大盘形态走坏,重仓者可以减去大部分仓位。'),COLORFF0000 ;
DRAWTEXT(T21=1 AND CURRBARSCOUNT=60,AAA-(AAA*0.03)
,'大盘缩量调整,注意风险,短线清仓观望。'),COLORFF0000 ;