发出我的通达信主图,粉与绿线是中期趋势线(粉进绿出).注意:该公式用到未来数据如有不喜欢的不要用
MA2
所属地域:DRAWTEXT_FIX(ISLASTBAR ,0.01,0.12,0,DYBLOCK),COLORYELLOW;
所属行业:DRAWTEXT_FIX(ISLASTBAR ,0.07,0.12,0,HYBLOCK),COLORYELLOW;
买入线:LLV(MA(C,20),30)LINETHICK2,COLOR8082C7;
二号线:EMA(C,25)LINETHICK2,COLORFF6AB5;
T1:=CONST(LLVBARS(LOW,10));
T1HIGH:=CONST(REF(HIGH,T1));
CCVV:=CONST(CURRBARSCOUNT);
T2:=CONST(BARSLAST((CURRBARSCOUNT >(CCVV+T1)) AND (HIGH>T1HIGH)));
T2HIGH:=CONST(REF(HIGH,T2));
T3:=CONST(BARSLAST((CURRBARSCOUNT >(CCVV+T2)) AND (HIGH>T2HIGH)));
T3HIGH:=CONST(REF(HIGH,T3));
必杀线:DRAWLINE(CURRBARSCOUNT=T3+1, T3HIGH, ISLASTBAR, T3HIGH, 1),LINETHICK2,COLORLIGREEN;
DRAWTEXT(ISLASTBAR, T3HIGH, ' 必杀线'),LINETHICK1,COLORLIGREEN;
波谷: CONST(TROUGH(2,5,1)),DOTLINE,COLORWHITE,NODRAW;
波谷距离:= 1+CONST(TROUGHBARS(2,5,1)),NODRAW;
波峰:CONST(PEAK(1,5,2)),COLORLIBLUE,LINETHICK2;
允许误差:=0.024;
XG:= ABS(波峰-波谷)<=允许误差 {AND BARSCOUNT(V)>60};
波峰距离:= 1+CONST(PEAKBARS(1,5,2)),NODRAW;
距离:=CURRBARSCOUNT;
DRAWLINE(距离=波峰距离 AND XG,波谷,距离=1,波谷,1),COLORMAGENTA;
DRAWTEXT(距离=波谷距离 AND XG,L*0.98,' 精准峰谷线'),COLORYELLOW;
DRAWICON(距离=波峰距离,H*1.01,2);{波峰位置}
DRAWICON(距离=波谷距离,L*0.985,1);{波谷位置}
精准点:=(ABS(H-波谷)<=允许误差 OR ABS(L-波谷)<=0.024) ;
STICKLINE(精准点,波谷,波谷,6,1),COLORWHITE,LINETHICK3;
JJ:=(3*C+H+L+O)/6;
VAR1:=(8*JJ+7*REF(JJ,1)+6*REF(JJ,2)+5*REF(JJ,3)+4*REF(JJ,4)+3*REF(JJ,5)+2*REF(JJ,6)+REF(JJ,8))/36;
TJ1:=VOL=HHV(VOL,5) AND VOL>2*REF(VOL,1) AND CLOSE>VAR1 AND C>REF(C,1);
LJL:=FILTER(TJ1,5);
STICKLINE(LJL,OPEN,CLOSE,3,0),COLORYELLOW;
AA60:=REF(L,30)=LLV(L,2*30+1);
BB60:=FILTER(AA60,30);
CC60:=BACKSET(BB60,30+1);
DD60:=FILTER(CC60,30);
EE60:=BACKSET(ISLASTBAR,BARSLAST(DD60)+1);
FF60:=EE60>REF(EE60,1);
长支:DRAWLINE(DD60,L,FF60,L,1),COLOR4080FF,DOTLINE;
中轨:MA(CLOSE,20),COLORMAGENTA,DOTLINE;
上轨:中轨+2*STD(CLOSE,20),COLORRED,DOTLINE;
下轨:中轨-2*STD(CLOSE,20),COLORGREEN,DOTLINE;
立桩量:=VOL=HHV(VOL,40) AND VOL>1.9*REF(VOL,1);
立桩量三日突破:=IF(BARSLAST(立桩量)=1 AND CLOSE>REF(HIGH,1),1,IF(BARSLAST(立桩量)=2 AND CLOSE>REF(HIGH,2),1,IF(BARSLAST(立桩量)=3 AND CLOSE>REF(HIGH,3),1,0)));
立桩量三日不破:=BARSLAST(立桩量)=3 AND REF(LOW,3)<=MIN(MIN(C,REF(C,1)),REF(C,2));
BACKSET300:=BACKSET(立桩量三日不破,4);
BACKSET301:=BACKSET(立桩量三日突破,4);
立桩量成立:=FILTER(BACKSET300,3) AND BACKSET301 AND 立桩量;
DRAWTEXT(立桩量成立,HIGH*1.01,'↙立桩'),COLOR00FF00;
三日不破:=MIN(MIN(L,REF(L,1)),REF(L,2))>=REF(L,3);
三日量缩:=(MAX(MAX(V,REF(V,1)),REF(V,2))<REF(V,3));
三日价涨A:=C>=REF(C,1);
三日价涨B:=C<REF(C,1);
三日价涨C:=MIN(MIN(C,REF(C,1)),REF(C,2))>=REF(L,3);
TIM:=IF(DATE<1140214,1,0);
缩倍柱:=(VOL*1.95<=REF(VOL,1))*TIM;
百日低量:=(VOL=LLV(VOL,100))*TIM;
倍量柱:=C>REF(C,1)*1.04 AND (VOL>=1.9*REF(VOL,1))*TIM;
四日前倍量柱:=(REF(VOL,3)>1.9*REF(VOL,4))*TIM;
四日前高量柱:=(REF(VOL,3)>=REF(VOL,4) AND REF(VOL,3)<1.9*REF(VOL,4) AND 三日量缩)*TIM;
前三引用不成立:=COUNT(REF(四日前倍量柱,1) AND (REF(三日不破,1) OR REF(三日价涨C,1)),3)=0 AND COUNT(REF(四日前高量柱,1) AND
(REF(三日不破,1) OR REF(三日价涨C,1)),3)=0;
倍量黄金柱:=四日前倍量柱 AND 三日量缩 AND 三日不破 AND 三日价涨A AND 前三引用不成立;
高量黄金柱:=四日前高量柱 AND 三日量缩 AND 三日不破 AND 三日价涨A AND 前三引用不成立;
黄金柱:=倍量黄金柱 OR 高量黄金柱;
次倍量黄金柱:=NOT(黄金柱) AND 四日前倍量柱 AND 三日量缩 AND 三日不破 AND 三日价涨B AND 前三引用不成立;
次高量黄金柱:=NOT(黄金柱) AND 四日前高量柱 AND 三日量缩 AND 三日不破 AND 三日价涨B AND 前三引用不成立;
次黄金柱:=次倍量黄金柱 OR 次高量黄金柱;
准倍量黄金柱:=NOT(黄金柱 OR 次黄金柱) AND 四日前倍量柱 AND ((三日量缩 AND 三日价涨C) OR (COUNT(倍量柱,3)>=1 AND 三日不破))
AND 前三引用不成立;
准高量黄金柱:=NOT(黄金柱 OR 次黄金柱) AND 四日前高量柱 AND (三日量缩 AND 三日价涨C) AND 前三引用不成立;
准黄金柱:=准倍量黄金柱 OR 准高量黄金柱;
倍量将军柱:=NOT(黄金柱 OR 次黄金柱 OR 准黄金柱) AND 四日前倍量柱 AND 三日不破 AND 三日价涨A AND 前三引用不成立;
高量将军柱:=NOT(黄金柱 OR 次黄金柱 OR 准黄金柱) AND 四日前高量柱 AND 三日不破 AND 三日价涨A AND 前三引用不成立;
将军柱:=倍量将军柱 OR 高量将军柱;
次倍量将军柱:=NOT(黄金柱 OR 次黄金柱 OR 准黄金柱 OR 将军柱) AND 四日前倍量柱 AND 三日不破 AND 三日价涨B AND 前三引用不成立;
次高量将军柱:=NOT(黄金柱 OR 次黄金柱 OR 准黄金柱 OR 将军柱) AND 四日前高量柱 AND 三日不破 AND 三日价涨B AND 前三引用不成立;
次将军柱:=次倍量将军柱 OR 次高量将军柱;
准倍量将军柱:=NOT(黄金柱 OR 次黄金柱 OR 准黄金柱 OR 将军柱 OR 次将军柱) AND 四日前倍量柱 AND 三日价涨C AND 前三引用不成立;
准高量将军柱:=NOT(黄金柱 OR 次黄金柱 OR 准黄金柱 OR 将军柱 OR 次将军柱) AND 四日前高量柱 AND 三日价涨C AND 前三引用不成立;
准将军柱:=准倍量将军柱 OR 准高量将军柱;
BACKSET100:=BACKSET(黄金柱 OR 次黄金柱 OR 准黄金柱 OR 将军柱 OR 次将军柱 OR 准将军柱,4);
FILTER100:=FILTER(BACKSET100,3);
BACKSET101:=BACKSET(黄金柱,4);
FILTER101:=FILTER(BACKSET101,3);
BACKSET102:=BACKSET(次黄金柱,4);
FILTER102:=FILTER(BACKSET102,3);
BACKSET103:=BACKSET(准黄金柱,4);
FILTER103:=FILTER(BACKSET103,3);
BACKSET104:=BACKSET(将军柱,4);
FILTER104:=FILTER(BACKSET104,3);
BACKSET105:=BACKSET(次将军柱,4);
FILTER105:=FILTER(BACKSET105,3);
BACKSET106:=BACKSET(准将军柱,4);
FILTER106:=FILTER(BACKSET106,3);
倍量:=(V/REF(V,1)>=1.91 AND COUNT(C>O,1)) OR (L>REF(H,1) AND COUNT(O>C,1) AND V/REF(V,1)>=1.91),COLORYELLOW,NODRAW;
STICKLINE(黄金柱,O,C,2,0),COLORRED;
STICKLINE(倍量,O,C,2,0),COLORYELLOW;
STICKLINE(FILTER101,OPEN,CLOSE,0.5,0),COLORYELLOW;
STICKLINE(FILTER102,OPEN,CLOSE,0.5,0),COLORYELLOW;
STICKLINE(FILTER103,OPEN,CLOSE,0.5,0),COLORYELLOW;
STICKLINE(FILTER104,OPEN,CLOSE,0.5,0),COLORYELLOW;
STICKLINE(FILTER105,OPEN,CLOSE,0.5,0),COLORYELLOW;
STICKLINE(FILTER106,OPEN,CLOSE,0.5,0),COLORYELLOW;
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);
DRAWTEXT(VAR11 AND COUNT(VAR11,16)=1,LOW*0.97,'机进'),LINETHICK1,COLORC0C0C0;
年月:= YEAR=2011 AND MONTH=10;
日1017:=年月 AND DAY=17;
日1026:=年月 AND DAY=26;
日1031:=年月 AND DAY=31;
日1101:=YEAR=2011 AND MONTH=11 AND DAY=1;
日0624:=YEAR=2011 AND MONTH=6 AND DAY=24;
{画线并显示当值}
{A:DRAWLINE(日1026,C,日1031,C,1),COLORMAGENTA;;
B:DRAWLINE(日1026,C,日1101,O,1),COLORYELLOW;;
C_:DRAWLINE(日1017,H,日1026,C,1),COLORGREEN; ;
D:DRAWLINE(日1017,C,日1026,C,1),COLOR7777FF;}
前平:REF(C,BARSLAST(日1026)),COLOR00AAAA;{水平线}
{DRAWTEXT(ISLASTBAR,A,'A'),COLORMAGENTA;
DRAWTEXT(ISLASTBAR,B,'B'),COLORYELLOW;
DRAWTEXT(ISLASTBAR,C_,'C'),COLORGREEN;
DRAWTEXT(ISLASTBAR,D,'D'),COLOR7777FF;}
年月_:= YEAR=2012 AND MONTH=04;
日0412:=年月_ AND DAY=12;
日0413:=年月_ AND DAY=13;
日0417:=年月_ AND DAY=17;
日0418:=年月_ AND DAY=18;
{画线并显示当值}
后平:REF(C,BARSLAST(日0412)),COLORWHITE;{水平线}
{A01:DRAWLINE(日0412,C,日0413,C,1),COLORMAGENTA;
B01:DRAWLINE(日0412,C,日0417,H,1),COLORYELLOW;
C01:DRAWLINE(日0412,C,日0417,L,1),COLORGREEN;
D01:DRAWLINE(日0412,C,日0418,O,1),COLOR7777FF;}
{DRAWTEXT(ISLASTBAR,A01,'A'),COLORMAGENTA;
DRAWTEXT(ISLASTBAR,B01,'B'),COLORYELLOW;
DRAWTEXT(ISLASTBAR,C01,'C'),COLORGREEN;
DRAWTEXT(ISLASTBAR,D01,'D'),COLOR7777FF;}
超B:=L2_AMO(0,2)/10000.0;大B:=L2_AMO(1,2)/10000.0;中B:=L2_AMO(2,2)/10000.0;小B:=L2_AMO(3,2)/10000.0;
超S:=L2_AMO(0,3)/10000.0;大S:=L2_AMO(1,3)/10000.0;中S:=L2_AMO(2,3)/10000.0;小S:=L2_AMO(3,3)/10000.0;
TESTSKIP(NOT(超B OR 大B OR 中B OR 小B OR 超S OR 大S OR 中S OR 小S)!=0);
大宗进:=(超B)+(大B),NODRAW;大宗出:=(超S)+(大S),NODRAW;
非大宗进:=(中B)+(小B),NODRAW;非大宗出:=(中S)+(小S),NODRAW;
DAZHIV:=CONST(MAX(ABS(大宗进),MAX(ABS(大宗出),MAX(ABS(非大宗进),ABS(非大宗出))))),NODRAW;
DRAWRECTREL(0,CONST(950-(ABS(大宗进)*250/DAZHIV)),30,970,IF(CONST(大宗进>0),RGB(255,0,0),RGB(23,125,255)));
DRAWRECTREL(32,CONST(950-(ABS(大宗出)*250/DAZHIV)),62,970,IF(CONST(大宗出>0),RGB(23,125,255),RGB(255,0,0)));
DRAWRECTREL(92,CONST(950-(ABS(非大宗进)*250/DAZHIV)),122,970,IF(CONST(非大宗进>0),RGB(255,0,0),RGB(23,125,255)));
DRAWRECTREL(124,CONST(950-(ABS(非大宗出)*250/DAZHIV)),154,970,IF(CONST(非大宗出>0),RGB(23,125,255),RGB(255,0,0)));
DRAWTEXT_FIX(CURRBARSCOUNT=1,0.015,1.5,0,'主力进出'),COLORMAGENTA;
DRAWTEXT_FIX(CURRBARSCOUNT=1,0.107,1,0,'散户进出'),COLORCYAN;
股价:=(C+L+H)/3;
股价进度:=((REF(股价,1)*REF(V,1)+股价*V)/(REF(V,1)+V));
VV:=股价进度;
Y911:=IFF(CURRBARSCOUNT=1, (XMA(VV,9)*9-MA(VV,8)+MA(VV,7) -MA(VV,6)+MA(VV,5) -MA(VV,4)+MA(VV,3) -MA(VV,2) +VV)/9,XMA(VV,9));
Y912:=IFF(CURRBARSCOUNT=1, (XMA(Y911,9)*9-MA(Y911,8)+MA(Y911,7) -MA(Y911,6)+MA(Y911,5) -MA(Y911,4)+MA(Y911,3) -MA(Y911,2) +Y911)/9,XMA(Y911,9));
Y913:=IFF(CURRBARSCOUNT=1, (XMA(Y912,9)*9-MA(Y912,8)+MA(Y912,7) -MA(Y912,6)+MA(Y912,5) -MA(Y912,4)+MA(Y912,3) -MA(Y912,2) +Y912)/9,XMA(Y912,9));
中期趋势:Y913,LINETHICK2,COLORGREEN;
IF(Y913>REF(Y913,1),Y913,DRAWNULL),COLORMAGENTA,LINETHICK2;