1、这是北沙老师出国前所做的最后一个公式;
2、当时还发生了点波折、现在想来那时的自己很可笑;
3、终于明白“赠人玫瑰、手留余香”这句话的境界;
4、公式设计立意延续北沙系列公式的核心思想、只是形式稍复杂一点;
5、私人订制——借用冯小刚导演即将公映的贺岁片名;
{北沙36计}
M30:=MA(C,30);
M60:=MA(C,60);
VA1:=HHVBARS(M30,BARSLAST(M30
QG:=CROSS(BACKSET(CROSS(0,M30) OR (ISLASTBAR AND M30>M60),REF(VA1,1)+2),0.5);
STICKLINE(M30>DRAWLINE(VA2,M30,REF(VA2,1),REF(M30,1),1),M30,DRAWLINE(VA2,M30,REF(VA2,1),REF(M30,1),1),1,0),COLOR00BBBB;
前高:DRAWLINE(VA2,M30,REF(VA2,1),REF(M30,1),1),COLORGREEN,DOTLINE;
JC:=CROSS(M30,M60);
JTS:=BARSLAST(JC);
XG1:=JTS>=0 AND M30>前高;
SC:=CROSS(M60,M30);
STS:=BARSLAST(SC);
XG2:=C
VA3:=LLVBARS(M30,BARSLAST(M30>M60)+1);
VA4:=CROSS(BACKSET(CROSS(M30,M60),REF(VA3,1)+2),0.5);
BD:=BARSLAST(FILTERX(CROSS(M60,M30),BARSCOUNT(C)));
BG:=BARSLAST(FILTERX(CROSS(M30,M60),BARSCOUNT(C)));
STICKLINE(M30
前低:DRAWLINE(VA4,M30,REF(VA4,1),REF(M30,1),1),COLORMAGENTA,DOTLINE;
STICKLINE(XG1 AND H<前低,H*1.002,L*0.998,4,1),COLORWHITE;
STICKLINE(XG1 AND H>前低 AND MAX(C,O)<前低,前低,L*0.998,4,1),COLORWHITE;
STICKLINE(XG1 AND C<前低 AND O>前低,C*0.998,前低,4,1),COLORWHITE;
信号:=CROSS(COUNT(C/REF(C,1)>1.07,BARSLAST(CROSS(XG1 AND XG2,0.5)))=1,0.5) AND CROSS(C>前低,0.5);
STICKLINE(信号,H*1.004,L*0.998,4,0),COLORYELLOW;
DRAWKLINE(HIGH,OPEN,LOW,CLOSE);
DRAWICON(CROSS(M30>前高,0.5),前高,1);
BDTJ:=IF(M30
BARSCOUNT(C)),DRAWNULL);
TSBDTJ:=BARSLAST(BDTJ);
BDZH:=FILTERX(M30
本低:=IF(BD+1>=1,CONST(LLV(M30,BD+1)),DRAWNULL),COLORLIRED,DOTLINE;
BDCL:=CROSS(COUNT(CROSS(M30>本低/2 AND M30
终点:=IF(ISLASTBAR AND M30>0 AND M30=HHV(M30,BARSLAST(M30
UU:=(终点=1 OR 终点=2) AND M30>M60;
ZZ:=FILTERX(UU,BARSCOUNT(C));
本高:=IF(BG+1>=1,CONST(HHV(M30,BG+1)),DRAWNULL),COLORWHITE,DOTLINE;
前高成立:=SUM(JC,0)>=2 AND XG1;
DRAWTEXT(CROSS(前高成立,0.5),L*0.998,'前高成立');
TT:=IF(VA4,BARSNEXT(CROSS(前高成立,0.5)),DRAWNULL);
WW:=IF(CROSS(前高成立,0.5),REF(C,BARSLAST(VA4)),0);
QQ:=IF(CROSS(前高成立,0.5),REF(H,BARSLAST(VA4)),0);
QDCL:=VA4 AND C=REFX(REF(C,BARSLAST(VA4)),TT) AND H=REFX(REF(H,BARSLAST(VA4)),TT);
DRAWTEXT(QDCL,M30,'前低成立');
XX:=IF(CROSS(前高成立,0.5),REF(LLV(M30,STS),JTS+1),0);
GG:=BARSLAST(CROSS(前高成立,0.5))>=0 AND CROSS(COUNT(C
BARSLAST(CROSS(前高成立,0.5))),BARSLAST(CROSS(前高成立,0.5)))=1,0.5);
DRAWTEXT(FILTER(CREF(前低,BARSLAST(GG)) AND
前低=REF(前低,BARSLAST(GG)),10),L*0.998,'收盘成立');
前前低:=IF(QDCL,REF(REF(M30,BARSLAST(VA4)),1),0);
前前低线:=IF(BARSLAST(QDCL)>=0,REF(前前低,BARSLAST(QDCL)),0);
QDQD:=IF(BARSLAST(QDCL)>=0,REF(M30,BARSLAST(QDCL)),0);
前前低横线:IF(COUNT(JC,BARSLAST(QDCL))<2 AND BARSLAST(QDCL)>=0 AND QDQD>前前低线,
DRAWLINE(QDCL,REF(REF(M30,BARSLAST(VA4)),1),REF(QDCL,1),
REF(REF(REF(M30,BARSLAST(VA4)),1),1),1),DRAWNULL),COLORRED;
ZT:=REF(C,1)*1.1-C<0.01 AND H=C;{涨停}
DT:=IF((REF(C,1)-C)*100/REF(C,1)>=(10-0.01*100/REF(C,1)) AND L=C,1,0);{跌停};
BA:STICKLINE(ZT,OPEN,CLOSE,0.1,0),COLORMAGENTA;
BC:STICKLINE(DT,OPEN,CLOSE,0.1,0),COLORLIGREEN;
DA:=YEAR AND MONTH AND DAY;
AAA:=STRCAT(CON2STR(YEAR,0),'年');
AAB:=STRCAT(CON2STR(MONTH,0),'月');
AA33:=STRCAT(CON2STR(DAY,0),'日');
AA4:=STRCAT('【',IF(WEEKDAY=1,'一',IF(WEEKDAY=2,'二',IF(WEEKDAY=3,'三',IF(WEEKDAY=4,'四',IF(WEEKDAY=5,'五',IF(WEEKDAY=6,'六','日')))))));
AA:=STRCAT(STRCAT(STRCAT(AAA,AAB),STRCAT(AA33,AA4)),'】');
SA:DRAWTEXT_FIX(DA,0,1,0,AA),COLORGREEN;