趋势主图特点:
1.买卖点清晰
2.均线生死、多空、牛熊明了
3总体趋势一目了然
趋势主图
{买卖带状线}
VAR1:=(C+H+O+L)/4;
N1:=(1,100,20);
M:=(1,100,32);
P1:=(1,100,80);
P2:=(1,100,100);
卖出:XMA(VAR1,N1)*(1+P1/1000),COLORGREEN,DOTLINE,LINETHICK1;
买入:XMA(VAR1,M)*(1-P2/1000),COLORRED,DOTLINE,LINETHICK1;
DRAWBAND(卖出,RGB(0,80,60),买入,RGB(0,0,0));
{K线}
DRAWKLINE(H,O,L,C);
STICKLINE(C<O,H,L,0,0),COLORFF9900;
STICKLINE(C<O,O,C,3,1),COLORFF9900;
止:EMA(COST(81),10) COLORYELLOW,DOTLINE;
损:IF(EMA((CLOSE+HIGH+LOW)/3,5)<=止,止,DRAWNULL),COLORWHITE,LINETHICK1;
{牛熊:EMA(COST(27),120),COLORLIGRAY,CIRCLEDOT;}
生:EMA(CLOSE,20)COLORMAGENTA;
死:IF(EMA((CLOSE+HIGH+LOW)/3,5)<=生,生,DRAWNULL),COLORLIGREEN,LINETHICK1;
多:EMA(CLOSE,55),COLORLIRED;
空:IF(EMA((CLOSE+HIGH+LOW)/3,5)<=多,多,DRAWNULL),COLORCYAN,LINETHICK1;
{底部趋势线}
HH:=(20*H+19*REF(H,1)+18*REF(H,2)+17*REF(H,3)+16*REF(H,4)+15*REF(H,5)+14*REF(H,6)
+13*REF(H,7)+12*REF(H,8)+11*REF(H,9)+10*REF(H,10)+9*REF(H,11)+8*REF(H,12)
+7*REF(H,13)+6*REF(H,14)+5*REF(H,15)+4*REF(H,16)+3*REF(H,17)+2*REF(H,18)+
REF(H,20))/210,COLORBLUE,LINETHICK1;
LL:=(20*L+19*REF(L,1)+18*REF(L,2)+17*REF(L,3)+16*REF(L,4)+15*REF(L,5)+14*REF(L,6)
+13*REF(L,7)+12*REF(L,8)+11*REF(L,9)+10*REF(L,10)+9*REF(L,11)+8*REF(L,12)
+7*REF(L,13)+6*REF(L,14)+5*REF(L,15)+4*REF(L,16)+3*REF(L,17)+2*REF(L,18)+
REF(L,20))/210,COLORBLUE,LINETHICK1;
D90H:=EMA(HH,90),COLORRED,LINETHICK1;
D90L:=EMA(LL,90),COLORRED,LINETHICK1;
牛:(D90H+D90L)/2,COLORRED,LINETHICK2;
D1:=EMA(牛,10),COLORWHITE,LINETHICK1;
D2:=EMA(D1,10),COLORWHITE,LINETHICK1;
熊:IF(EMA((CLOSE+HIGH+LOW)/3,5)<=牛,牛,DRAWNULL),COLORLICYAN,LINETHICK2;
{黄金分割}
N:=144;
VAR111:=LLV(LOW,N);
VAR22:=HHV(HIGH,N);
VAR33:=VAR22-VAR111;
低:VAR111,COLORA67D3D,LINETHICK1;
高:VAR22,COLOR99CC32,LINETHICK1;
{大底-洋红柱状线}
STICKLINE(卖出>LOW AND 卖出<HIGH,卖出,MAX(卖出,MAX(OPEN,CLOSE)),2,0),COLORGREEN;
STICKLINE(卖出>MIN(C,O) AND 卖出<MAX(C,O),卖出,MAX(OPEN,CLOSE),2,0),COLORGREEN;
STICKLINE(卖出>LOW AND 卖出<HIGH,卖出,HIGH,0,0),COLORGREEN;
STICKLINE(卖出<LOW,OPEN,CLOSE,2,0),COLORGREEN;
STICKLINE(卖出<LOW,HIGH,LOW,0,0),COLORGREEN;
STICKLINE(买入>LOW AND 买入<HIGH,买入,MIN(MIN(OPEN,CLOSE),买入),2,0),COLORMAGENTA;
STICKLINE(买入>MIN(C,O) AND 买入<MAX(C,O),买入,MIN(OPEN,CLOSE),2,0),COLORMAGENTA;
STICKLINE(买入>LOW AND 买入<HIGH,买入,LOW,0,0),COLORMAGENTA;
STICKLINE(买入>HIGH,OPEN,CLOSE,2,0),COLORMAGENTA;
STICKLINE(买入>HIGH,HIGH,LOW,0,0),COLORMAGENTA;
G0:=(XMA(XMA(H,25),25)-XMA(XMA(L,25),25))+XMA(XMA(H,25),25);
D0:=XMA(XMA(L,25),25)-(XMA(XMA(H,25),25)-XMA(XMA(L,25),25));
DTD:=(D0+G0)/2>=(D90H+D90L)/2;
{压力支撑线}
VAR01:=BACKSET(REF(HIGH,2)=HHV(HIGH,5),3);
VAR02:=CROSS(VAR01,0.9);
VAR03:=BACKSET(REF(LOW,2)=LLV(LOW,5),3);
VAR04:=CROSS(VAR03,0.9);
压力:= REF(HIGH,BARSLAST(VAR02)), POINTDOT,COLOREA91B5;
STICKLINE(CLOSE,REF(HIGH,BARSLAST(VAR02)),REF(HIGH,BARSLAST(VAR02)),2,1),COLOREA91B5,LINETHICK3;
支撑:= REF(LOW,BARSLAST(VAR04)), POINTDOT,COLOR00B4FF;
STICKLINE(CLOSE,REF(LOW,BARSLAST(VAR04)),REF(LOW,BARSLAST(VAR04)),2,1),COLOR00B4FF,LINETHICK3;
下档线:=(((CLOSE - LLV(LOW,13)) / (HHV(HIGH,13) - LLV(LOW,13))) * 100);
{机构·趋势}
VAR3:=LLV(HIGH,240);
VAR4:=100*(CLOSE-VAR3)/VAR3;
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);
DRAWTEXT(买1>0 OR 买2>0,LOW*0.99,'买'),COLORWHITE;
DRAWTEXT(卖1>0,HIGH*1.02,'卖'),COLORGREEN;
A3:=(C-LLV(L,9))/(HHV(H,9)-LLV(L,9))*100;
A4:=SMA(A3,3,1);
A5:=SMA(A4,3,1);
A6:=3*A4-2*A5;
A7:=C-REF(C,1);
A8:=100*EMA(EMA(A7,6),6)/EMA(EMA(ABS(A7),6),6);
买:=LLV(A8,2)=LLV(A8,7) AND COUNT(A8<0,2) AND CROSS(A8,MA(A8,2));
DIF:=EMA(DCLOSE,12)-EMA(DCLOSE,26);
DEA:=EMA(DIF,9);
AAA1:=(DIF-DEA)*2*60;
起爆:=CROSS(AAA1-REF(AAA1,1),15),COLORRED,LINETHICK2;
STICKLINE(起爆,OPEN,CLOSE,2,0),COLORYELLOW;
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,LOW*0.95,'机构进场'),LINETHICK1,COLORFF00FF;
{涨停不破}
ZDT:=(C-REF(C,1))/REF(C,1)*100;
STICKLINE(ZDT>9.8,O,C,1,0),COLORRED;
STICKLINE(ZDT<-9.8,O,C,1,0),COLORBLUE;
涨停:=ZDT>9.8;
不破价:=REF(L,BARSLAST(涨停));
LS0:=BARSLAST(涨停);
LS11:=IF(1,LS0=1,涨停);
LS21:=IF(1,LLV(L,1)>REF(L,1),1);
涨停不破:=LS11 AND LS21;
STICKLINE(涨停不破,不破价-不破价*0.002,不破价,4,0),COLORRED;
DRAWTEXT(涨停不破,不破价-不破价*0.02,'1'),COLORGREEN;
LS12:=IF(2,LS0=2,涨停);
LS22:=IF(2,LLV(L,2)>REF(L,2),1);
涨停不破2:=LS12 AND LS22;
STICKLINE(涨停不破2,不破价-不破价*0.002,不破价,4,0),COLORRED;
DRAWTEXT(涨停不破2,不破价-不破价*0.02,'2'),COLORGREEN;
LS13:=IF(3,LS0=3,涨停);
LS23:=IF(3,LLV(L,3)>REF(L,3),1);
涨停不破3:=LS13 AND LS23;
STICKLINE(涨停不破3,不破价-不破价*0.002,不破价,4,0),COLORRED;
DRAWTEXT(涨停不破3,不破价-不破价*0.02,'3'),COLORGREEN;
LS14:=IF(4,LS0=4,涨停);
LS24:=IF(4,LLV(L,4)>REF(L,4),1);
涨停不破4:=LS14 AND LS24;
STICKLINE(涨停不破4,不破价-不破价*0.002,不破价,4,0),COLORRED;
DRAWTEXT(涨停不破4,不破价-不破价*0.02,'4'),COLORGREEN;
LS15:=IF(5,LS0=5,涨停);
LS25:=IF(5,LLV(L,5)>REF(L,5),1);
涨停不破5:=LS15 AND LS25;
STICKLINE(涨停不破5,不破价-不破价*0.002,不破价,4,0),COLORRED;
DRAWTEXT(涨停不破5,不破价-不破价*0.02,'5'),COLORGREEN;
LS16:=IF(6,LS0=6,涨停);
LS26:=IF(6,LLV(L,6)>REF(L,6),1);
涨停不破6:=LS16 AND LS26;
STICKLINE(涨停不破6,不破价-不破价*0.002,不破价,4,0),COLORRED;
DRAWTEXT(涨停不破6,不破价-不破价*0.02,'6'),COLORGREEN;
LS17:=IF(7,LS0=7,涨停);
LS27:=IF(7,LLV(L,7)>REF(L,7),1);
涨停不破7:=LS17 AND LS27;
STICKLINE(涨停不破7,不破价-不破价*0.002,不破价,4,0),COLORRED;
DRAWTEXT(涨停不破7,不破价-不破价*0.02,'7'),COLORGREEN;
LS18:=IF(8,LS0=8,涨停);
LS28:=IF(8,LLV(L,8)>REF(L,8),1);
涨停不破8:=LS18 AND LS28;
STICKLINE(涨停不破8,不破价-不破价*0.002,不破价,4,0),COLORRED;
DRAWTEXT(涨停不破8,不破价-不破价*0.02,'8'),COLORGREEN;
LS19:=IF(9,LS0=9,涨停);
LS29:=IF(9,LLV(L,9)>REF(L,9),1);
涨停不破9:=LS19 AND LS29;
STICKLINE(涨停不破9,不破价-不破价*0.002,不破价,4,0),COLORRED;
DRAWTEXT(涨停不破9,不破价-不破价*0.02,'9'),COLORGREEN;
LS110:=IF(10,LS0=10,涨停);
LS210:=IF(10,LLV(L,10)>REF(L,10),1);
涨停不破10:=LS110 AND LS210;
STICKLINE(涨停不破10,不破价-不破价*0.002,不破价,4,0),COLORRED;
DRAWTEXT(涨停不破10,不破价-不破价*0.02,'0'),COLORGREEN;
LS111:=IF(11,LS0=11,涨停);
LS211:=IF(11,LLV(L,11)>REF(L,11),1);
涨停不破11:=LS111 AND LS211;
STICKLINE(涨停不破11,不破价-不破价*0.002,不破价,4,0),COLORRED;
DRAWTEXT(涨停不破11,不破价-不破价*0.02,'1'),COLORGREEN;
LS112:=IF(12,LS0=12,涨停);
LS212:=IF(12,LLV(L,12)>REF(L,12),1);
涨停不破12:=LS112 AND LS212;
STICKLINE(涨停不破12,不破价-不破价*0.002,不破价,4,0),COLORRED;
DRAWTEXT(涨停不破12,不破价-不破价*0.02,'2'),COLORGREEN;
LS113:=IF(13,LS0=13,涨停);
LS213:=IF(13,LLV(L,13)>REF(L,13),1);
涨停不破13:=LS113 AND LS213;
STICKLINE(涨停不破13,不破价-不破价*0.002,不破价,4,0),COLORRED;
DRAWTEXT(涨停不破13,不破价-不破价*0.02,'3'),COLORGREEN;
LS114:=IF(14,LS0=14,涨停);
LS214:=IF(14,LLV(L,14)>REF(L,14),1);
涨停不破14:=LS114 AND LS214;
STICKLINE(涨停不破14,不破价-不破价*0.002,不破价,4,0),COLORRED;
DRAWTEXT(涨停不破14,不破价-不破价*0.02,'4'),COLORGREEN;
LS115:=IF(15,LS0=15,涨停);
LS215:=IF(15,LLV(L,15)>REF(L,15),1);
涨停不破15:=LS115 AND LS215;
STICKLINE(涨停不破15,不破价-不破价*0.002,不破价,4,0),COLORRED;
DRAWTEXT(涨停不破15,不破价-不破价*0.02,'5'),COLORGREEN;
{缺口}
P:=0;
KOH:=L>REF(H,1);
KOL:=H<REF(L,1);
HIF:=L>REF(H,BARSLAST(KOH)+1);
NHIF:=L<=REF(H,BARSLAST(KOH)+1);
LIF:=H<REF(L,BARSLAST(KOL)+1);
NLIF:=H>=REF(L,BARSLAST(KOL)+1);
N2:=8{1 100 8};
AA:=REF(H,N2)=HHV(H,2*N2+1);
AA1:=REF(L,N2)=LLV(L,2*N2+1);
QY:=BACKSET(AA,N2+1);
QY1:=BACKSET(AA1,N2+1);
CC:=FILTER(QY,N2) AND H=HHV(H,N2+1);
CC1:=FILTER(QY1,N2) AND L=LLV(L,N2+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);
GDCS23:=CONST(REF(HIGH,DINGBUTS1-1));
DDCS23:=CONST(REF(L,DDTS2-1));
XG1:=BACKSET(ISLASTBAR,GDCS1);
XD1:=BACKSET(ISLASTBAR,DDCS1);
XG2:=BACKSET(ISLASTBAR,DINGBUTS1);
XD2:=BACKSET(ISLASTBAR,DDTS2);
XDD:=IF(DDCS13<=DDCS23,XD1,XD2);
BCG:=SUM(XG1,0);
BCD:=SUM(XDD,0);
上缺口:=P=0 AND HIF AND BARSLAST(KOH)<BARSLAST(NHIF)
AND BARSLAST(HIF)<BARSLAST(NHIF);
HG:=IF(上缺口,REF(H,BARSLAST(KOH)+1),DRAWNULL);
STICKLINE(上缺口,HG,HG*1.001,10,0),COLOR888888;
下缺口:=P=0 AND LIF AND BARSLAST(KOL)<BARSLAST(NLIF) AND BARSLAST(LIF)
<BARSLAST(NLIF);
LG:=IF(下缺口,REF(L,BARSLAST(KOL)+1),DRAWNULL);
STICKLINE(下缺口,LG,LG*0.999,10,0),COLOR888888;