比如:DRAWTEXT((CROSS(SK,SD) AND SK<-0.04 AND (C-REF(C,1))/REF(C,1)>=0.03)
OR (CROSS(SK,SD) AND SK<=-0.14 ) OR (CROSS(SK,SD) AND
SK<=0.05 AND (V/MA(V,5)>2 OR C/REF(C,1)>0.035))
,L*0.99,'短线'),COLORFF66FF;
((CROSS(SK,SD) AND SK<-0.04 AND (C-REF(C,1))/REF(C,1)>=0.03)
OR (CROSS(SK,SD) AND SK<=-0.14 ) OR (CROSS(SK,SD) AND SK<=0.05 AND
(V/MA(V,5)>2 OR C/REF(C,1)>0.035))
可称之为条件五,,简化后即成为DRAWTEXT(条件五,L*0.99,'短线'),COLORFF66FF;
多:EMA(C,3),COLORYELLOW; 空:EMA(C,5),COLOR00FF00; 均衡:EMA(空,5),COLORWHITE,; VARF1:=COUNT(CROSS(多,均衡),2)=1; VARF2:=COUNT(CROSS(空,均衡),2)=1; ZAI:=FILTER(VARF1
AND VARF2,2); DRAWTEXT(ZAI,均衡,'
→◆●¤主升行情'),COLORFF00FF; VV2:=REF(CLOSE,1); VV3:=SMA((CLOSE-VV2),6,1)/SMA(ABS(CLOSE-VV2),6,1)*100; DRAWICON(REF(VV3,1)>81
AND VV3<80,HIGH,2); DRAWTEXT(REF(VV3,1)>81 AND VV3<80,HIGH,'
→◆●沽空↓'),COLORYELLOW; VF1:=MA(CLOSE,60)-MA(CLOSE,5)/3.2; DRAWTEXT(IF(CLOSE<VF1
AND VOL/240>MA(VOL,5)/240 AND CLOSE>=REF(CLOSE,1)*1.08 AND
CLOSE<MA(CLOSE,13)*1.3,1,0),LOW,'☆'),COLORRED;
在这一段源码中,最后一句满足某条件中包含的IF语句中,(CLOSE<VF1 AND VOL/240>MA(VOL,5)/240 AND
CLOSE>=REF(CLOSE,1)*1.08 AND CLOSE<MA(CLOSE,13)*1.3,1,0),四个小的条件用 AND
组合为一个总的条件,如果简化的话,就是:
STICKLINE(TJ1 AND TJ,H,L,0,1),COLORRED; STICKLINE(TJ1 AND
TJ,O,C,3.5,1),COLORRED; STICKLINE(DIFF<DEA,H,L,0,0),COLORF0F000; STICKLINE(DIFF<DEA,O,C,3,1),COLORF0F000;
或者:
二线:EMA(C,25),COLORWHITE,LINETHICK2; DIFF:=(
EMA(CLOSE,3)-EMA(CLOSE,13)),COLORWHITE; DEA:=EMA(DIFF,9),COLORF00FF0; MACD:=0.90*(DIFF-DEA),COLORSTICK; TJ:=(DIFF>=DEA); TJ1:=(DIFF>=0); STICKLINE(TJ,H,L,0,1),COLORRED; STICKLINE(TJ,O,C,3,1),COLORRED; STICKLINE(TJ1
AND TJ,H,L,0,1),COLORRED; STICKLINE(TJ1 AND
TJ,O,C,3,1),COLORRED; STICKLINE(DIFF<DEA,H,L,0,0),COLORF0F000; STICKLINE(DIFF<DEA,O,C,3,1),COLORF0F000; VAR1:=(CLOSE*2+HIGH+LOW)/4; SK:=
EMA(VAR1,13)-EMA(VAR1,73); SD:= EMA(SK,2); DRAWTEXT((CROSS(SK,SD) AND
SK<-0.04 AND (C-REF(C,1))/REF(C,1)>=0.03) OR (CROSS(SK,SD) AND
SK<=-0.14 ) OR (CROSS(SK,SD) AND SK<=0.05 AND (V/MA(V,5)>2
OR C/REF(C,1)>0.035))
,L*0.99,'短线'),COLORFF66FF; STICKLINE((CROSS(SK,SD) AND SK<-0.04 AND
(C-REF(C,1))/REF(C,1)>=0.03) OR (CROSS(SK,SD) AND SK<=-0.14 )
OR (CROSS(SK,SD) AND SK<=0.05 AND (V/MA(V,5)>2 OR
C/REF(C,1)>0.035)),H,L,0,0),COLORRED; STICKLINE((CROSS(SK,SD) AND
SK<-0.04 AND (C-REF(C,1))/REF(C,1)>=0.03) OR (CROSS(SK,SD) AND
SK<=-0.14 ) OR (CROSS(SK,SD) AND SK<=0.05 AND (V/MA(V,5)>2
OR C/REF(C,1)>0.035)),O,C,3,0),LINETHICK3,COLORRED;
SFF:=HIGH/REF(HIGH,1)<1 AND REF(HIGH,1)/REF(HIGH,2)<1 AND
LOW/REF(LOW,1)>1 AND REF(LOW,1)/REF(LOW,2)>1
; DRAWTEXT(SFF,LOW*0.90,'金兔子:提醒你关注')COLORRED;
SFF赋值:最高价/昨日最高价<1 AND 昨日最高价/2日前的最高价<1 AND 最低价/昨日最低价>1 AND
昨日最低价/2日前的最低价>1 当满足条件SFF时,在最低价*0.90位置书写文字画红色
4.启动线
启动线:SUM(EMA((C+L)/2,2),5)/10.158,COLORRED; 平衡线:LLV(SUM(
EMA((C+L)/2,2),5)/10.158,4),COLORMAGENTA; 平台线:LLV(SUM(
EMA((C+L)/2,2),5)/10.158,10),COLORFFFFFF; 强弱线:EMA(启动线,21),COLORYELLOW; STICKLINE(平台线<启动线,启动线,平台线,0.1,0),COLORFF972F; STICKLINE(平衡线<启动线,启动线,平衡线,0.1,0),COLORRED; M1:=WINNER(
MA(CLOSE,1))*200; M2:=WINNER(MA(CLOSE,20))*200; VAR1:=(CLOSE-LLV(LOW,80))/(HHV(HIGH,80)-LLV(LOW,80))*200; VAR2:=SMA(VAR1,3,1); VAR3:=SMA(VAR2,3,1); VAR4:=3*VAR2-2*VAR3; VAR5:=LLV(LOW,5); VAR6:=HHV(HIGH,5); VAR7:=EMA((CLOSE-VAR5)/(VAR6-VAR5)*100,4)*2; VAR8:=EMA(0.667*REF(VAR7,1)+0.333*VAR7,2); VAR9:=3*VAR7-2*VAR8; VARA:=POW(MA(CLOSE,5),2)+MA(CLOSE,5); VARB:=POW(MA(LOW,5),2)+MA(LOW,5); VARC:=POW(MA(HIGH,5),2)+MA(HIGH,5); VARD:=(VARA-LLV(VARB,64))/(HHV(VARC,64)-LLV(VARB,64))*150+65-10; VARE:=SMA(VARD,3,1)*1.5-100; VARF:=SMA(VARE,3,1); VAR10:=3*VARE-2*VARF; VAR11:=(HIGH+LOW+CLOSE*2)/4; VAR12:=EMA(VAR11,13); VAR13:=STD(VAR11,13); VAR14:=(VAR11-VAR12)*100/VAR13; VAR15:=EMA(VAR14,5); VAR17:=EMA(VAR15,13)+200-100; VAR18:=EMA(VAR17,10); VAR19:=3*VAR17-2*VAR18; VAR1A:=VAR2+VAR7+VARE+VAR17; VAR1B:=VAR3+VAR8+VARF+VAR18; VAR1C:=VAR4+VAR9+VAR10+VAR19; VAR1D:=(HIGH+LOW+CLOSE)/3; VAR20:=(VAR1D-MA(VAR1D,34))/(0.015*AVEDEV(VAR1D,34)); VAR21:=DMA(AMOUNT/VOL/100,VOL/CAPITAL); VAR22:=(HIGH+LOW+CLOSE+VAR1D)/4; VAR23:=EMA(VAR22,24); VAR24:=STD(VAR22,24); VAR25:=(VAR22-VAR23)/VAR24*100; VAR26:=(VAR1D-MA(VAR1D,24))/(0.015*AVEDEV(VAR1D,24)); VAR27:=EMA(VAR25,5); VAR2A:=((VAR27+VAR26+VAR20)/3+165)/4; VAR2B:=(EMA(EMA(EMA(VAR2A,15),10),5)-25)*2+VAR21; VAR2C:=(VAR1A+VAR1B+VAR1C*30)/32/5-15; VAR2D:=EMA(VAR2C,13);{13} VAR2E:=(VAR2A+VAR2C)/2/1.1;
AA:=EMA(VAR2E,3)
; AA1:=EMA(AA,5); AA2:=EMA((VAR2B+VAR2D)/2,2); HH:=MAX(AA,MAX(AA1,AA2))-MIN(AA,MIN(AA1,AA2)); 买:=(CROSS(AA,AA1)
AND HH<5 AND AA<2),COLORRED,NODRAW; DQ:=AA<10 AND AA2<10 AND
AA1<10; 买点:=(DQ=1 AND HH>REF(HH,1) AND
REF(HH,1)<REF(HH,2)),COLORYELLOW,NODRAW; STICKLINE(AA<10 AND AA2<10
AND
AA1<10,强弱线,平台线,4,1); STICKLINE(买点=1,强弱线,平台线,3,0),COLORYELLOW; STICKLINE(买=1,强弱线,平台线,4,0),COLORRED;
5.极品选股
顶压:HHV(MA(H,11),50),COLOR00FFFF; 短压:HHV(MA(H,11),15),COLOR0090E0; XL1:=LLV(MA(H,11),1); 趋势:IF(XL1>=短压,短压,XL1),COLORFFFFFF; X1:=(3*C+H+L+O)/6; X2:=EMA(X1,10); X3:=REF(X2,1); X4:=(REF(HIGH,1)+REF(LOW,1))/2; X5:=MA(CLOSE,21)+2*STD(CLOSE,21); X6:=REF(CLOSE,1);{出货} X7:=SMA(MAX(CLOSE-X6,0),7,1)/SMA(ABS(CLOSE-X6),7,1)*100; X8:=CROSS(79,X7); X9:=FILTER(X8,4);{40} WZ1:=POW(MA(CLOSE,5),2)+MA(CLOSE,5);{减} WZ2:=POW(MA(LOW,5),2)+MA(LOW,5); WZ3:=POW(MA(HIGH,5),2)+MA(HIGH,5); WZ4:=(WZ1-LLV(WZ2,9))/(HHV(WZ3,9)-LLV(WZ2,9))*150+65; DK:=SMA(WZ4,3,1)*1.5; DD:=SMA(DK,3,1); DJ:=3*DK-2*DD; WZ5:=
EMA(CLOSE,12) - EMA(CLOSE,26); WZ6:= EMA(WZ5,9); WZ7:=
2*(WZ5-WZ6);{50} WZ8:= REF(WZ7,1); WZ9:= CROSS(WZ8,WZ7) AND
WZ8>0; DRAWTEXT(WZ9 AND
DJ>250,H,'←减'),COLORBCFF8B; VAR11:=EMA(CLOSE,8);{起步} VAR2:=EMA(VAR11,20); VAR3:=CROSS(VAR11,VAR2); VAR4:=VAR11<MA(CLOSE,120); VAR5:=(HHV(HIGH,36)-CLOSE)/(HHV(HIGH,36)-LLV(LOW,36))*100;{逃命} VAR6:=SMA(VAR5,5,1); VAR7:=SMA(VAR6,8,1);{60} VAR8:=CROSS(VAR6,VAR7)
AND VAR7<20; VAR9:=CLOSE>LLV(CLOSE,60)+0.3*LLV(CLOSE,60) AND
VAR8; VARA:=IF(CLOSE>1000,VAR8,VAR9); 起步:= VAR3 AND VAR4; 逃遁:=
VARA; STICKLINE(X2>X3,X2*0.98,X2,6,1),COLOR0000FF,LINETHICK2; STICKLINE(X2<X3,X2*0.98,X2,6,1),COLORF10011,LINETHICK2; WW1:=
SUM(
MA(C,10),9)/10.110,COLORYELLOW; XX1:=MA(LOW,2)*0.96; XX2:=MA(LOW,26)*0.85; XX3:=
REF(XX1,1)<XX2 AND REF(XX1,1)<XX1 AND
REF(XX1,1)<REF(XX1,2); VAR1:=INDEXC; VAR12:=MA(VAR1,6); VAR13:=MA(VAR1,24); VAR14:=MA(VAR1,32); VAR15:=MA(VAR1,62); VAR16:=MA(VAR1,105); VAR17:=VAR15<REF(VAR15,1)
AND VAR6<REF(VAR16,1) AND VAR15<VAR6*0.98; VAR18:=VAR14>VAR12*1.11
AND
VAR13>VAR12*1.095; VAR19:=VAR12>VAR1*0.95; VAR111:=EMA(WINNER(CLOSE)*70,3); VAR112:=EMA((WINNER(CLOSE*1.1)-WINNER(CLOSE*0.9))*80,3); VAR113:=CLOSE/MA(CLOSE,40)*100<76; VAR114:=CLOSE/MA(CLOSE,60)*100<74; VAR115:=HIGH>LOW*1.051; VAR116:=VAR115
AND COUNT(VAR15,5)>1; VAR117:=VAR17 AND VAR8 AND VAR19 AND
CLOSE/COST(8)<=0.8 AND (CLOSE>OPEN OR CLOSE<OPEN) AND
(REF(CLOSE,1)>REF(OPEN,1) OR REF(CLOSE,1)<REF(OPEN,1)) AND CLOSE>0.1 OR
VAR16 AND (VAR113 OR VAR114) AND VAR112<20 AND VAR111<20 AND
(WINNER(CLOSE*125/100)-WINNER(CLOSE))*100<7.5 OR TROUGHBARS(3,15,1)<4
AND CROSS(EMA(CLOSE,21)-EMA(CLOSE,8),EMA(EMA(CLOSE,21)-EMA(CLOSE,8),5));
XL11:=EMA(CLOSE,10)/100;{70} XL2:=
MA((XL11-REF(XL11,10))/REF(XL11,10),3)*100; XL3:=
MA(XL2,3); XL4:=SMA((CLOSE-LLV(LOW,9))/(HHV(HIGH,9)-LLV(LOW,9))*100,3,1);
DRAWTEXT(IF(CROSS(3*XL4-2*SMA(XL4,3,1),8),87,0) AND
X2>X3,L-0.1,'←●反弹'),COLORGREEN;
DRAWTEXT(IF(CROSS((VAR11-LLV(VAR1,4))/(HHV(VAR11,4)-LLV(VAR11,4))*4*25,87.5)
AND VAR1<40,87,0) AND X2>X3,L-0.2,'←●短买'),COLORFFBBD8;
DRAWTEXT(CROSS(VAR1,10) AND
X2>X3,L-0.3,'←●买'),COLOR89B2FF; DRAWTEXT(IF(CROSS(2*(EMA((CLOSE*2+HIGH+LOW)/4,12)-EMA((CLOSE*2+HIGH+LOW)/4,26)-EMA(EMA((CLOSE*2+HIGH+LOW)/ 4,12)-EMA((CLOSE*2+HIGH+LOW)/4,26),2))*5.8,0.47),LOW,0)
AND X2>X3,L-0.4,'←●加仓'),COLORFF5ED8;{80} LL1:=(EMA(CLOSE,3) -
EMA(CLOSE,13)); LL2:=EMA(LL1,9); LL3:=BARSLAST(CROSS(LL1,LL2)); LL4:=REF(LL3,LL3+1); LL5:=LL2<REF(LL2,LL4); 变盘:=CROSS(LL1,LL2)
AND LL5;
ZGD2:=CONST(ZGD); ZDD:=LLV(L,90); ZDD2:=CONST(ZDD); {DRAWBAND(ZGD2,RGB(50,50,50),ZDD2,DRAWNULL);} VAR1:=(CLOSE>REF(CLOSE,1)
AND CLOSE>REF(CLOSE,2)); VAR2:=(REF(VAR1,1) AND CLOSE<=REF(CLOSE,1) AND
CLOSE>=REF(CLOSE,2)); VAR3:=(REF(VAR2,1) AND CLOSE>=REF(CLOSE,1) AND
CLOSE<=REF(CLOSE,2)); VAR4:=(REF(VAR3,1) AND CLOSE<=REF(CLOSE,1) AND
CLOSE>=REF(CLOSE,2)); VAR5:=(REF(VAR4,1) AND CLOSE>=REF(CLOSE,1) AND
CLOSE<=REF(CLOSE,2)); VAR6:=(REF(VAR5,1) AND CLOSE<=REF(CLOSE,1) AND
CLOSE>=REF(CLOSE,2)); VAR7:=(REF(VAR6,1) AND CLOSE>=REF(CLOSE,1) AND
CLOSE<=REF(CLOSE,2)); VAR8:=(REF(VAR7,1) AND CLOSE<=REF(CLOSE,1) AND
CLOSE>=REF(CLOSE,2)); VAR9:=(REF(VAR8,1) AND CLOSE>=REF(CLOSE,1) AND
CLOSE<=REF(CLOSE,2)); VARA:=(REF(VAR9,1) AND CLOSE<=REF(CLOSE,1) AND
CLOSE>=REF(CLOSE,2)); VARB:=(REF(VARA,1) AND CLOSE>=REF(CLOSE,1) AND
CLOSE<=REF(CLOSE,2)); VARC:=(REF(VARB,1) AND CLOSE<=REF(CLOSE,1) AND
CLOSE>=REF(CLOSE,2)); VARD:=(CLOSE<REF(CLOSE,1) AND
CLOSE<REF(CLOSE,2)); VARE:=(REF(VARD,1) AND CLOSE>=REF(CLOSE,1) AND
CLOSE<=REF(CLOSE,2)); VARF:=(REF(VARE,1) AND CLOSE<=REF(CLOSE,1) AND
CLOSE>=REF(CLOSE,2)); VAR10:=(REF(VARF,1) AND CLOSE>=REF(CLOSE,1) AND
CLOSE<=REF(CLOSE,2)); VAR11:=(REF(VAR10,1) AND CLOSE<=REF(CLOSE,1) AND
CLOSE>=REF(CLOSE,2)); VAR12:=(REF(VAR11,1) AND CLOSE>=REF(CLOSE,1) AND
CLOSE<=REF(CLOSE,2)); VAR13:=(REF(VAR12,1) AND CLOSE<=REF(CLOSE,1) AND
CLOSE>=REF(CLOSE,2)); VAR14:=(REF(VAR13,1) AND CLOSE>=REF(CLOSE,1) AND
CLOSE<=REF(CLOSE,2)); VAR15:=(REF(VAR14,1) AND CLOSE<=REF(CLOSE,1) AND
CLOSE>=REF(CLOSE,2)); VAR16:=(REF(VAR15,1) AND CLOSE>=REF(CLOSE,1) AND
CLOSE<=REF(CLOSE,2)); VAR17:=(REF(VAR16,1) AND CLOSE<=REF(CLOSE,1) AND
CLOSE>=REF(CLOSE,2)); VAR18:=(REF(VAR17,1) AND CLOSE>=REF(CLOSE,1) AND
CLOSE<=REF(CLOSE,2)); VAR19:=REF(VARD OR VARE OR VARF OR VAR10 OR VAR11 OR
VAR12 OR VAR13 OR VAR14 OR VAR15 OR VAR16 OR VAR17 OR VAR18,1) AND
VAR1; VAR1A:=((REF(VAR1 OR VAR2 OR VAR3 OR VAR4 OR VAR5 OR VAR6 OR VAR7 OR
VAR8 OR VAR9 OR VARA OR VARB OR VARC,1)) AND VARD); 红色持股:VAR1 OR VAR2 OR VAR3
OR VAR4 OR VAR5 OR VAR6 OR VAR7 OR VAR8 OR VAR9 OR VARA OR VARB OR
VARC,COLOR0000FF,NODRAW; 青色观望:VARD OR VARE OR VARF OR VAR10 OR VAR11 OR VAR12
OR VAR13 OR VAR14 OR VAR15 OR VAR16 OR VAR17 OR
VAR18,COLORFFFF00,NODRAW; 短买:VAR19,REF(CLOSE,1),REF(CLOSE,2),COLOR33AACC,NODRAW; 品红离场:VAR1A,REF(CLOSE,1),REF(CLOSE,2),COLORFF99FF,NODRAW; 急速超跌:(CLOSE-MA(CLOSE,34))/MA(CLOSE,34)*100<-14,COLORFFFFFF,NODRAW; 上市日期年:REF(YEAR,BARSCOUNT(CLOSE)-1),NODRAW,COLOR0000FF; 月:REF(MONTH,BARSCOUNT(CLOSE)-1),NODRAW,COLORFF00FF; 日:REF(DAY,BARSCOUNT(CLOSE)-1),NODRAW,COLOR00FFFF; STICKLINE(红色持股,CLOSE,REF(CLOSE,1),5,0),COLOR0000FF; STICKLINE(青色观望,CLOSE,REF(CLOSE,1),5,0),COLORFFFF00; STICKLINE(短买,REF(CLOSE,1),REF(CLOSE,2),5,0),COLOR33AACC; STICKLINE(品红离场,REF(CLOSE,1),REF(CLOSE,2),5,0),COLORFF99FF; STICKLINE(急速超跌,REF(CLOSE,1),C,5,0),COLORFFFFFF; STICKLINE(C>=O,L,H,0,0),COLOR0000CC; STICKLINE(C<O,L,H,0,0),COLOR999900; STICKLINE(1,C,O,2.5,0),COLOR454500; STICKLINE(1,C,O,2,0),COLOR555500; STICKLINE(1,C,O,1.5,0),COLOR656500; STICKLINE(1,C,O,1,0),COLOR757500; STICKLINE(1,C,O,0.5,0),COLOR858500; STICKLINE(C>=O,C,O,2.5,0),COLOR000045; 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; DRAWTEXT(VAR19,REF(CLOSE,1),'←短买'),COLOR33FFCC; DRAWTEXT(VAR1A,REF(CLOSE,1)+0.1,'←离场'),COLORFF99FF; MA3:=MA(CLOSE,3); YTSL:=(3*CLOSE+LOW+OPEN+HIGH)/6; 辰星线:(20*YTSL+19*REF(YTSL,1)+18*REF(YTSL,2)+17*REF(YTSL,3)+16*REF(YTSL,4)+15*REF(YTSL,5)+14*REF(YTSL,6)+13*REF(YTSL,7)+12*REF(YTSL,8)+11*REF(YTSL,9)+10*REF(YTSL,10)+9*REF(YTSL,11)+8*REF(YTSL,12)+7*REF(YTSL,13)+6*REF(YTSL,14)+5*REF(YTSL,15)+4*REF(YTSL,16)+3*REF(YTSL,17)+2*REF(YTSL,18)+REF(YTSL,20))/211,COLOR0000FF; 牵牛线:MA(CLOSE,26),COLORFF00FF; 等待:=IF(MA3>辰星线,辰星线,MA3); IF(等待>REF(等待,1),等待,DRAWNULL),LINETHICK2,COLOR0000FF; IF(辰星线>REF(辰星线,1),辰星线,DRAWNULL),LINETHICK2,COLOR0000FF; IF(辰星线<REF(辰星线,1),辰星线,DRAWNULL),COLOR00FF00; IF(牵牛线<REF(牵牛线,1),牵牛线,DRAWNULL),COLOR669933;
7.三底背离
A:=MA(CLOSE,17)+ABS(MA(CLOSE,17)-REF(MA(CLOSE,17),1));
B:=MA(CLOSE,17)+MA(CLOSE,17)-REF(MA(CLOSE,17),1);
分水岭:IF(MA(CLOSE,17)<B,B,MA(CLOSE,17)),COLORFF00FF,LINETHICK1;
PMA:=分水岭; DD:=分水岭<REF(分水岭,1);
IF(DD,分水岭,DRAWNULL),COLOR00FF00,LINETHICK1;
操作线:分水岭-(EMA(C,3)-分水岭),COLOR00FFFF,LINETHICK1; S:=(PMA>操作线);
IF(S,分水岭,DRAWNULL),COLOR00FF00,POINTDOT,LINETHICK1;
PM:MA(C,5),COLORFFFFCC,LINETHICK1;
IF(PM>REF(PM,1),PM,DRAWNULL),COLORRED,LINETHICK1;
IF(PM=REF(PM,1),PM,DRAWNULL),COLORRED;
IF(PM<REF(PM,1),PM,DRAWNULL),COLORFF9900,LINETHICK1;
DRAWTEXT(CROSS(分水岭,操作线),分水岭-0.1,'三底背离');
A1:=BARSLAST(REF(CROSS("MACD.DIF","MACD.DEA"),1));
B1:=REF(C,A1+1)>C AND REF("MACD.DIF",A1+1)<"MACD.DIF" AND
CROSS("MACD.DIF","MACD.DEA");
DRAWTEXT(B1>0,L-0.02,'M底背离'),COLOR00FFFF;
A2:=BARSLAST(REF(CROSS("KDJ.K","KDJ.D"),1)); B2:=REF(C,A2+1)>C AND
REF("KDJ.K",A2+1)<"KDJ.K" AND CROSS("KDJ.K","KDJ.D");
DRAWTEXT(B2,L-0.10,'K底背离'),COLORFF00FF;
A3:=BARSLAST(REF(CROSS("RSI.RSI1","RSI.RSI2"),1));
B3:=REF(C,A3+1)>C AND REF("RSI.RSI1",A3+1)<"RSI.RSI1" AND
CROSS("RSI.RSI1","RSI.RSI2");
DRAWTEXT(B3>0,L-0.18,'R底背离'),COLOR0000FF;
C1:=BARSLAST(REF(CROSS("MACD.DEA","MACD.DIF"),1));
D1:=REF(C,C1+1)<C AND REF("MACD.DIF",C1+1)>"MACD.DIF" AND
CROSS("MACD.DEA","MACD.DIF");
DRAWTEXT(D1>0,H+0.16,'M顶背离'),COLOR00FF00;
C2:=BARSLAST(REF(CROSS("KDJ.D","KDJ.K"),1)); D2:=REF(C,C2+1)<C AND
REF("KDJ.K",C2+1)>"KDJ.K" AND CROSS("KDJ.D","KDJ.K");
DRAWTEXT(D2>0,H+0.08,'K顶背离'),COLORFFFFCC;
C3:=BARSLAST(REF(CROSS("RSI.RSI2","RSI.RSI1"),1));
D3:=REF(C,C3+1)<C AND REF("RSI.RSI1",C3+1)>"RSI.RSI1" AND
CROSS("RSI.RSI2","RSI.RSI1");
DRAWTEXT(D3>0,H+0.04,'R顶背离'),COLORFF9900;
8.转向抄底
EMA13:=EMA(C,13),COLORWHITE; EMA21:=EMA(C,21),COLORYELLOW;
EMA34:=EMA(C,34),COLORFF00FF; EMA60:=MA(C,60),COLORFFCC66;
VAR2:=(2*CLOSE+HIGH+LOW)/4; VAR3:=IF(YEAR>=2099 AND MONTH>2,0,1);
VAR4:=LLV(LOW,5); VAR5:=HHV(HIGH,4);
散户:=EMA((VAR2-VAR4)/(VAR5-VAR4)*100,4)*VAR3;
庄家:=EMA(0.667*REF(散户,1)+0.333*散户,2)*VAR3; DRAWTEXT(CROSS(散户,庄家) AND
散户<30,L-0.05,'←低吸'),COLORLIRED; DRAWTEXT(CROSS(庄家,散户) AND
散户>70,H+0.05,'←高抛'),COLORGREEN; DRAWICON(CROSS(散户,庄家) AND
散户<30,L-0.05,1); DRAWICON(CROSS(庄家,散户) AND 散户>70,H+0.05,2);
VAR9:=CLOSE-REF(CLOSE,5);
VARA:=EMA(EMA(VAR9,5),5)/EMA(EMA(ABS(VAR9),5),5);
VARC:=EMA(EMA(VAR9,20),20)/EMA(EMA(ABS(VAR9),20),20); 卖出:=IF(VARA>0
AND CROSS(VARC,VARA),90,100); DRAWICON(卖出<0,H+0.05,2); 买线:=EMA(CLOSE,2);
卖线:=EMA(SLOPE(CLOSE,21)*20+CLOSE,42);
B1:IF(CROSS(买线,卖线),L-0.02,DRAWNULL),CROSSDOT,LINETHICK3,COLORMAGENTA;
S1:IF(CROSS(80,RSI)*30,H+0.02,DRAWNULL),CROSSDOT,LINETHICK3,COLORYELLOW;
VC:=((CLOSE-MA(CLOSE,6))/MA(CLOSE,6)*100+(CLOSE-MA(CLOSE,24))/MA(CLOSE,24)*100+(CLOSE-MA
(CLOSE,32))/MA(CLOSE,32)*100)/3; S2:=IF(VC>20 AND FILTER(VC<
REF(VC,1),5),H+0.02,DRAWNULL),CIRCLEDOT,LINETHICK3,COLORGREEN;
A0:=(L+H+C*2)/4; A1:EMA(A0,14)COLORBLUE,LINETHICK2; A2:=EMA(A0,25)COLORLIBLUE,LINETHICK2; A1X:=(A1-REF(A1,1))/REF(A1,1)*100,NODRAW; A2X:=(A2-REF(A2,1))/REF(A2,1)*100,NODRAW; 看多:IF(A1X>=0
AND
BARSLAST(CROSS(A1X,0))>0,REF((C+O)/2,BARSLAST(CROSS(A1X,0))),DRAWNULL),COLORMAGENTA{,LINETHICK2}; 逃顶:IF(A1X<0
AND
BARSLAST(CROSS(0,A1X))>0,REF((C+O)/2,BARSLAST(CROSS(0,A1X))),DRAWNULL),COLORCYAN,{LINETHICK2}; 买入持股:IF(A1X>=0,A1,DRAWNULL)COLORRED,LINETHICK3; 卖出空仓:IF(A1X<0
AND
A2X<0,A1,DRAWNULL)COLORGREEN,LINETHICK3; STICKLINE(CROSS(A1X,0),H,L,0,0
),COLOR9933FF; STICKLINE(CROSS(A1X,0),C,O,3,0 ),COLOR0000CC;
STICKLINE(CROSS(A1X,0),C,O,1,0 ),COLOR0033FF;
STICKLINE(CROSS(0,A1X),L,H,0,0 ),COLOR66CC33;
9.绝路航标 (通达信副图)
VAR1:=(CLOSE-LLV(LOW,60))/(HHV(HIGH,60)-LLV(LOW,60))*80; B:SMA(VAR1,N,1);
VAR2:SMA(B,M,1); 绝路航标:IF(CROSS(B,VAR2) AND B<40,50,0);
1.低位金叉 DIFF:=EMA(CLOSE,12)-EMA(CLOSE,27); DEA:=EMA(DIFF,9);
MACD:=2*(DIFF-DEA); CROSS(DIFF,DEA) AND DIFF<-0.1;
2.二次金叉
JCCOUNT:=COUNT(CROSS(DIFF,DEA),BARSLAST(DEA>=0)); CROSS(DIFF,DEA) AND
DEA<0 AND COUNT(JCCOUNT=2,21)=1;
3.底背离
A1:=BARSLAST(REF(CROSS(DIFF,DEA),1)); REF(CLOSE,A1+1)>CLOSE AND
DIFF>REF(DIFF,A1+1) AND CROSS(DIFF,DEA);
4.顶背离
A2:=BARSLAST(REF(CROSS(DEA,DIFF),1)); REF(CLOSE,A2+1)<CLOSE AND
REF(DIFF,A2+1)>DIFF AND CROSS(DEA,DIFF);
第二个公式编写出来的选股公式如下:
MA5:=MA(CLOSE,5); MA10:=MA(CLOSE,10); MA20:=MA(CLOSE,20);
MA30:=MA(CLOSE,30); MA60:=MA(CLOSE,60); MA120:=MA(CLOSE,120);
MA250:=MA(CLOSE,250); DIFF:=EMA(CLOSE,12) - EMA(CLOSE,26);
DEA:=EMA(DIFF,8); A1:=BARSLAST(REF(CROSS(DIFF,DEA),1));
B1:=REF(C,A1+1)>C AND REF(DIFF,A1+1)<DIFF AND CROSS(DIFF,DEA);
RSV:=(CLOSE-LLV(LOW,9))/(HHV(HIGH,9)-LLV(LOW,9))*100; K:=SMA(RSV,3,1);
D:=SMA(K,3,1); A2:=BARSLAST(REF(CROSS(K,D),1)); B2:=REF(C,A2+1)>C
AND REF(K,A2+1)<K AND CROSS(K,D); LC:=REF(CLOSE,1);
RSI1:=SMA(MAX(CLOSE-LC,0),6,1)/SMA(ABS(CLOSE-LC),6,1)*100;
RSI2:=SMA(MAX(CLOSE-LC,0),12,1)/SMA(ABS(CLOSE-LC),12,1)*100;
A3:=BARSLAST(REF(CROSS(RSI1,RSI2),1)); B3:=REF(C,A3+1)>C AND
REF(RSI1,A3+1)<RSI1 AND CROSS(RSI1,RSI2);
C1:=BARSLAST(REF(CROSS(DEA,DIFF),1)); D1:=REF(C,C1+1)<C AND
REF(DIFF,C1+1)>DIFF AND CROSS(DEA,DIFF); C2:=BARSLAST(REF(CROSS(D,K),1));
D2:=REF(C,C2+1)<C AND REF(K,C2+1)>K AND CROSS(D,K);
C3:=BARSLAST(REF(CROSS(RSI2,RSI1),1)); D3:=REF(C,C3+1)<C AND
REF(RSI1,C3+1)>RSI1 AND CROSS(RSI2,RSI1); IF(B1>0,1,0) OR
IF(B2>0,1,0) OR IF(B3>0,1,0) OR IF(D1>0,1,0) OR IF(D2>0,1,0) OR
IF(D3>0,1,0);
MA1:MA(CLOSE,M1); MA2:MA(CLOSE,M2); MA3:MA(CLOSE,M3); MA4:MA(CLOSE,M4); 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);
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; DRAWTEXT(VAR8=10 AND
FILTER(VAR8=10,5),LOW*0.93,'接近底部') COLORMAGENTA;
DRAWTEXT(VARA=20,LOW*0.95,'底部') COLORYELLOW;
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); VAR10:=100-3*SMA((OPEN-LLV(LOW,75))/(HHV(HIGH,75)-LLV(LOW,75))*100,20,1)+2*SMA(SMA((OPEN-LLV(LOW,75))/(HHV(HIGH,75)-LLV(LOW,75))*100,20,1),15,1); VAR11:=VARF<REF(VAR10,1)
AND VOL>REF(VOL,1) AND CLOSE>REF(CLOSE,1); DRAWTEXT(VAR11 AND
COUNT(VAR11,30)=1,LOW*0.95,'大资金活动'),LINETHICK1,COLORFF00FF;
VAR12:=(HIGH+LOW+CLOSE)/3; VAR13:=(VAR12-MA(VAR12,14))/(0.015*AVEDEV(VAR12,14)); VAR14:=(VAR12-MA(VAR12,70))/(0.015*AVEDEV(VAR12,70)); VAR15:=IF(VAR13>=150
AND VAR13<200 AND VAR14>=150 AND
VAR14<200,10,0); VAR16:=IF(VAR13<=-150 AND VAR13>-200 AND
VAR14<=-150 AND
VAR14>-200,-10,VAR15); VAR17:=(CLOSE-MA(CLOSE,13))/MA(CLOSE,13)*100; VAR18:=100-ABS(VAR17); VAR19:=IF(VAR18<90,VAR18,100); 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*0.95,'大笔成交')
COLORWHITE;
17.操盘线
N1:=3; M1:=MA(C,5); M2:MA(C,20),COLORGREEN; 均线变异:IF(M1>M2,M2,M1),COLOR0000FF; VAR1:=(HHV(HIGH,21)-CLOSE)/(HHV(HIGH,21)-LLV(LOW,21))*100; VAR3:=(CLOSE-LLV(LOW,21))/(HHV(HIGH,21)-LLV(LOW,21))*100; VAR6:=VAR3-VAR1; Z:=MA(VAR6,N1); STICKLINE(Z>=0
{AND ZZ=2},O,C,2,0),COLORRED; STICKLINE(Z>=0 {AND
ZZ=2},H,MAX(O,C),0,1),COLORRED; STICKLINE(Z>=0 {AND
ZZ=2},MIN(O,C),L,0,1),COLORRED; STICKLINE(Z<0 {AND
ZZ=1},O,C,2,1),COLORCYAN; STICKLINE(Z<0 {AND
ZZ=1},H,MAX(O,C),0,1),COLORCYAN; STICKLINE(Z<0 {AND
ZZ=1},MIN(O,C),L,0,1),COLORCYAN; STICKLINE(Z>=0 AND
M2>C,O,C,2,0),COLORBLUE; STICKLINE(Z>=0 AND
M2>C,H,MAX(O,C),0,1),COLORBLUE; STICKLINE(Z>=0 AND
M2>C,MIN(O,C),L,0,1),COLORBLUE; STICKLINE(Z<0 AND
M2<C,O,C,2,1),COLORYELLOW; STICKLINE(Z<0 AND
M2<C,H,MAX(O,C),0,1),COLORYELLOW; STICKLINE(Z<0 AND
M2<C,MIN(O,C),L,0,1),COLORYELLOW; WW:=(MA(CLOSE,4)+MA(CLOSE,8)+MA(CLOSE,16)+MA(CLOSE,32))/4; DRAWICON(CROSS(CLOSE,WW),LOW-0.002,1); DRAWICON(CROSS(WW,CLOSE),HIGH+0.006,2);