通达信缠论指标公式----“缠中套利”
老笔:=1;
XA_1:=MA(CLOSE,5);
XA_2:=MA(CLOSE,10);
XA_3:=REF(HIGH,5)=HHV(HIGH,11);
XA_4:=REF(LOW,5)=LLV(LOW,11);
XA_5:=BACKSET(XA_3,6)>BACKSET(XA_3,5);
XA_6:=BACKSET(XA_4,6)>BACKSET(XA_4,5);
XA_7:=IF(BARSLAST(XA_5)=BARSLAST(XA_6) AND XA_1>XA_2,XA_5,IF(BARSLAST(XA_6)>BARSLAST(XA_5),XA_5,0));
XA_8:=IF(BARSLAST(XA_5)=BARSLAST(XA_6) AND XA_2>XA_1,XA_6,IF(BARSLAST(XA_5)>BARSLAST(XA_6),XA_6,0));
XA_9:=XA_7 AND HIGH=HHV(HIGH,BARSLAST(XA_8));
XA_10:=XA_8 AND LOW=LLV(LOW,BARSLAST(XA_7));
GP:IF(XA_9,HIGH,DRAWNULL),CIRCLEDOT,COLORCYAN;
DP:IF(XA_10,LOW,DRAWNULL),CIRCLEDOT,COLORCYAN;
XA_11:=LOW>REF(HIGH,1) AND DAY!=REF(DAY,1);
XA_12:=HIGH<REF(LOW,1) AND DAY!=REF(DAY,1);
XA_13:=REF(LOW,BARSLAST(XA_11));
XA_14:=REF(HIGH,BARSLAST(XA_12));
XA_15:=REF(HIGH,BARSLAST(XA_9));
XA_16:=REF(LOW,BARSLAST(XA_9));
XA_17:=REF(HIGH,BARSLAST(XA_9)+1);
XA_18:=REF(LOW,BARSLAST(XA_9)+1);
XA_19:=REF(HIGH,BARSLAST(XA_9)+2);
XA_20:=REF(LOW,BARSLAST(XA_9)+2);
XA_21:=REF(HIGH,BARSLAST(XA_10));
XA_22:=REF(LOW,BARSLAST(XA_10));
XA_23:=REF(HIGH,BARSLAST(XA_10)+1);
XA_24:=REF(LOW,BARSLAST(XA_10)+1);
XA_25:=REF(HIGH,BARSLAST(XA_10)+2);
XA_26:=REF(LOW,BARSLAST(XA_10)+2);
XA_27:=IF(XA_16<=XA_18,XA_19,XA_17);
XA_28:=IF(XA_17<XA_16,XA_16,IF(XA_16<=XA_18,XA_20,XA_18));
XA_29:=IF(XA_24>XA_21,XA_21,IF(XA_21>=XA_23,XA_25,XA_23));
XA_30:=IF(XA_21>=XA_23,XA_26,XA_24);
XA_31:=XA_15>XA_29 AND XA_9;
XA_32:=XA_22<XA_28 AND XA_10;
XA_33:=XA_31 AND XA_15>XA_21 AND XA_16>XA_22 AND XA_18>XA_22;
XA_34:=XA_32 AND XA_22<XA_16 AND XA_21<XA_15 AND XA_23<XA_15;
XA_35:=HIGH<=REF(HIGH,1) AND LOW>=REF(LOW,1) OR (HIGH>=REF(HIGH,1) AND LOW<=REF(LOW,1));
XA_36:=COUNT(XA_35,BARSLAST(XA_10));
XA_37:=COUNT(XA_35,BARSLAST(XA_9));
XA_38:=COUNT(XA_11,BARSLAST(XA_10));
XA_39:=COUNT(XA_12,BARSLAST(XA_9));
XA_40:=IF(XA_36>0,XA_36+2+老笔,IF(XA_37,XA_37+2+老笔,3));
XA_41:=IF(XA_38,XA_40-XA_38,IF(XA_39,XA_40-XA_39,XA_40));
XA_42:=XA_33 AND BARSLAST(XA_34)>XA_41;
XA_43:=XA_34 AND BARSLAST(XA_33)>XA_41;
XA_44:=XA_9 AND REF(HIGH,BARSLAST(XA_9))>=REF(HIGH,BARSLAST(XA_42)) AND BARSLAST(XA_43)>BARSLAST(XA_42) OR (XA_31 AND COUNT(XA_11,BARSLAST(XA_32))>0 AND REF(HIGH,BARSLAST(XA_31))>REF(HIGH,BARSLAST(XA_42)));
XA_45:=XA_10 AND REF(LOW,BARSLAST(XA_10))<=REF(LOW,BARSLAST(XA_43)) AND BARSLAST(XA_42)>BARSLAST(XA_43) OR (XA_32 AND COUNT(XA_12,BARSLAST(XA_31))>0 AND REF(LOW,BARSLAST(XA_32))<REF(HIGH,BARSLAST(XA_43)));
XA_46:=IF(BARSLAST(XA_45)>BARSLAST(XA_44),REF(HIGH,BARSLAST(XA_44)),REF(HIGH,BARSLAST(XA_45)));
XA_47:=IF(BARSLAST(XA_44)>BARSLAST(XA_45),REF(LOW,BARSLAST(XA_45)),REF(LOW,BARSLAST(XA_44)));
XA_48:=XA_44 AND HIGH=HHV(XA_46,BARSLAST(XA_45)+1) AND HIGH>REF(HIGH,1) AND BARSLAST(XA_45)>BARSLAST(XA_44);
XA_49:=XA_45 AND LOW=LLV(XA_47,BARSLAST(XA_44)+1) AND LOW<REF(LOW,1) AND BARSLAST(XA_44)>BARSLAST(XA_45);
XA_50:=XA_48 OR (XA_9 AND REF(HIGH,BARSLAST(XA_9))>REF(HIGH,BARSLAST(XA_48)) AND BARSLAST(XA_49)>BARSLAST(XA_48));
XA_51:=XA_49 OR (XA_10 AND REF(LOW,BARSLAST(XA_10))<REF(LOW,BARSLAST(XA_49)) AND BARSLAST(XA_48)>BARSLAST(XA_49));
GPB:IF(XA_42,HIGH,DRAWNULL),CIRCLEDOT,COLORYELLOW;
DPB:IF(XA_43,LOW,DRAWNULL),CIRCLEDOT,COLORYELLOW;
XA_52:=XA_50;
XA_53:=XA_51;
L1:DRAWLINE(XA_53,LOW,XA_52,HIGH,0),COLORYELLOW;
L2:DRAWLINE(XA_52,HIGH,XA_53,LOW,0),COLORWHITE;
XA_54:=CLOSE;
XA_55:=FILTER(BACKSET(FILTER(REF(XA_54,10)=HHV(XA_54,2*10+1),10),10+1),10);
XA_56:=FILTER(BACKSET(FILTER(REF(XA_54,10)=LLV(XA_54,2*10+1),10),10+1),10);
XA_57:=REF(CLOSE,BARSLAST(XA_55));
XA_58:=REF(CLOSE,BARSLAST(XA_56));
XA_59:=BARSLAST(XA_55)<BARSLAST(XA_56) AND NOT(XA_55);
XA_60:=BARSLAST(XA_55)>BARSLAST(XA_56) AND NOT(XA_56);
波段顶:IF(XA_59,XA_57,XA_57),POINTDOT,COLORLIGREEN,LINETHICK4;
波段底:IF(XA_60,XA_58,XA_58),POINTDOT,COLORMAGENTA,LINETHICK4;