N1:=5;
N2:=10;
N3:=30;
X:=MONEY/(vol);
短线:MA(X,N1);
中线:MA(X,N2);
长线:MA(X,N3);
无穷:DMA_(CLOSE,VOL/SHGZG);
TY:=C;
A1:=REF(TY,10)=HHV(TY,2*10+1); B1:=FILTER(A1,10); C1:=BacKSET(B1,10+1); HD:=FILTER(C1,10);
A2:=REF(TY,10)=LLV(TY,2*10+1); B2:=FILTER(A2,10); C2:=BACKSET(B2,10+1); LD:=FILTER(C2,10);
A:=REF(C,BArslAST(HD)); B:=REF(C,BARSLAST(LD));
T1:=BARSLAST(HD)<BARSLAST(LD) AND NOT(HD) ;
T2:=BARSLAST(HD)>BARSLAST(LD) AND NOT(LD);
SA0:=MA(CLOSE,3);
SA1:=(H+L+C)/3;
SA2:=HHV(SA1,15);
SA3:=LLV(SA1,5);
SA4:=SA2-SA3;
SA5:=MA((SA1-SA3)/SA4,2)*100;
SA6:=HHV(SA1,4*15);
SA7:=LLV(SA1,4*15);
SA8:=SA6-SA7;
SA9:=MA((SA1-SA7)/SA8,2)*100;
SAA:=HHV(SA1,16*15);
SAB:=LLV(SA1,16*15);
SAC:=SAA-SAB;
SAD:=MA((SA1-SAB)/SAC,2)*100;
S底线:=1;
VAR1:=(100 - ((90 * (HHV(HIGH,21) - CLOSE)) / (HHV(HIGH,21) - LLV(LOW,21))));
VAR2:=(100 - ((90 * (HHV(HIGH,21) - CLOSE)) / (HHV(HIGH,21) - LLV(LOW,21))));
VAR3:=(100 - MA(((100 * (HHV(HIGH,6) - CLOSE)) / (HHV(HIGH,6) - LLV(LOW,6))),34));
买进价:=((C-REF(MA(C,6),1))/6+MA(C,6))*1.004;
加码价:=((C-REF(MA(C,18),1))/18+MA(C,18))*1.004;
加码条件:=crOSS(C,加码价) AND 加码价>REF(加码价,1);
买进条件:=CROSS(C,买进价) AND 买进价>REF(买进价,1);
条件1:=CROSS(SA5,S底线) AND SA0-REF(SA0,1)>0 AND C>=O;
粉K★抄底:=CROSS(1,SA9) AND CROSS(1,SA5);
条件5:=CROSS(VAR2,MA(VAR3,6));
条件:=买进条件 OR 加码条件 OR 条件1 OR 粉K★抄底 OR 条件5;
STICKLINE(条件 ,H,L,2,0),COLORFF00FF;
STICKLINE(条件 AND C>O,O,C,10,3),COLORFF00FF;
STICKLINE(条件 AND C<O,O,C,10,0),COLORFF00FF;
STICKLINE(条件 AND C=O AND C>=REF (C,1),O,C,10,3),COLORFF00FF;
STICKLINE(条件 AND C=O AND C<REF (C,1),O,C,10,0),COLORFF00FF;
DRAWTEXT(条件,(LOW * 0.998),'买'),COLORFF00FF;
DRAWTEXT (粉K★抄底, (H * 1.2), '★抄底'), COLORFF00FF;
SXX:=(SA9<1 AND SA5<1);
条件3:=CROSS(1,SA9) AND CROSS(1,SAD);
DRAWTEXT (条件3, (H * 1.2), '●关注'), COLORFF9933;
SYY:=(SA9>97 AND SA5>97);
条件4:=(CROSS(0.5,SYY)) OR (CROSS(SA9,97) AND CROSS(SA5,97)) OR (CROSS(SA9,97) AND CROSS(SAD,97));
条件6:=CROSS(MA(VAR3,6),VAR1);
STICKLINE(条件4 OR 条件6,H,L,2,0),COLORYELLOW;
STICKLINE(条件4 OR 条件6 AND C<O,O,C,10,0),COLORYELLOW;
STICKLINE(条件4 OR 条件6 AND C>O,O,C,10,3),COLORYELLOW;
STICKLINE(条件4 OR 条件6 AND C=O AND C>=REF (C,1),O,C,10,3),COLORYELLOW;
STICKLINE(条件4 OR 条件6 AND C=O AND C<REF (C,1),O,C,10,0),COLORYELLOW;
DRAWTEXT(条件4 OR 条件6,(HIGH * 1.04),'卖'),COLORYELLOW;
DIFF:=EMA(CLOSE,12) - EMA(CLOSE,26);
DEA:=EMA(DIFF,9);
macd:=2*(DIFF-DEA);
AA1:=BARSLAST(REF(CROSS(DIFF,DEA),1));
BB1:=REF(C,AA1+1)>C AND REF(DIFF,AA1+1)<DIFF AND CROSS(DIFF,DEA);
DRAWTEXT(FILTER(BB1>0,5),L*0.97,'MACD底背'),COLORGREEN;
NA2:=BARSLAST(REF(CROSS("kdj.K"(9,3,3),"kdJ.D"(9,3,3)),1));
NB2:=REF(C,NA2+1)>C AND REF("KDJ.K"(9,3,3),NA2+1)<"KDJ.K"(9,3,3) AND CROSS("KDJ.K"(9,3,3),"KDJ.D"(9,3,3));
DRAWTEXT(FILTER(NB2>0,5),L*0.94,'KDJ底背'),COLORYELLOW;
XC1:=BARSLAST(REF(CROSS(DEA,DIFF),1));
XD1:=REF(C,XC1+1)<C AND REF(DIFF,XC1+1)>DIFF AND CROSS(DEA,DIFF);
DRAWTEXT(FILTER(XD1>0,5),H*1.03,'MACD顶背'),COLOR0066FF;
XC2:=BARSLAST(REF(CROSS("KDJ.D"(9,3,3),"KDJ.K"(9,3,3)),1));
XD2:=REF(C,XC2+1)<C AND REF("KDJ.K"(9,3,3),C2+1)>"KDJ.K"(9,3,3) AND CROSS("KDJ.D"(9,3,3),"KDJ.K"(9,3,3));
DRAWTEXT(FILTER(XD2>0,5),H*1.06,'KDJ顶背'),COLORRED;