分享一个很不错的画线主图指标全源码
DRAWGBK(C>0,RGB(0,0,110),RGB(0,25,0),0,' ',0);
涨幅:(C-LLV(C,90))/LLV(C,90)*100,NODRAW,COLORRED;
日时转换:=IF(PERIOD=5,120,240);
VAR30:=(EMA(CLOSE,30)+EMA(CLOSE,72))/2;
DRAWTEXT_FIX(1,0.88,5,0,''),COLORRED;
HZZ:=1220601;
HZ:=IF(DATE<HZZ,1,DRAWNULL);
Z1:=STRCAT(HYBLOCK,' ')*HZ;
Z2:=STRCAT(Z1,DYBLOCK)*HZ;
Z3:=STRCAT(Z2,' ');
DRAWTEXT_FIX(ISLASTBAR,0,0,0,STRCAT(Z3,GNBLOCK)),COLORRED;
金牛:=(XMA(XMA(H,25),25)-XMA(XMA(L,25),25))*1+XMA(XMA(H,25),25)*HZ,DOTLINE,COLORYELLOW;
金钻:XMA(XMA(L,25),25)-(XMA(XMA(H,25),25)-XMA(XMA(L,25),25))*1,LINETHICK2,COLORYELLOW,POINTDOT;
金牛2:=EMA(金钻,25)COLORCYAN,LINETHICK2;
DRAWKLINE(H,O,L,C);
STICKLINE(金钻>LOW AND 金钻<HIGH,金钻,MIN(MIN(OPEN,CLOSE),金钻),2,0),COLORYELLOW;
STICKLINE(金钻>MIN(C,O) AND 金钻<MAX(C,O),金钻,MIN(OPEN,CLOSE),2,0),COLORYELLOW;
STICKLINE(金钻>HIGH,OPEN,CLOSE,2,0),COLORYELLOW;
STICKLINE(金钻>HIGH,HIGH,LOW,0,0),COLORYELLOW;
DRAWBAND(金钻,RGB(55,0,0),金牛2,RGB(0,91,0));
VAR23:=100*XMA(XMA((C-REF(C,1)),6),6)/XMA(XMA(ABS((C-REF(C,1))),6),6);
回调买:=LLV(VAR23,2)=LLV(VAR23,7) AND COUNT(VAR23<0,2) AND CROSS(VAR23,MA(VAR23,2));
XG:=金钻>HIGH AND 回调买 AND L<=金钻;
DRAWTEXT(XG,L,'买'),COLORRED;
JJJJ:=(HIGH+LOW+CLOSE)/3;
QJ0:=VOL/IF(HIGH=LOW,4,HIGH-LOW);
QJ1:=IF(CAPITAL=0,QJ0*(JJJJ-MIN(CLOSE,OPEN)),QJ0*IF(HIGH=LOW,1,(MIN(OPEN,CLOSE)-LOW)));
QJ2:=IF(CAPITAL=0,QJ0*(MIN(OPEN,CLOSE)-LOW),QJ0*IF(HIGH=LOW,1,(JJJJ-MIN(CLOSE,OPEN))));
QJ3:=IF(CAPITAL=0,QJ0*(HIGH-MAX(OPEN,CLOSE)),QJ0*IF(HIGH=LOW,1,(HIGH-MAX(OPEN,CLOSE))));
QJ4:=IF(CAPITAL=0,QJ0*(MAX(CLOSE,OPEN)-JJJJ),QJ0*IF(HIGH=LOW,1,(MAX(CLOSE,OPEN)-JJJJ)));
DDX:=((QJ1+QJ2)-(QJ3+QJ4))/IF(CAPITAL=0,10000,10000),COLOR00AAAA,LINETHICK;
V2:=SMA(IF(C>=REF(C,1),DDX,-DDX/100),2,1);
V5:=SMA(V2*120/FROMOPEN*5,2,1);
V10:=SMA(V5,5,1);
V20:=SMA(V10,5,1);
DY:=CURRBARSCOUNT=1 AND C<REF(C,1);
DY2:=REF(V2,1)-DY;
XG2:=C>O AND DY2<0.02 AND MA(C,5)>MA(C,60) AND C/REF(C,1)>=1.02 AND H<金牛;
DRAWTEXT(XG2 AND L<金钻,L,'金钻起涨'),COLORMAGENTA;
F1:=ZIG(3,10);
T1:=F1>REF(F1,1) AND REF(F1,1)<=REF(F1,2);
T2:=F1<REF(F1,1) AND REF(F1,1)>=REF(F1,2);
STICKLINE(T1,O,C,3,0),COLORMAGENTA;
STICKLINE(T2,O,C,3,0),COLORGREEN;
AAC:=CLOSE/REF(CLOSE,1)>=1.04;
STICKLINE(AAC,H,L,0,0),COLORGREEN;
Z1A:=STRCAT(HYBLOCK,' ');
Z2A:=STRCAT(Z1A,FGBLOCK);
Z3A:=STRCAT(Z2A,DYBLOCK);
Z4A:=STRCAT(Z3A,' ');
DRAWTEXT_FIX(ISLASTBAR,0.25,0.98,0,STRCAT(Z4A,GNBLOCK)),COLORCYAN;
{平台启动}
GG:=CROSS(MA(C,5),MA(C,20)) AND CROSS(MA(C,5),MA(C,30)) AND CROSS(MA(C,5),MA(C,60));
BB:=MA(C,60)>MA(C,10) AND CROSS(MA(C,10),MA(C,30)) AND MA(C,30)>MA(C,20) AND ABS(MA(C,60)-MA(C,20))/MA(C,20)<0.05;
JJ:=MA(C,30)>MA(C,5) AND CROSS(MA(C,5),MA(C,20)) AND MA(C,20)>MA(C,10);
DD:=ABS((MA(C,5)-MA(C,10))+(MA(C,10)-MA(C,20))+(MA(C,20)-MA(C,30)))<0.02 AND MA(C,5)>REF(MA(C,5),1) AND MA(C,10)>REF(MA(C,10),1);
EE:=MA(C,20)>MA(C,5) AND CROSS(MA(C,5),MA(C,10)) AND MA(C,10)>MA(C,60) AND ABS(MA(C,20)-MA(C,60))/MA(C,60)<0.05;
FF:=GG OR BB OR JJ OR DD OR EE ;
C2:=REF(C,1);
涨停:=IF((C-C2)*100/C2>=(10-0.01*100/C2),1,0);
STICKLINE(涨停,OPEN,CLOSE,2,0),COLORRED;
STICKLINE(涨停,H,L,0,0),COLORRED;
跌停:=IF((C2-C)*100/C2>=(10-0.01*100/C2),1,0);
STICKLINE(跌停,OPEN,CLOSE,2,0),COLORGREEN;
STICKLINE(跌停,H,L,0,1),COLORGREEN;
GSPT1:=(HHV(HIGH,21)-CLOSE)/(HHV(HIGH,21)-LLV(LOW,21))*100-10;
GSPT2:=(CLOSE-LLV(LOW,21))/(HHV(HIGH,21)-LLV(LOW,21))*100;
GSPT3:=SMA(GSPT2,13,8);
GSPT4:=CEILING(SMA(GSPT3,13,8));
GSPT5:=SMA(GSPT1,21,8);
AABB:=IF(L,CONST(L),DRAWNULL);
启动:STICKLINE(GSPT4-GSPT5>75,AABB,AABB*0.99,15,1),COLORWHITE;
AAA:=(3*C+H+L+O)/6;
VAR1:=(8*AAA+7*REF(AAA,1)+6*REF(AAA,2)+5*REF(AAA,3)+4*REF(AAA,4)+3*REF(AAA,5)+2*REF(AAA,6)+REF(AAA,8))/36;
VAR2:=(HHV(VAR1,5)+HHV(VAR1,10)+HHV(VAR1,20))/3;
VAR3:=(LLV(VAR1,5)+LLV(VAR1,10)+LLV(VAR1,20))/3;
VAR4:=(HHV(VAR2,5)+HHV(VAR2,10)+HHV(VAR2,20))/3;
VAR5:=(LLV(VAR3,5)+LLV(VAR3,10)+LLV(VAR3,20))/3;
VAR6:=(LLV(VAR1,2)+LLV(VAR1,4)+LLV(VAR1,6))/3;
短线:=VAR1,COLORWHITE;
中线:=VAR6,COLORYELLOW;
STICKLINE(C>=O,C,O,3,0),COLOR000045;
STICKLINE(C>=O,C,O,2.5,0),COLOR000065;
STICKLINE(C>=O,C,O,2,0),COLOR000085;
STICKLINE(C>=O,C,O,1.5,0),COLOR0000A5;
STICKLINE(C>=O,C,O,1,0),COLOR0000C5;
STICKLINE(C>=O,C,O,0.5,0),COLOR0000E5;
STICKLINE(C>=O,H,L,0,0),COLOR0000F5;
STICKLINE(C<O,C,O,3,0),COLOR353500;
STICKLINE(C<O,C,O,2.5,0),COLOR454500;
STICKLINE(C<O,C,O,2,0),COLOR555500;
STICKLINE(C<O,C,O,1.5,0),COLOR656500;
STICKLINE(C<O,C,O,1,0),COLOR757500;
STICKLINE(C<O,C,O,0.5,0),COLOR858500;
STICKLINE(C<O,H,L,0,0),COLOR959500;
HIGHN:=10;
LOWN:=10;
HIGHDISPLAY:=0;
LOWDISPLAY:=0;
ZGDISPLAY:=0;
MADISPLAY:=0;
AA:=REF(H,HIGHN)=HHV(H,2*HIGHN+1);
QY:=BACKSET(AA,HIGHN+1);
CC:=FILTER(QY,HIGHN) AND H=HHV(H,HIGHN+1);
DRAWICON(CC,H,2);
DDD:=BARSLAST(CC);
GDTS:=IF(CC,CURRBARSCOUNT,0);
DINGBU:=IF(DDD,REF(H,DDD),H);
DINGBUTS:=IF(DDD,REF(GDTS,DDD),GDTS);
DINGBU1:=REF(DINGBU,DDD+1);
GDCS1:=CONST(DINGBUTS);
DINGBUTS1:=REF(DINGBUTS,DDD+1);
GDCS2:=CONST(DINGBUTS1);
DINGBU2:=REF(DINGBU1,DDD+1);
MM:=IF(CURRBARSCOUNT>GDCS2,0,1);
上轨:DRAWLINE(CURRBARSCOUNT=GDCS2,H,CURRBARSCOUNT=GDCS1,H,1) COLORBLUE,LINETHICK1;
次高:DRAWLINE(CURRBARSCOUNT=GDCS2,H,ISLASTBAR,REF(H,GDCS2-1),1),COLOR0055FF,POINTDOT;
高:DRAWLINE(CURRBARSCOUNT=GDCS1,H,ISLASTBAR,REF(H,GDCS1-1),1),COLORYELLOW,POINTDOT;
AA1:=REF(L,LOWN)=LLV(L,2*LOWN+1);
QY1:=BACKSET(AA1,LOWN+1);
CC1:=FILTER(QY1,LOWN) AND L=LLV(L,LOWN+1);
DRAWICON(CC1,L,1);
DD1:=BARSLAST(CC1);
DDTS:=IF(CC1,CURRBARSCOUNT,0);
YDB:=IF(DD1,REF(L,DD1),L);
DDTS1:=IF(DD1,REF(DDTS,DD1),DDTS);
DDCS1:=CONST(DDTS1);ZDB:=REF(YDB,DD1+1);
DDTS2:=REF(DDTS1,DD1+1);
DDCS2:=CONST(DDTS2);
下轨:DRAWLINE(CURRBARSCOUNT=DDCS2,L,CURRBARSCOUNT=DDCS1,L,1) COLORRED,LINETHICK1;
ZGSTAR:=(上轨+下轨)/2;
ZGEND:=CONST((上轨+下轨)/2);
STARDAY:=IF(DDCS2<GDCS2,DDCS2,GDCS2);
中轨:DRAWLINE(CURRBARSCOUNT=STARDAY,ZGSTAR,ISLASTBAR,ZGEND,1),COLORFF55BB,LINETHICK1;
次底:DRAWLINE(CURRBARSCOUNT=DDCS1,L,ISLASTBAR,REF(L,DDCS1-1),1),COLORMAGENTA,POINTDOT;
底:DRAWLINE(CURRBARSCOUNT=DDCS2,L,ISLASTBAR,REF(L,DDCS2-1),1),COLORCYAN,POINTDOT;
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);
B:IF(买1>0 OR 买2>0,LOW*0.99,DRAWNULL),CROSSDOT,LINETHICK3,COLORYELLOW;
DRAWTEXT(买1>0 OR 买2>0,LOW*0.99,'买'),COLORRED;
S:IF(卖1>0,HIGH*1.01,DRAWNULL),CROSSDOT,LINETHICK3,COLORGREEN;
DRAWTEXT(卖1>0,HIGH*1.02,'卖'),COLORGREEN;
DRAWICON((ZIG(3,5)>REF(ZIG(3,5),1)) AND (REF(ZIG(3,5),1)<=REF(ZIG(3,5),2)) AND (REF(ZIG(3,5),2)<=REF(ZIG(3,5),3)),LOW*0.98,1) ;
DRAWICON((ZIG(3,5)<REF(ZIG(3,5),1)) AND (REF(ZIG(3,5),1)>=REF(ZIG(3,5),2)) AND (REF(ZIG(3,5),2)>=REF(ZIG(3,5),3)),HIGH*1.01,2);
ZB:=EMA(EMA(VAR3,5),5)*3, COLORSTICK;
VARA:=IF(VAR9 AND CROSS(MA(CLOSE,3),MA(CLOSE,5)),20,0);
K:=EMA(VAR7,5)*2, , COLORFF00FF;
D:=EMA(K,5), , COLORWHITE;
J:=K*3-D*2, ,COLORYELLOW;
VARB:=BETWEEN(CLOSE,MA(CLOSE,3),MA(CLOSE,5)) AND J>10;
HS:=VOL/CAPITAL*100, , COLORGREEN;
VARE:=MA(100*(CLOSE-LLV(CLOSE,34))/(HHV(HIGH,34)-LLV(LOW,34)),5)-20;
VARF:=100-3*SMA((CLOSE-LLV(LOW,75))/(HHV(HIGH,75)-LLV(LOW,75))*100,20,1)+2*SMA(SMA((CLOSE-LLV(LOW,75))/(HHV(HIGH,75)-LLV(LOW,75))*100,20,1),15,1);
DRAWTEXT(VAR11 AND COUNT(VAR11,30)=1,L*0.95,'进'),LINETHICK1,COLORWHITE;
VAR1A:=IF(VARE>0,VARE,0);
VAR1B:=IF(VAR14>=200 AND VAR13>=150,15,IF(VAR14<=-200 AND VAR13<=-150,-15,VAR16))+60;
VAR1C:=VAR1A>48 AND VAR1B>60 AND VAR19<100;
DRAWTEXT(VAR1C AND COUNT(VAR1C,30)=1,LOW,'顶') COLORWHITE;
指标王:=CROSS(SMA((CLOSE-LLV(LOW,8))/(HHV(HIGH,8)-LLV(LOW,8))*100,3,1),SMA(SMA((CLOSE-LLV(LOW,8))/(HHV(HIGH,8)-LLV(LOW,8))*100,3,1),3,1)) AND SMA((CLOSE-LLV(LOW,8))/(HHV(HIGH,8)-LLV(LOW,8))*100,3,1)<20;
DRAWTEXT(指标王,H*1.02,'建'),COLORYELLOW;
DRAWTEXT(VAR1,L*0.98,'买'),COLORYELLOW;
DRAWTEXT(CROSS(MA(C,3),MA(C,9)) AND C>=REF(C,1) AND C>O,L,'加'),COLORMAGENTA;
{下降压力线:=DRAWLINE(HIGH>=HHV(HIGH,10),HIGH,LOW<=LLV(LOW,3),HHV(HIGH,3),1),LINETHICK2;
STICKLINE(CURRBARSCOUNT=2,L,L,10,0),COLORGREEN;
DRAWNUMBER(ISLASTBAR,REF(L,1),REF(L,1));}
{九转}
AH:=HHV(H,60);
AL:=LLV(L,60);
A0:=(AH-AL)/21;
A1:=C>REF(C,4);
NT:=BARSLASTCOUNT(A1);
TJ11:=NT=9;
TJ13:=ISLASTBAR AND BETWEEN(NT,5,8);
AY:=(BACKSET(TJ11>0,9) OR BACKSET(TJ13>0,NT))*NT;
DRAWTEXT(AY>0,H+1.1*A0,VAR2STR(AY,0)),COLORYELLOW;
DRAWTEXT(NT=9,H+1.1*A0,'9'),COLORGREEN;
DRAWTEXT(NT=13,H+1.1*A0,'13'),COLORGREEN;
DRAWTEXT(NT=18,H+1.1*A0,'18'),COLORGREEN;
B1:=C<REF(C,4);
NT0:=BARSLASTCOUNT(B1);
TJ21:=NT0=9 ;
TJ23:=ISLASTBAR AND BETWEEN(NT0,5,8);
AY1:=(BACKSET(TJ21>0,9) OR BACKSET(TJ23>0,NT0))*NT0;
DRAWTEXT(AY1>0,L-1*A0,VAR2STR(AY1,0)),COLORLIGREEN;
DRAWTEXT(NT0=9,H+1.1*A0,'9'),COLORYELLOW;
DRAWTEXT(NT0=13,H+1.1*A0,'13'),COLORYELLOW;
DRAWTEXT(NT0=18,H+1.1*A0,'18'),COLORYELLOW;
ZF:=(C-REF(C,1))/REF(C,1)*100;
假阳线:=C>O AND ZF<0 AND O<REF(L,1);
STICKLINE(假阳线,O,C,0.5,0),COLORMAGENTA;
{势}
笔周期:=3;
画趋势:=0;
A11:=REF(HIGH,3)=HHV(HIGH,笔周期*3+1);
B11:=FILTER(A11,3);
C1:=BACKSET(B1,3+1);
D1:=FILTER(C1,3);
A2:=REF(LOW,3)=LLV(LOW,笔周期*3+1);
B2:=FILTER(A2,3);
C22:=BACKSET(B2,3+1);
D2:=FILTER(C2,3);
E1:=(REF(LLV(LOW,2*3),1)+REF(HHV(HIGH,2*3),1))/2;
E2:=(HIGH+LOW)/2;
H1:=(D1 AND NOT(D2 AND E1>=E2)) OR BARSTATUS=2 OR BARSCOUNT(CLOSE)=1;
H2:=D1 AND NOT(D2 AND E1>=E2);
L1:=D2 AND NOT(D1 AND E1=E2);
X1:=REF(BARSLAST(H1),1)+1;
F11:=BACKSET(H1 AND COUNT(L1,X1)>0,LLVBARS(IF(L1,LOW,10000),X1));
G1:=F1>REF(F1,1);
I1:=BACKSET(G1,2);
LD:=I1>REF(I1,1);
L2:=LD OR BARSTATUS=2 OR BARSCOUNT(CLOSE)=1;
X2:=REF(BARSLAST(L2),1)+1;
F2:=BACKSET(L2 AND COUNT(H2,X2)>0,HHVBARS(IF(H2,HIGH,0),X2));
G2:=F2>REF(F2,1);
I2:=BACKSET(G2,2);
HD:=I2>REF(I2,1);
DRAWLINE(LD,L,HD,H,0),COLORYELLOW,LINETHICK1;
DRAWLINE(HD,H,LD,L,0),COLORYELLOW,LINETHICK1;
J1:=BACKSET(BARSTATUS=2,MIN(BARSLAST(HD),BARSLAST(LD))+1);
J2:=J1>REF(J1,1);
DRAWLINE(LD,L,HD,H,0),COLORLIRED,LINETHICK1;
DRAWLINE(HD,H,LD,L,0),COLORLIGREEN,LINETHICK1;
势:DRAWLINE(J2,IF(HD,H,L),BARSTATUS=2,IF(BARSLAST(HD)>BARSLAST(LD),H,L),0),DOTLINE,COLORYELLOW,LINETHICK1;
{顶底}
DRAWTEXT(CROSS(ZIG(3,8),REF(ZIG(3,8),1)),LOW*0.96,'底'),LINETHICK2,COLORYELLOW;
DRAWTEXT(CROSS(REF(ZIG(3,10),1),ZIG(3,10)),HIGH*1.02,'顶'),LINETHICK2,COLORYELLOW;
{止盈止损}
CC0:=IF(CURRBARSCOUNT<18,CONST(REF(C,1)),DRAWNULL),COLOR000000,NODRAW;
止赢:1.05*CC0,COLORMAGENTA,LINETHICK1;
{DRAWTEXT(ISLASTBAR,止赢,'止赢'),LINETHICK1;}
止损:0.97*CC0,COLORYELLOW,LINETHICK1;
{DRAWTEXT(ISLASTBAR,止损,'止损'),LINETHICK1;}
{DRAWNUMBER(ISLASTBAR ,C,C),COLORWHITE;};
{高量柱}
TJ0:=VOL>=REF(V,1)*2.8 AND C>REF(C,1)*1.01;
STICKLINE(TJ0,OPEN,CLOSE,1,0),COLORYELLOW;
TJ10:=VOL>=REF(V,1)*3;
STICKLINE(TJ10,OPEN,CLOSE,1.5,0),COLORYELLOW;
{BBI}
{N10:=3;N20:=6;N3:=12;N4:=24;
BBI:(MA(CLOSE,N10)+MA(CLOSE,N20)+MA(CLOSE,N3)+MA(CLOSE,N4))/4,COLORRED,LINETHICK1;
BBB:=BBI<REF(BBI,1);
IF(BBB,BBI,DRAWNULL)COLORGREEN,LINETHICK1;}
{分析分析}
HAN:=DATE<1301230;
TT:=240/FROMOPEN;
比:=TT;
促进指数MFL:=(HIGH-LOW)*1000000/(VOL*比),COLORRED;
AY2:=EMA(CLOSE,12)-EMA(CLOSE,26);
AZ2:=EMA(AY2,9);
LT2:=(AY2-AZ2);
L211:=IF(LT2,LLV(L,21),DRAWNULL),COLOR217158,CIRCLEDOT;
ZGD:=HHV(H,80)*0.99;
ZGD2:=CONST(ZGD);
ZDD:=LLV(L211,80);
ZDD2:=CONST(ZDD);
YYA4:=MA(CLOSE,20);
YYA5:=(CLOSE > MA(CLOSE,5));
YYA6:=(MA(CLOSE,5) > MA(CLOSE,10));
YYA7:=(CLOSE > MA(CLOSE,10));
YYA8:=(MA(CLOSE,5) > MA(CLOSE,20));
YYA9:=(CLOSE > MA(CLOSE,20));
YYA10:=REF(YYA4,1);
YYA11:=(YYA4 > YYA10);
YYAVX:=(((((IF(YYA5,10,(0 - 10)) + IF(YYA6,10,(0 - 10))) + IF(YYA7,10,(0 - 10))) + IF(YYA8,10,(0 - 10))) + IF(YYA9,10,(0 -
10))) + IF(YYA11,10,(0 - 10)));
DSLX:=(CLOSE / INDEXC);
DSLX1:=MA(DSLX,5);
YYV1:=MA(VOL,5);
YYV2:=MA(VOL,10);
情况1:=CONST(IF(((CROSS(YYAVX,1) AND (YYV1*HAN >= YYV2)) AND (DSLX >= DSLX1)),1,0));
情况2:=CONST(IF(((CROSS(YYAVX,1) AND (YYV1*HAN < YYV2)) AND (DSLX >= DSLX1)),1,0));
情况3:=CONST(IF(((CROSS(YYAVX,1) AND (YYV1*HAN > YYV2)) AND (DSLX < DSLX1)),1,0));
情况4:=CONST(IF(((CROSS(YYAVX,1) AND (YYV1*HAN <= YYV2)) AND (DSLX < DSLX1)),1,0));
情况9:=CONST(IF(((((YYAVX >= 1) AND (REF(YYAVX,1) > 0)) AND (YYV1 >= YYV2)) AND (DSLX >= DSLX1)),1,0));
情况10:=CONST(IF(((((YYAVX >= 1) AND (REF(YYAVX,1) > 0)) AND (YYV1 < YYV2)) AND (DSLX >= DSLX1)),1,0));
大盘3:=CONST(IF((CROSS(1,YYAVX) AND (YYV1 >= YYV2)),1,0));
大盘5:=CONST(IF((((YYAVX >= 1) AND (REF(YYAVX*HAN,1) > 0)) AND (YYV1 >= YYV2)),1,0));
DRAWTEXT(情况1=1 AND (CLOSE < 200) AND CURRBARSCOUNT=70,1,'量能理想,明显走强,仓位在2/3左右')*HAN,COLOR00FFFF;
DRAWTEXT(情况2=1 AND (CLOSE < 200) AND CURRBARSCOUNT=70,1,'走势趋强,量能不足,短线进场,仓位在1/2左右')*HAN,COLOR00FFFF;
DRAWTEXT(情况3=1 AND (CLOSE < 200) AND CURRBARSCOUNT=70,1,'量价良好,并没有明显走强,短线进场,仓位1/2左右。 ')*HAN,COLOR00FFFF;
DRAWTEXT(情况4=1 AND (CLOSE < 200) AND CURRBARSCOUNT=70,1,'形态尚可,量能不足,未完全走强,短线参与,仓位1/3左右')*HAN,COLOR00FFFF;
DRAWTEXT(情况9=1 AND (CLOSE < 200) AND CURRBARSCOUNT=70,1,'该股形态良好,强势明显,量能充足,可以继续持有。 ')*HAN,COLOR00FFFF;
DRAWTEXT(情况10=1 AND (CLOSE < 200) AND CURRBARSCOUNT=70,1,'该股上行趋势不变,强势依然,但量能开始转弱,注意风险 ')*HAN,COLOR00FFFF;
{趋势评分}
X01:=IF(MA(C,5)>MA(C,10),20,0);
X02:=IF(MA(C,20)>MA(C,60),10,0);
X3:=IF(KDJ.J>KDJ.K,10,0);
X4:=IF(MACD.DIF>MACD.DEA,10,0);
X5:=IF(MACD.MACD>0,10,0);
X6:=IF(V>MA(V,60),10,0);
X7:=IF(WINNER(C)>0.5,10,0);
X8:=IF(C/REF(C,1)>1.03,10,0);
XX:=X01+X02+X3+X4+X5+X6+X7+X8;
DRAWTEXT_FIX(V>O,0.4,0.05,0,STRCAT('趋势评分: ',STRCAT(CON2STR(XX,0),' '))),COLORYELLOW;
{补仓卖}
VAB0:=531;
VAB1:=1510000;
VAB2:=VAB0 + VAB1;
VAB3:=IF(DATE > VAB2,0,1);
VARA12:=SMA(H,10,9)*VAB3;
VARA13:=SMA(L,10,9)*VAB3;
卖价:VARA12,COLORRED,NODRAW;
补仓:VARA13,COLORGREEN,NODRAW;
DRAWTEXT_FIX(1,0.75,0.05,0,STRCAT('补仓:',STRCAT(CON2STR(补仓,2),' '))),COLORRED;
DRAWTEXT_FIX(1,1,0.05,0,STRCAT('卖价:',STRCAT(CON2STR(卖价,2),' '))),COLORGREEN;
{上涨下跌数}
上涨:"999999$ADVANCE"+"399001$ADVANCE",COLORRED,NODRAW;
下跌:"999999$DECLINE"+"399001$DECLINE",COLORLIGREEN,NODRAW;
{涨跌:上涨/(上涨+下跌)*100,NODRAW;}
DRAWTEXT_FIX(1,0.0,0.05,0,STRCAT('上涨:',STRCAT(CON2STR(上涨,0),' '))),COLORRED;
DRAWTEXT_FIX(1,0.23,0.05,0,STRCAT('下跌:',STRCAT(CON2STR(下跌,0),' '))),COLORGREEN;
{1日3日净买入}
总额:=AMOUNT;
买:=IF(O=C AND (C-REF(C,1))/REF(C,1)*100>9.8,AMOUNT,AMOUNT/((H-L)*2-ABS(O-C))*(C-L));
买%:=买/AMOUNT*100;
流入:=AMOUNT*买%/10000000000;
流出:=AMOUNT/100000000-流入;
净流:=(流入-流出);
总额3:=SUM(AMOUNT,3);
流入3:=SUM(流入,3);
流出3:=SUM(流出,3);
净流3:=SUM(流入-流出,3);
DRAWTEXT_FIX(1,0,0.12,0,'净流(亿):'),COLOR8080FF,COLORWHITE;
DRAWTEXT_FIX(1,0.05,0.2,0,'1日'),COLOR8080FF,COLORWHITE;
DRAWTEXT_FIX(1,0.15,0.2,0,'3日'),COLOR8080FF,COLORWHITE;
DRAWNUMBER_FIX(1,0,0.25,0,CONST((净流))),COLORYELLOW;
DRAWNUMBER_FIX(1,0.15,0.25,0,CONST((净流3))),COLORYELLOW;
竞价额:=DYNAINFO(15)/10000;{万元}
DRAWTEXT_FIX(C>0,0.59,0.05,0,VARCAT(VARCAT('竞价: ',VAR2STR(竞价额,0)),' 万')),
COLORMAGENTA;
涨跌停:=(C-REF(C,1))/REF(C,1)*100;
STICKLINE(涨跌停>9.8,O,C,2.5,0),COLORFF00FF;
STICKLINE(涨跌停<-9.8,O,C,3.2.5,0),COLORGREEN;
STICKLINE(涨跌停>6 AND 涨跌停<9.8,O,C,3.2.5,0),COLORRED;
未来函数检测结果如下:
该公式包含未来函数:ZIG
该公式包含未来函数:TROUGH
该公式包含未来函数:TROUGHBARS
该公式包含未来函数:BACKSET
该公式包含未来函数:WINNER
该公式包含未来函数:CAPITAL
该公式包含未来函数:DYNAINFO
该公式包含未来函数:XMA
解密、定制、编写股票指标请联系QQ或微信同号:88652583
相关股票指标公式
原理解析:
DRAWGBK(C>0,RGB(0,0,110),RGB(0,25,0),0,' ',0)
输出涨幅:(C-90日内C最低值)/90日内C最低值*100,NODRAW,COLORRED
如果PERIOD=5返回120否则返回240
VAR30赋值:(CLOSE的30日指数移动平均+CLOSE的72日指数移动平均)/2
当满足条件1时,在横轴0.88纵轴5位置书写文字
HZZ赋值:1220601
如果DATEZ1赋值:STRCAT(HYBLOCK,' ')*HZ
Z2赋值:STRCAT(Z1,DYBLOCK)*HZ
Z3赋值:STRCAT(Z2,' ')
DRAWTEXT_FIX(ISLASTBAR,0,0,0,STRCAT(Z3,GNBLOCK)),COLORRED
金牛赋值:(XXH的25日简单移动平均,25)-XXL的25日简单移动平均,25))*1+XXH的25日简单移动平均,25)*HZ,DOTLINE,画黄色
输出金钻:XXL的25日简单移动平均,25)-(XXH的25日简单移动平均,25)-XXL的25日简单移动平均,25))*1,LINETHICK2,画黄色,POINTDOT
金牛2:=金钻的25日指数移动平均画青色,LINETHICK2
DRAWKLINE(H,O,L,C)
STICKLINE(金钻>最低价 AND 金钻<最高价,金钻,开盘价和CLOSE的较小值,金钻),2,0),画黄色
STICKLINE(金钻>C和O的较小值 AND 金钻当满足条件金钻>最高价时,在开盘价和CLOSE之间画柱状线
当满足条件金钻>最高价时,在最高价和最低价之间画柱状线
DRAWBAND(金钻,RGB(55,0,0),金牛2,RGB(0,91,0))
VAR23赋值:100*XMA(XMA((C-1日前的C),6),6)/XMA(XMA((C-1日前的C的绝对值),6),6)
回调买赋值:2日内VAR23最低值=7日内VAR23最低值 AND 统计2日满足VAR23<0的天数 AND CROSS(VAR23,VAR23的2日简单移动平均)
XG赋值:金钻>最高价 AND 回调买 AND L<=金钻
当满足条件XG时,在L和'买'位置书写文字
JJJJ赋值:(最高价+最低价+CLOSE)/3
如果最高价=最低价返回4否则返回最高价-最低价
QJ1赋值:IF(CAPITAL=0,QJ0*(JJJJ-CLOSE和开盘价的较小值),QJ0*IF(最高价=最低价,1,(开盘价和CLOSE的较小值-最低价)))
QJ2赋值:IF(CAPITAL=0,QJ0*(开盘价和CLOSE的较小值-最低价),QJ0*IF(最高价=最低价,1,(JJJJ-CLOSE和开盘价的较小值)))
QJ3赋值:IF(CAPITAL=0,QJ0*(最高价-开盘价和CLOSE较大值),QJ0*IF(最高价=最低价,1,(最高价-开盘价和CLOSE较大值)))
QJ4赋值:IF(CAPITAL=0,QJ0*(CLOSE和开盘价较大值-JJJJ),QJ0*IF(最高价=最低价,1,(CLOSE和开盘价较大值-JJJJ)))
如果CAPITAL=0返回10000否则返回10000
V2赋值:SMA(IF(C>=1日前的C,DDX,-DDX/100),2,1)
V2*120/FROM开盘价*5的2日[1日权重]移动平均
V5的5日[1日权重]移动平均
V10的5日[1日权重]移动平均
DY赋值:CURRBARSCOUNT=1 AND C<1日前的C
DY2:=1日前的V2-DY
XG2:=C>O AND DY2<0.02 AND C的5日简单移动平均>C的60日简单移动平均 AND C/1日前的C>=1.02 AND H<金牛
当满足条件XG2 AND L<金钻时,在L和'金钻起涨'位置书写文字
F1赋值:ZIG(3,10)
T1赋值:F1>1日前的F1 AND 1日前的F1<=2日前的F1
T2赋值:F1<1日前的F1 AND 1日前的F1>=2日前的F1
当满足条件T1时,在O和C之间画柱状线
当满足条件T2时,在O和C之间画柱状线
AAC赋值:CLOSE/1日前的CLOSE>=1.04
当满足条件AAC时,在H和L之间画柱状线
Z1A:=STRCAT(HYBLOCK,' ')
Z2A:=STRCAT(Z1A,FGBLOCK)
Z3A:=STRCAT(Z2A,DYBLOCK)
Z4A赋值:STRCAT(Z3A,' ')
DRAWTEXT_FIX(ISLASTBAR,0.25,0.98,0,STRCAT(Z4A,GNBLOCK)),画青色
{平台启动}GG赋值:CROSS(C的5日简单移动平均,C的20日简单移动平均) AND CROSS(C的5日简单移动平均,C的30日简单移动平均) AND CROSS(C的5日简单移动平均,C的60日简单移动平均)
BB赋值:C的60日简单移动平均>C的10日简单移动平均 AND CROSS(C的10日简单移动平均,C的30日简单移动平均) AND C的30日简单移动平均>C的20日简单移动平均 AND C的60日简单移动平均-C的20日简单移动平均的绝对值/C的20日简单移动平均<0.05
JJ赋值:C的30日简单移动平均>C的5日简单移动平均 AND CROSS(C的5日简单移动平均,C的20日简单移动平均) AND C的20日简单移动平均>C的10日简单移动平均
DD赋值:(C的5日简单移动平均-C的10日简单移动平均的绝对值+(C的10日简单移动平均-C的20日简单移动平均)+(C的20日简单移动平均-C的30日简单移动平均))<0.02 AND C的5日简单移动平均>REF(C的5日简单移动平均,1) AND C的10日简单移动平均>REF(C的10日简单移动平均,1)
EE赋值:C的20日简单移动平均>C的5日简单移动平均 AND CROSS(C的5日简单移动平均,C的10日简单移动平均) AND C的10日简单移动平均>C的60日简单移动平均 AND C的20日简单移动平均-C的60日简单移动平均的绝对值/C的60日简单移动平均<0.05
FF赋值:GG OR BB OR JJ OR DD OR EE
C2赋值:1日前的C
涨停赋值:IF((C-C2)*100/C2>=(10-0.01*100/C2),1,0)
当满足条件涨停时,在开盘价和CLOSE之间画柱状线
当满足条件涨停时,在H和L之间画柱状线
跌停赋值:IF((C2-C)*100/C2>=(10-0.01*100/C2),1,0)
当满足条件跌停时,在开盘价和CLOSE之间画柱状线
当满足条件跌停时,在H和L之间画柱状线
GSPT1赋值:(21日内最高价最高值-CLOSE)/(21日内最高价最高值-21日内最低价最低值)*100-10
GSPT2赋值:(CLOSE-21日内最低价最低值)/(21日内最高价最高值-21日内最低价最低值)*100
GSPT2的13日[8日权重]移动平均
GSPT3的13日[8日权重]移动平均
GSPT1的21日[8日权重]移动平均
AABB赋值:IF(L,CONST(L),DRAWNULL)
当满足条件GSPT4-GSPT5>75时,在AABB和AABB*0.99之间画柱状线
AAA赋值:(3*C+H+L+O)/6
VAR1赋值:(8*AAA+7*1日前的AAA+6*2日前的AAA+5*3日前的AAA+4*4日前的AAA+3*5日前的AAA+2*6日前的AAA+8日前的AAA)/36
VAR2赋值:(5日内VAR1最高值+10日内VAR1最高值+20日内VAR1最高值)/3
VAR3赋值:(5日内VAR1最低值+10日内VAR1最低值+20日内VAR1最低值)/3
VAR4赋值:(5日内VAR2最高值+10日内VAR2最高值+20日内VAR2最高值)/3
VAR5赋值:(5日内VAR3最低值+10日内VAR3最低值+20日内VAR3最低值)/3
VAR6赋值:(2日内VAR1最低值+4日内VAR1最低值+6日内VAR1最低值)/3
短线赋值:VAR1,画白色
中线赋值:VAR6,画黄色
当满足条件C>=O时,在C和O之间画柱状线
当满足条件C>=O时,在C和O之间画柱状线
当满足条件C>=O时,在C和O之间画柱状线
当满足条件C>=O时,在C和O之间画柱状线
当满足条件C>=O时,在C和O之间画柱状线
当满足条件C>=O时,在C和O之间画柱状线
当满足条件C>=O时,在H和L之间画柱状线
当满足条件C当满足条件C当满足条件C当满足条件C当满足条件C当满足条件C当满足条件CHIGHN赋值:10
LOWN赋值:10
HIGHDISPLAY赋值:0
LOWDISPLAY赋值:0
ZGDISPLAY赋值:0
MADISPLAY赋值:0
AA赋值:HIGHN日前的H=2*HIGHN+1日内H最高值
QY赋值:BACKSET(AA,HIGHN+1)
CC赋值:QY的HIGHN过滤 AND H=HIGHN+1日内H最高值
当满足条件CC时,在H和2之间画图标
DDD赋值:上次CC距今天数
如果CC返回CURRBARSCOUNT否则返回0
DINGBU赋值:IF(DDD,DDD日前的H,H)
DINGBUTS赋值:IF(DDD,DDD日前的GDTS,GDTS)
DINGBU1:=DDD+1日前的DINGBU
GDCS1赋值:CONST(DINGBUTS)
DINGBUTS1:=DDD+1日前的DINGBUTS
GDCS2赋值:CONST(DINGBUTS1)
DINGBU2:=DDD+1日前的DINGBU1
如果CURRBARSCOUNT>GDCS2返回0否则返回1
输出上轨:DRAWLINE(CURRBARSCOUNT=GDCS2,H,CURRBARSCOUNT=GDCS1,H,1) COLORBLUE,LINETHICK1
输出次高:DRAWLINE(CURRBARSCOUNT=GDCS2,H,ISLASTBAR,GDCS2-1日前的H,1),COLOR0055FF,POINTDOT
输出高:DRAWLINE(CURRBARSCOUNT=GDCS1,H,ISLASTBAR,GDCS1-1日前的H,1),画黄色,POINTDOT
AA1:=LOWN日前的L=2*LOWN+1日内L最低值
QY1:=BACKSET(AA1,LOWN+1)
CC1:=QY1的LOWN过滤 AND L=LOWN+1日内L最低值
当满足条件CC1时,在L和1之间画图标
DD1:=上次CC1距今天数
如果CC1返回CURRBARSCOUNT否则返回0
YDB赋值:IF(DD1,DD1日前的L,L)
DDTS1:=IF(DD1,DD1日前的DDTS,DDTS)
DDCS1:=CONST(DDTS1)
ZDB赋值:DD1+1日前的YDB
DDTS2:=DD1+1日前的DDTS1
DDCS2:=CONST(DDTS2)
输出下轨:DRAWLINE(CURRBARSCOUNT=DDCS2,L,CURRBARSCOUNT=DDCS1,L,1) COLORRED,LINETHICK1
ZGSTAR赋值:(上轨+下轨)/2
ZGEND赋值:CONST((上轨+下轨)/2)
如果DDCS2输出中轨:DRAWLINE(CURRBARSCOUNT=STARDAY,ZGSTAR,ISLASTBAR,ZGEND,1),COLORFF55BB,LINETHICK1
输出次底:DRAWLINE(CURRBARSCOUNT=DDCS1,L,ISLASTBAR,DDCS1-1日前的L,1),COLORMAGENTA,POINTDOT
输出底:DRAWLINE(CURRBARSCOUNT=DDCS2,L,ISLASTBAR,DDCS2-1日前的L,1),画青色,POINTDOT
VAR7赋值:0
VAR8赋值:SMA(CLOSE-1日前的CLOSE和0较大值,34,1)/SMA(CLOSE-1日前的CLOSE的绝对值,7,1)*100
VAR9赋值:SMA(CLOSE-1日前的CLOSE和0较大值,13,1)/SMA(CLOSE-1日前的CLOSE的绝对值,13,1)*100
VAR10:=IF(TROUGHBARS(3,16,1)=0 AND 最高价>最低价+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),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),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),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),2) AND REF(ZIG(3,72),2)>=REF(ZIG(3,72),3)]
VAR19:=CLOSE的2日指数移动平均-CLOSE的150日指数移动平均
买1赋值:VAR10
买2赋值:(VAR11+VAR13+VAR15+VAR17)
卖1赋值:(VAR12+VAR14+VAR16+VAR18)
如果买1>0 OR 买2>0返回最低价*0.99否则返回DRAWNULL
当满足条件买1>0 OR 买2>0时,在最低价*0.99和'买'位置书写文字
如果卖1>0返回最高价*1.01否则返回DRAWNULL
当满足条件卖1>0时,在最高价*1.02和'卖'位置书写文字
DRAWICON((ZIG(3,5)>REF(ZIG(3,5),1)) AND (REF(ZIG(3,5),1)<=REF(ZIG(3,5),2)) AND (REF(ZIG(3,5),2)<=REF(ZIG(3,5),3)),最低价*0.98,1)
DRAWICON((ZIG(3,5)[=REF(ZIG(3,5),2)) AND (REF(ZIG(3,5),2)>=REF(ZIG(3,5),3)),最高价*1.01,2)]
ZB赋值:VAR3的5日指数移动平均,5)*3, COLORSTICK
VARA赋值:IF(VAR9 AND CROSS(CLOSE的3日简单移动平均,CLOSE的5日简单移动平均),20,0)
K赋值:VAR7的5日指数移动平均*2, , COLORFF00FF
D赋值:K的5日指数移动平均, , 画白色
J赋值:K*3-D*2, ,画黄色
VARB赋值:BETWEEN(CLOSE,CLOSE的3日简单移动平均,CLOSE的5日简单移动平均) AND J>10
HS赋值:成交量/CAPITAL*100, , COLORGREEN
VARE赋值:MA(100*(CLOSE-34日内CLOSE最低值)/(34日内最高价最高值-34日内最低价最低值),5)-20
VARF赋值:100-3*SMA((CLOSE-75日内最低价最低值)/(75日内最高价最高值-75日内最低价最低值)*100,20,1)+2*SMA(SMA((CLOSE-75日内最低价最低值)/(75日内最高价最高值-75日内最低价最低值)*100,20,1),15,1)
DRAWTEXT(VAR11 AND 统计30日满足VAR11的天数=1,L*0.95,'进'),LINETHICK1,画白色
如果VARE>0返回VARE否则返回0
VAR1B赋值:IF(VAR14>=200 AND VAR13>=150,15,IF(VAR14<=-200 AND VAR13<=-150,-15,VAR16))+60
VAR1C:=VAR1A>48 AND VAR1B>60 AND VAR19<100
DRAWTEXT(VAR1C AND 统计30日满足VAR1C的天数=1,最低价,'顶') 画白色
指标王赋值:CROSS(SMA((CLOSE-8日内最低价最低值)/(8日内最高价最高值-8日内最低价最低值)*100,3,1),SMA(SMA((CLOSE-8日内最低价最低值)/(8日内最高价最高值-8日内最低价最低值)*100,3,1),3,1)) AND SMA((CLOSE-8日内最低价最低值)/(8日内最高价最高值-8日内最低价最低值)*100,3,1)<20
当满足条件指标王时,在H*1.02和'建'位置书写文字
当满足条件VAR1时,在L*0.98和'买'位置书写文字
DRAWTEXT(CROSS(C的3日简单移动平均,C的9日简单移动平均) AND C>=1日前的C AND C>O,L,'加'),COLORMAGENTA
{下降压力线赋值:DRAWLINE(最高价>=10日内最高价最高值,最高价,最低价<=3日内最低价最低值,3日内最高价最高值,1),LINETHICK2
当满足条件CURRBARSCOUNT=2时,在L和L之间画柱状线
DRAWNUMBER(ISLASTBAR,1日前的L,1日前的L)
}{九转}AH赋值:60日内H最高值
AL赋值:60日内L最低值
A0赋值:(AH-AL)/21
A1赋值:C>4日前的C
NT赋值:BARSLASTCOUNT(A1)
TJ11:=NT=9
TJ13:=ISLASTBAR AND BETWEEN(NT,5,8)
AY赋值:(BACKSET(TJ11>0,9) OR BACKSET(TJ13>0,NT))*NT
DRAWTEXT(AY>0,H+1.1*A0,VAR2STR(AY,0)),画黄色
当满足条件NT=9时,在H+1.1*A0和'9'位置书写文字
当满足条件NT=13时,在H+1.1*A0和'13'位置书写文字
当满足条件NT=18时,在H+1.1*A0和'18'位置书写文字
B1:=C<4日前的C
NT0:=BARSLASTCOUNT(B1)
TJ21:=NT0=9
TJ23:=ISLASTBAR AND BETWEEN(NT0,5,8)
AY1:=(BACKSET(TJ21>0,9) OR BACKSET(TJ23>0,NT0))*NT0
DRAWTEXT(AY1>0,L-1*A0,VAR2STR(AY1,0)),COLORLIGREEN
当满足条件NT0=9时,在H+1.1*A0和'9'位置书写文字
当满足条件NT0=13时,在H+1.1*A0和'13'位置书写文字
当满足条件NT0=18时,在H+1.1*A0和'18'位置书写文字
ZF赋值:(C-1日前的C)/1日前的C*100
假阳线赋值:C>O AND ZF<0 AND O<1日前的L
当满足条件假阳线时,在O和C之间画柱状线
{势}笔周期赋值:3
画趋势赋值:0
A11:=3日前的最高价=笔周期*3+1日内最高价最高值
B11:=A11的3过滤
C1赋值:BACKSET(B1,3+1)
D1:=C1的3过滤
A2赋值:3日前的最低价=笔周期*3+1日内最低价最低值
B2:=A2的3过滤
C22:=BACKSET(B2,3+1)
D2:=C2的3过滤
E1赋值:(REF(2*3日内最低价最低值,1)+REF(2*3日内最高价最高值,1))/2
E2赋值:(最高价+最低价)/2
H1赋值:(D1 AND NOT(D2 AND E1>=E2)) OR BARSTATUS=2 OR CLOSE的有效数据周期数=1
H2赋值:D1 AND NOT(D2 AND E1>=E2)
L1赋值:D2 AND NOT(D1 AND E1=E2)
X1赋值:REF(上次H1距今天数,1)+1
如果L1返回最低价否则返回10000
G1赋值:F1>1日前的F1
I1赋值:BACKSET(G1,2)
LD赋值:I1>1日前的I1
L2赋值:LD OR BARSTATUS=2 OR CLOSE的有效数据周期数=1
X2赋值:REF(上次L2距今天数,1)+1
如果H2返回最高价否则返回0
G2赋值:F2>1日前的F2
I2赋值:BACKSET(G2,2)
HD赋值:I2>1日前的I2
DRAWLINE(LD,L,HD,H,0),画黄色,LINETHICK1
DRAWLINE(HD,H,LD,L,0),画黄色,LINETHICK1
J1:=BACKSET(BARSTATUS=2,MIN(上次HD距今天数,BARSLAST(LD))+1)
J2:=J1>1日前的J1
DRAWLINE(LD,L,HD,H,0),COLORLIRED,LINETHICK1
DRAWLINE(HD,H,LD,L,0),COLORLIGREEN,LINETHICK1
如果HD返回H否则返回L
{顶底}DRAWTEXT(CROSS(ZIG(3,8),REF(ZIG(3,8),1)),最低价*0.96,'底'),LINETHICK2,画黄色
DRAWTEXT(CROSS(REF(ZIG(3,10),1),ZIG(3,10)),最高价*1.02,'顶'),LINETHICK2,画黄色
{止盈止损}CC0:=IF(CURRBARSCOUNT<18,CONST(1日前的C),DRAWNULL),COLOR000000,NODRAW
输出止赢:1.05*CC0,COLORMAGENTA,LINETHICK1
当满足条件ISLASTBAR时,在止赢和'止赢'位置书写文字
输出}止损:0.97*CC0,画黄色,LINETHICK1
当满足条件ISLASTBAR时,在止损和'止损'位置书写文字
}{DRAWNUMBER(ISLASTBAR ,C,C),画白色
}
{高量柱}TJ0:=成交量>=1日前的V*2.8 AND C>1日前的C*1.01
当满足条件TJ0时,在开盘价和CLOSE之间画柱状线
TJ10:=成交量>=1日前的V*3
当满足条件TJ10时,在开盘价和CLOSE之间画柱状线
{BBI}{N10:=3
N20赋值:6
N3赋值:12
N4赋值:24
BBI:(CLOSE的N10日简单移动平均+CLOSE的N20日简单移动平均+CLOSE的N3日简单移动平均+CLOSE的N4日简单移动平均)/4,COLORRED,LINETHICK1
BBB赋值:BBI<1日前的BBI
如果BBB返回BBI否则返回DRAWNULL
}{分析分析}HAN赋值:DATE<1301230
TT赋值:240/FROM开盘价
比赋值:TT
促进指数MFL赋值:(最高价-最低价)*1000000/(成交量*比),COLORRED
AY2:=CLOSE的12日指数移动平均-CLOSE的26日指数移动平均
AZ2赋值:AY2的9日指数移动平均
LT2赋值:(AY2-AZ2)
L211:=IF(LT2,21日内L最低值,DRAWNULL),COLOR217158,CIRCLEDOT
ZGD赋值:80日内H最高值*0.99
ZGD2:=CONST(ZGD)
ZDD赋值:80日内L211最低值
ZDD2:=CONST(ZDD)
YYA4赋值:CLOSE的20日简单移动平均
YYA5赋值:(CLOSE > CLOSE的5日简单移动平均)
YYA6赋值:(CLOSE的5日简单移动平均 > CLOSE的10日简单移动平均)
YYA7赋值:(CLOSE > CLOSE的10日简单移动平均)
YYA8赋值:(CLOSE的5日简单移动平均 > CLOSE的20日简单移动平均)
YYA9赋值:(CLOSE > CLOSE的20日简单移动平均)
YYA10:=1日前的YYA4
YYA11:=(YYA4 > YYA10)
YYAVX赋值:(((((IF(YYA5,10,(0 - 10)) + IF(YYA6,10,(0 - 10))) + IF(YYA7,10,(0 - 10))) + IF(YYA8,10,(0 - 10))) + IF(YYA9,10,(0 -10))) + IF(YYA11,10,(0 - 10)))
DSLX:=(CLOSE / INDEXC)
DSLX1赋值:DSLX的5日简单移动平均
YYV1赋值:成交量的5日简单移动平均
YYV2赋值:成交量的10日简单移动平均
情况1赋值:CONST(IF(((YYAVX上穿1 AND (YYV1*HAN >= YYV2)) AND (DSLX >= DSLX1)),1,0))
情况2赋值:CONST(IF(((YYAVX上穿1 AND (YYV1*HAN < YYV2)) AND (DSLX >= DSLX1)),1,0))
情况3赋值:CONST(IF(((YYAVX上穿1 AND (YYV1*HAN > YYV2)) AND (DSLX < DSLX1)),1,0))
情况4赋值:CONST(IF(((YYAVX上穿1 AND (YYV1*HAN <= YYV2)) AND (DSLX < DSLX1)),1,0))
情况9赋值:CONST(IF(((((YYAVX >= 1) AND (1日前的YYAVX > 0)) AND (YYV1 >= YYV2)) AND (DSLX >= DSLX1)),1,0))
情况10:=CONST(IF(((((YYAVX >= 1) AND (1日前的YYAVX > 0)) AND (YYV1 < YYV2)) AND (DSLX >= DSLX1)),1,0))
大盘3赋值:CONST(IF((1上穿YYAVX AND (YYV1 >= YYV2)),1,0))
大盘5赋值:CONST(IF((((YYAVX >= 1) AND (1日前的YYAVX*HAN > 0)) AND (YYV1 >= YYV2)),1,0))
DRAWTEXT(情况1=1 AND (CLOSE < 200) AND CURRBARSCOUNT=70,1,'量能理想,明显走强,仓位在2/3左右')*HAN,COLOR00FFFF
DRAWTEXT(情况2=1 AND (CLOSE < 200) AND CURRBARSCOUNT=70,1,'走势趋强,量能不足,短线进场,仓位在1/2左右')*HAN,COLOR00FFFF
DRAWTEXT(情况3=1 AND (CLOSE < 200) AND CURRBARSCOUNT=70,1,'量价良好,并没有明显走强,短线进场,仓位1/2左右。 ')*HAN,COLOR00FFFF
DRAWTEXT(情况4=1 AND (CLOSE < 200) AND CURRBARSCOUNT=70,1,'形态尚可,量能不足,未完全走强,短线参与,仓位1/3左右')*HAN,COLOR00FFFF
DRAWTEXT(情况9=1 AND (CLOSE < 200) AND CURRBARSCOUNT=70,1,'该股形态良好,强势明显,量能充足,可以继续持有。 ')*HAN,COLOR00FFFF
DRAWTEXT(情况10=1 AND (CLOSE < 200) AND CURRBARSCOUNT=70,1,'该股上行趋势不变,强势依然,但量能开始转弱,注意风险 ')*HAN,COLOR00FFFF
{趋势评分}X01:=IF(C的5日简单移动平均>C的10日简单移动平均,20,0)
X02赋值:IF(C的20日简单移动平均>C的60日简单移动平均,10,0)
如果KDJ.J>KDJ.K返回10否则返回0
如果MACD.D>MACD.DEA返回10否则返回0
如果MACD.MACD>0返回10否则返回0
X6赋值:IF(V>V的60日简单移动平均,10,0)
X7赋值:IF(C计算的获利盘比例>0.5,10,0)
X8赋值:IF(C/1日前的C>1.03,10,0)
XX赋值:X01+X02+X3+X4+X5+X6+X7+X8
DRAWTEXT_FIX(V>O,0.4,0.05,0,STRCAT('趋势评分: ',STRCAT(CON2STR(XX,0),' '))),画黄色
{补仓卖}VAB0:=531
VAB1:=1510000
VAB2:=VAB0 + VAB1
如果DATE > VAB2返回0否则返回1
H的10日[9日权重]移动平均
L的10日[9日权重]移动平均
输出卖价:VARA12,COLORRED,NODRAW
输出补仓:VARA13,COLORGREEN,NODRAW
DRAWTEXT_FIX(1,0.75,0.05,0,STRCAT('输出补仓:',STRCAT(CON2STR(补仓,2),' '))),COLORRED
DRAWTEXT_FIX(1,1,0.05,0,STRCAT('输出卖价:',STRCAT(CON2STR(卖价,2),' '))),COLORGREEN
输出{上涨下跌数}上涨:"999999$ADVANCE"+"399001$ADVANCE",COLORRED,NODRAW
输出下跌:"999999$DECLINE"+"399001$DECLINE",COLORLIGREEN,NODRAW
输出{涨跌:上涨/(上涨+下跌)*100,NODRAW
}DRAWTEXT_FIX(1,0.0,0.05,0,STRCAT('上涨:',STRCAT(CON2STR(上涨,0),' '))),COLORRED
DRAWTEXT_FIX(1,0.23,0.05,0,STRCAT('输出下跌:',STRCAT(CON2STR(下跌,0),' '))),COLORGREEN
{1日3日净买入}总额赋值:AMOUNT
买赋值:IF(O=C AND (C-1日前的C)/1日前的C*100>9.8,AMOUNT,AMOUNT/((H-L)*2-O-C的绝对值)*(C-L))
买%:=买/AMOUNT*100
流入赋值:AMOUNT*买%/10000000000
流出赋值:AMOUNT/100000000-流入
净流赋值:(流入-流出)
总额3赋值:3的AMOUNT日累和
流入3:=3的流入日累和
流出3:=3的流出日累和
净流3:=3的流入-流出日累和
DRAWTEXT_FIX(1,0,0.12,0,'净流(亿):'),COLOR8080FF,画白色
当满足条件1时,在横轴0.05纵轴0.2位置书写文字
当满足条件1时,在横轴0.15纵轴0.2位置书写文字
DRAWNUMBER_FIX(1,0,0.25,0,CONST((净流))),画黄色
DRAWNUMBER_FIX(1,0.15,0.25,0,CONST((净流3))),画黄色
竞价额赋值:DYNAINFO(15)/10000
{万元}DRAWTEXT_FIX(C>0,0.59,0.05,0,VARCAT(VARCAT('竞价: ',VAR2STR(竞价额,0)),' 万')),COLORMAGENTA
涨跌停赋值:(C-1日前的C)/1日前的C*100
当满足条件涨跌停>9.8时,在O和C之间画柱状线
当满足条件涨跌停<-9.8时,在O和C之间画柱状线
当满足条件涨跌停>6 AND 涨跌停<9.8时,在O和C之间画柱状线