等级: 新手上路
- 注册:
- 2021-11-7
- 曾用名:
|
MA8:=1;
缠论线开关:=1;
展F:=10;//10
HH展BDD:=(H>HV(H,展F))*缠论线开关*MA8;
NH展BDD:=(BARSLAST(HH展BDD)+1)*缠论线开关*MA8;
LL展BDD:=(L<LV(L,展F))*缠论线开关*MA8;
NL展BDD:=(BARSLAST(LL展BDD)+1)*缠论线开关*MA8;
AH展BDD:=(BACKSET(COUNT(LL展BDD,NH展BDD)&&LL展BDD,NH展BDD))*缠论线开关*MA8;
AL展BDD:=(BACKSET(COUNT(HH展BDD,NL展BDD)&&HH展BDD,NL展BDD))*缠论线开关*MA8;
LX:=AL展BDD, NOTEXT;
HX:=AH展BDD, NOTEXT;
笔:=1;
//1、本级别 (BOLL26)笔:
DRAWLINE1(笔*CROSS(LX=1,0.5),L,CROSS(HX=1,0.5),H,0),COLORMAGENTA,LINETHICK2;//画笔,虚线;上笔
DRAWLINE1(笔*CROSS(HX=1,0.5),H,CROSS(LX=1,0.5),L,0),COLORLIGHTGREEN,LINETHICK2;//画笔,虚线;下笔
XZ:BACKSET(ISLASTBAR,SUMBARS(CROSS(LX=1,0.5)||CROSS(HX=1,0.5),12)),NODRAW;
X8:CROSS(BACKSET(ISLASTBAR,SUMBARS(CROSS(LX=1,0.5)||CROSS(HX=1,0.5),8)),0.5),NODRAW;
X9:CROSS(BACKSET(ISLASTBAR,SUMBARS(CROSS(LX=1,0.5)||CROSS(HX=1,0.5),9)),0.5),NODRAW;
X12:CROSS(BACKSET(ISLASTBAR,SUMBARS(CROSS(LX=1,0.5)||CROSS(HX=1,0.5),12)),0.5),NODRAW;
X13:CROSS(BACKSET(ISLASTBAR,SUMBARS(CROSS(LX=1,0.5)||CROSS(HX=1,0.5),13)),0.5),NODRAW;
//BOLL26最后一笔(未完成);
//HH:=CROSS(HX=1,0.5);
//LL:=CROSS(LX=1,0.5);
H0:=笔*CROSS(HX=1,0.5),ICON(1,'ICO1');
L0:=笔*CROSS(LX=1,0.5),ICON(1,'ICO2');
XX:=CROSS(BACKSET(ISLASTBAR,SUMBARS(H0||L0,1)),0.5);
XY:=CROSS(BACKSET(ISLASTBAR,SUMBARS(H0||L0,3)),0.5);
ZZ:=XX&& SQRT(POW( ABS(IF(H0,H,L)-REF(VALUEWHEN(H0||L0,IF(H0,H,L)),1)),2)+POW(SUMBARS(H0||L0,2),2 ))>VALUEWHEN(XY,SQRT(POW( ABS(IF(H0,H,L)-REF(VALUEWHEN(H0||L0,IF(H0,H,L)),1)),2)+POW(SUMBARS(H0||L0,2),2 ))),NODRAW;
ZZ1:=XX&& SQRT(POW( ABS(IF(H0,H,L)-REF(VALUEWHEN(H0||L0,IF(H0,H,L)),1)),2)+POW(SUMBARS(H0||L0,2),2 ))<VALUEWHEN(XY,SQRT(POW( ABS(IF(H0,H,L)-REF(VALUEWHEN(H0||L0,IF(H0,H,L)),1)),2)+POW(SUMBARS(H0||L0,2),2 ))),NODRAW;
HH:CROSS(AH展BDD=1,0.5), NOTEXT;
LL:CROSS(AL展BDD=1,0.5), NOTEXT;
DRAWLINE3(笔*ISLASTBAR&&BARSLAST(HH)<BARSLAST(LL),笔*VALUEWHEN(HH,H),笔*BARSLAST(HH),1,LLV(L,BARSLAST(HH)),LLVBARS(L,BARSLAST(HH)),0),COLORBLUE,DASH;//BOLL26最后一笔(未完成),向下笔;
DRAWLINE3(笔*ISLASTBAR&&BARSLAST(HH)>BARSLAST(LL),笔*VALUEWHEN(LL,L),笔*BARSLAST(LL),1,HHV(H,BARSLAST(LL)),HHVBARS(H,BARSLAST(LL)),0),COLORRED,DASH;//BOLL26最后一笔(未完成),向上笔;
////////2、画倒数1234的笔;
//2.1、倒数第4笔(已完成);
BADS4:=BACKSET(ISLASTBAR,SUMBARS(CROSS(LX=1,0.5)||CROSS(HX=1,0.5),4));
BBDS4:=BACKSET(ISLASTBAR,SUMBARS(CROSS(LX=1,0.5)||CROSS(HX=1,0.5),5));
DRAWLINE1(笔*CROSS(LX=1,0.5)&&BBDS4=1&&BADS4=0,L,CROSS(HX=1,0.5),H,0),COLORMAGENTA;//向上笔(倒数4),黄色;
DRAWLINE1(笔*CROSS(HX=1,0.5)&&BBDS4=1&&BADS4=0,H,CROSS(LX=1,0.5),L,0),COLORLIGHTGREEN;//向下笔(倒数4),黄色;
//2.2、倒数第2笔(已完成);
BADS2:=BACKSET(ISLASTBAR,SUMBARS(CROSS(LX=1,0.5)||CROSS(HX=1,0.5),2));
BBDS2:=BACKSET(ISLASTBAR,SUMBARS(CROSS(LX=1,0.5)||CROSS(HX=1,0.5),3));
DRAWLINE1(笔*CROSS(LX=1,0.5)&&BBDS2=1&&BADS2=0,L,CROSS(HX=1,0.5),H,0),COLORMAGENTA;//向上笔(倒数2),紫红色;
DRAWLINE1(笔*CROSS(HX=1,0.5)&&BBDS2=1&&BADS2=0,H,CROSS(LX=1,0.5),L,0),COLORLIGHTGREEN;//向下笔(倒数2),紫红色;
//2.3、倒数第3笔(已完成);
BADS3:=BACKSET(ISLASTBAR,SUMBARS(CROSS(LX=1,0.5)||CROSS(HX=1,0.5),3));
BBDS3:=BACKSET(ISLASTBAR,SUMBARS(CROSS(LX=1,0.5)||CROSS(HX=1,0.5),4));
DRAWLINE1(笔*CROSS(LX=1,0.5)&&BBDS3=1&&BADS3=0,L,CROSS(HX=1,0.5),H,0),COLORMAGENTA;//向上笔(倒数3),紫红色;
DRAWLINE1(笔*CROSS(HX=1,0.5)&&BBDS3=1&&BADS3=0,H,CROSS(LX=1,0.5),L,0),COLORLIGHTGREEN;//向下笔(倒数3),紫红色;
//2.4、倒数第1笔(已完成);
BADS1:=BACKSET(ISLASTBAR,SUMBARS(CROSS(LX=1,0.5)||CROSS(HX=1,0.5),1));
BBDS1:=BACKSET(ISLASTBAR,SUMBARS(CROSS(LX=1,0.5)||CROSS(HX=1,0.5),2));
DRAWLINE1(笔*CROSS(LX=1,0.5)&&BBDS1=1&&BADS1=0,L,CROSS(HX=1,0.5),H,0),COLORMAGENTA;//向上笔(倒数1),紫红色;
DRAWLINE1(笔*CROSS(HX=1,0.5)&&BBDS1=1&&BADS1=0,H,CROSS(LX=1,0.5),L,0),COLORLIGHTGREEN;//向下笔(倒数1),紫红色;
////////4、笔终点标注文字记号;
//4.1、笔(已完成)终点标注文字;
BAA:=IF(CROSS(LX=1,0.5),L,H);
BBB:=BACKSET(ISLASTBAR,SUMBARS(CROSS(LX=1,0.5)||CROSS(HX=1,0.5),4));
DRAWTEXT(笔*BBB&&CROSS(HX=1,0.5)&&COUNT(CROSS(HX=1,0.5),BARSLASTCOUNT(BBB))=1,H,'G2 '),ALIGN2,FONTSIZE18,COLORWHITE;//倒数第2个高点标注文字;
DRAWTEXT(笔*BBB&&CROSS(HX=1,0.5)&&COUNT(CROSS(HX=1,0.5),BARSLASTCOUNT(BBB))=2,H,'G1 '),ALIGN2,FONTSIZE18,COLORWHITE;//倒数第1个高点标注文字;
DRAWTEXT(笔*BBB&&CROSS(LX=1,0.5)&&COUNT(CROSS(LX=1,0.5),BARSLASTCOUNT(BBB))=1,L,'D2 '),ALIGN2,VALIGN0,FONTSIZE18,COLORWHITE;//倒数第2个低点标注文字;
DRAWTEXT(笔*BBB&&CROSS(LX=1,0.5)&&COUNT(CROSS(LX=1,0.5),BARSLASTCOUNT(BBB))=2,L,'D1 '),ALIGN2,VALIGN0,FONTSIZE18,COLORWHITE;//倒数第1个低点标注文字;
BAA0:=BACKSET(ISLASTBAR,SUMBARS(CROSS(LX=1,0.5)||CROSS(HX=1,0.5),5));
DRAWTEXT(笔*CROSS(BAA0>=1,0.5) && CROSS(LX=1,0.5),L,'D3'),ALIGN2,VALIGN0,FONTSIZE18,COLORWHITE;//倒数第3个低点标注文字;
DRAWTEXT(笔*CROSS(BAA0>=1,0.5) && CROSS(HX=1,0.5),H,'G3'),ALIGN2,FONTSIZE18,COLORWHITE;//倒数第3个高点标注文字;
BAA1:=BACKSET(ISLASTBAR,SUMBARS(CROSS(LX=1,0.5)||CROSS(HX=1,0.5),6));
DRAWTEXT(笔*CROSS(BAA1>=1,0.5) && CROSS(LX=1,0.5),L,'D4'),ALIGN2,VALIGN0,FONTSIZE18,COLORWHITE;//倒数第4个低点标注文字;
DRAWTEXT(笔*CROSS(BAA1>=1,0.5) && CROSS(HX=1,0.5),H,'G4'),ALIGN2,FONTSIZE18,COLORWHITE;//倒数第4个高点标注文字;
BAA2:=BACKSET(ISLASTBAR,SUMBARS(CROSS(LX=1,0.5)||CROSS(HX=1,0.5),7));
DRAWTEXT(笔*CROSS(BAA2>=1,0.5) && CROSS(LX=1,0.5),L,'D5'),ALIGN2,VALIGN0,FONTSIZE18,COLORWHITE;//倒数第5个低点标注文字;
DRAWTEXT(笔*CROSS(BAA2>=1,0.5) && CROSS(HX=1,0.5),H,'G5 '),ALIGN2,FONTSIZE18,COLORWHITE;//倒数第5个高点标注文字;
//4.2、笔(未完成)的最后1笔标注文字;
AM26:=BACKSET(ISLASTBAR&&BARSLAST(HH)>BARSLAST(LL),HHVBARS(H,BARSLAST(LL))+1);
BM26:=BACKSET(ISLASTBAR&&BARSLAST(HH)<BARSLAST(LL),LLVBARS(L,BARSLAST(HH))+1);
DRAWTEXT(笔*CROSS(AM26,0.5),H,'G0 '),ALIGN2,FONTSIZE18,COLORWHITE;//最后一笔(未完成)标注文字;
DRAWTEXT(笔*CROSS(BM26,0.5),L,'D0'),ALIGN2,VALIGN2,FONTSIZE18,COLORWHITE;//最后一笔(未完成)标注文字;
//下跌中枢当G1<G2,D1<D2时,D1*G1/G2
QQ:=VALUEWHEN(笔*BBB&&CROSS(HX=1,0.5)&&COUNT(CROSS(HX=1,0.5),BARSLASTCOUNT(BBB))=2,H)<VALUEWHEN(笔*BBB&&CROSS(HX=1,0.5)&&COUNT(CROSS(HX=1,0.5),BARSLASTCOUNT(BBB))=1,H)//下跌中枢当G1<G2,D1<D2时,D1*G1/G2
&&VALUEWHEN(笔*BBB&&CROSS(LX=1,0.5)&&COUNT(CROSS(LX=1,0.5),BARSLASTCOUNT(BBB))=2,L)<VALUEWHEN(笔*BBB&&CROSS(LX=1,0.5)&&COUNT(CROSS(LX=1,0.5),BARSLASTCOUNT(BBB))=1,L);
MM1:=VALUEWHEN(笔*BBB&&CROSS(LX=1,0.5)&&COUNT(CROSS(LX=1,0.5),BARSLASTCOUNT(BBB))=2,L)*VALUEWHEN(笔*BBB&&CROSS(HX=1,0.5)&&COUNT(CROSS(HX=1,0.5),BARSLASTCOUNT(BBB))=2,H)/VALUEWHEN(笔*BBB&&CROSS(HX=1,0.5)&&COUNT(CROSS(HX=1,0.5),BARSLASTCOUNT(BBB))=1,H);//下跌中枢
Z:IF(QQ,MM1,NULL),COLORWHITE;//下跌中枢
DRAWNUMBER(ISLASTBAR,Z,Z,0,COLORWHITE),FONTSIZE20,ALIGN2;//下跌中枢
DRAWSL(ISLASTBAR,Z,0,-10000,0,COLORWHITE),DASH;//下跌中枢
DRAWTEXT(CROSS(QQ,0.5),Z,'F1 '),COLORWHITE,FONTSIZE20,VALIGN2,ALIGN2;//下跌中枢当G1<G2,D1<D2时,D1*G1/G2
KTEXT(笔*CROSS(AM26,0.5)&&H<REF(L,BARSLAST(笔*BBB&&CROSS(LX=1,0.5)&&COUNT(CROSS(LX=1,0.5),BARSLASTCOUNT(BBB))=1)),-BARSLAST(笔*BBB&&CROSS(LX=1,0.5)&&COUNT(CROSS(LX=1,0.5),BARSLASTCOUNT(BBB))=2),REF(H,BARSLAST(笔*BBB&&CROSS(LX=1,0.5)&&COUNT(CROSS(LX=1,0.5),BARSLASTCOUNT(BBB))=2)),1,COLORYELLOW,'低');
KTEXT(笔*CROSS(AM26,0.5)&&L>REF(H,BARSLAST(笔*BBB&&CROSS(HX=1,0.5)&&COUNT(CROSS(HX=1,0.5),BARSLASTCOUNT(BBB))=1)),-BARSLAST(笔*BBB&&CROSS(HX=1,0.5)&&COUNT(CROSS(HX=1,0.5),BARSLASTCOUNT(BBB))=2),REF(L,BARSLAST(笔*BBB&&CROSS(HX=1,0.5)&&COUNT(CROSS(HX=1,0.5),BARSLASTCOUNT(BBB))=2)),1,COLORYELLOW,'高'),VALIGN0;
//
QQX:=VALUEWHEN(笔*BBB&&CROSS(LX=1,0.5)&&COUNT(CROSS(LX=1,0.5),BARSLASTCOUNT(BBB))=2,L)>VALUEWHEN(笔*BBB&&CROSS(LX=1,0.5)&&COUNT(CROSS(LX=1,0.5),BARSLASTCOUNT(BBB))=1,L)//
&&VALUEWHEN(笔*BBB&&CROSS(HX=1,0.5)&&COUNT(CROSS(HX=1,0.5),BARSLASTCOUNT(BBB))=2,H)>VALUEWHEN(笔*BBB&&CROSS(HX=1,0.5)&&COUNT(CROSS(HX=1,0.5),BARSLASTCOUNT(BBB))=1,H);
MM1X:=VALUEWHEN(笔*BBB&&CROSS(HX=1,0.5)&&COUNT(CROSS(HX=1,0.5),BARSLASTCOUNT(BBB))=2,H)*VALUEWHEN(笔*BBB&&CROSS(LX=1,0.5)&&COUNT(CROSS(LX=1,0.5),BARSLASTCOUNT(BBB))=2,L)/VALUEWHEN(笔*BBB&&CROSS(HX=1,0.5)&&COUNT(CROSS(HX=1,0.5),BARSLASTCOUNT(BBB))=1,H);//上涨中枢
ZX:=IF(QQX,MM1X,NULL),COLORWHITE;//上涨中枢
DRAWNUMBER(ISLASTBAR,ZX,ZX,0,COLORYELLOW),FONTSIZE20,ALIGN2;//上涨中枢
DRAWSL(ISLASTBAR,ZX,0,-10000,0,COLORYELLOW),DASH;//上涨中枢
DRAWTEXT(CROSS(QQX,0.5),ZX+MINPRICE,'F2 '),COLORYELLOW,FONTSIZE20,VALIGN2,ALIGN2;//上涨中枢
|
|