自用全套飛狐標(biāo)準(zhǔn)混沌操作法公式AO指標(biāo):Y:=(HIGH+LOW)/2;
AO:=MA(Y,5)-MA(Y,34); AOGreen:IF(AO>REF(AO,1),AO,0),COLORRED,LINETHICK0; STICKLINE(AO>=REF(AO,1),0,AO,6,1),COLORRED; AORed:IF(AO<REF( AO,1),AO,0),COLORGREEN,LINETHICK0; STICKLINE(AO<REF(AO,1),0,AO,6,1),COLORGREEN; SignalLine:MA(AO,5),COLORBLUE; s1:=CROSS(0,AO); DRAWICON(s1,AO,5),ALIGN0; DRAWTEXT(s1,AO,'S'),ALIGN5,COLORWHITE; {//----------------------------以上是下穿0信號(hào);} s2:=ao<0 and REF(ao,1)>REF(ao,2) and ao<REF(ao,1); {DRAWNUMBER(1>0,ao,lu2,0);} DRAWICON(s2,AO,5),ALIGN0; DRAWTEXT(s2,AO,'S'),ALIGN5,COLORWHITE; {//-----------------------------以上碟型賣出信號(hào);} scount:=BARSLAST(ao<0);{//上一次ao>0后到現(xiàn)在的周期數(shù);} {//DRAWNUMBER(1>0,ao-0.1,scount,0);} sd:=HHV(ao,scount);{//求上面周期的最大ao;} scountd:=HHVBARS(ao,scount);{//求最大值到現(xiàn)在的周期數(shù);} {//DRAWNUMBER(1>0,ao-0.3,scountd,0);} s3:=ao>0 and REF(ao,1)>REF(ao,2) and ao<REF(ao,1);{//滿足峰的條件;} s31:=COUNT(s3,scountd);{//滿足上面條件的次數(shù);} {//DRAWNUMBER(1>0,ao-0.5,s31,0);} DRAWICON(s31>=2 and s3,AO,5),ALIGN0; DRAWTEXT(s31>=2 and s3,AO,'S'),ALIGN5,COLORWHITE; {//----------------------------以上是雙峰賣出信號(hào);} b1:=CROSS(AO,0); DRAWICON(b1,AO,4),ALIGN0; DRAWTEXT(b1,AO,'B'),ALIGN4,COLORWHITE; {//----------------------------以上是上穿0信號(hào);} b2:=ao>0 and REF(ao,1)<REF(ao,2) and ao>REF(ao,1) ; {DRAWNUMBER(1>0,ao,lu2,0);} DRAWICON(b2,AO,4),ALIGN0; DRAWTEXT(b2,AO,'B'),ALIGN4,COLORWHITE; {//-----------------------------以上碟型買入信號(hào);} bcount:=BARSLAST(ao>0);{//上一次ao>0后到現(xiàn)在的周期數(shù);} {//DRAWNUMBER(1>0,ao-0.1,bcount,0);} bd:=LLV(ao,bcount);{//求上面周期的最小ao;} bcountd:=LLVBARS(ao,bcount);{//求最小值到現(xiàn)在的周期數(shù);} {//DRAWNUMBER(1>0,ao-0.3,bcountd,0);} b3:=ao<0 and REF(ao,1)<REF(ao,2) and ao>REF(ao,1);{//滿足峰的條件;} b31:=COUNT(b3,bcountd);{//滿足上面條件的次數(shù);} {//DRAWNUMBER(1>0,ao-0.5,lu31,0);} DRAWICON(b31>=2 and b3,AO,4),ALIGN0; DRAWTEXT(b31>=2 and b3,AO,'B'),ALIGN4,COLORWHITE; {//----------------------------以上是雙峰買進(jìn)信號(hào);} AC指標(biāo): { Chaos Accelerator/Decelerator Oscillator } { Measures acceleration -AC} { Plot as histogram } Y:=(HIGH+LOW)/2; AC:=MA(Y,5)-MA(Y,34)-MA(MA(Y,5)-MA(Y,34),5); {Put in the same window and plot green} ACGreen:IF(AC>REF( AC,1) ,AC,0 ),LINETHICK0,COLORRED; STICKLINE(AC<REF(AC,1),0,AC,6,1),COLORGREEN; {Put in its on window as a histogram and plot red} ACRed:IF(AC<REF( AC,1) ,AC,0 ),LINETHICK0,COLORGREEN; STICKLINE(AC>REF(AC,1),0,AC,6,1),COLORRED; ac1:=REF(AC,1); buy1:=REF(AC,3)<REF(ac1,3) and REF(AC,2)<REF(ac1,2) and REF(AC,2)<REF(AC,3) and REF(AC,1)>REF(ac1,1) and AC>ac1 and COUNT(AC>0,4)=4 {ref(AC,3)>0 and ref(AC,1)>0 and ref(AC,2)>0 and AC>0}; DRAWICON(buy1,AC,4); DRAWTEXT(buy1,AC, 'B'),align4,COLORWHITE; buy2:=COUNT(AC<0,4)=4 and REF(AC,3)<REF(ac1,3) and COUNT(AC>ac1,3)=3; DRAWICON(buy2,AC,4); DRAWTEXT(buy2,AC, 'B'),align4,COLORWHITE; buy3:=REF(AC,3)<REF(ac1,3) and REF(AC,2)<REF(ac1,2) and REF(AC,2)<REF(AC,3) and COUNT(AC>ac1,2)=2 and REF(AC,1)<0 and AC>0; DRAWICON(buy3,AC,4); DRAWTEXT(buy3,AC, 'B'),align4,COLORWHITE; buy4:=REF(AC,4)<REF(ac1,4) and REF(AC,3)<REF(ac1,3) and REF(AC,3)<REF(AC,4) and COUNT(AC>ac1,3)=3 and REF(AC,1)<0 and AC>0; DRAWICON(buy4,AC,4) ALIGN0; DRAWTEXT(buy4,AC, 'B'),align4,COLORWHITE; s1:=REF(AC,3)>REF(ac1,3) and REF(AC,2)>REF(ac1,2) and REF(AC,2)>REF(AC,3) and REF(AC,1)<REF(ac1,1) and AC<ac1 and COUNT(AC<0,4)=4 {ref(AC,3)<0 and ref(AC,1)<0 and ref(AC,2)<0 and AC<0}; DRAWICON(s1,AC,5); DRAWTEXT(s1,AC, 'S'),align5,COLORWHITE; s2:=COUNT(AC>0,4)=4 and REF(AC,3)>REF(ac1,3) and COUNT(AC<ac1,3)=3; DRAWICON(s2,AC,5); DRAWTEXT(s2,AC, 'S'),align5,COLORWHITE; s3:=REF(AC,3)>REF(ac1,3) and REF(AC,2)>REF(ac1,2) and REF(AC,2)>REF(AC,3) and COUNT(AC<ac1,2)=2 and REF(AC,1)>0 and AC<0; DRAWICON(s3,AC,5); DRAWTEXT(s3,AC, 'S'),align5,COLORWHITE; s4:=REF(AC,4)>REF(ac1,4) and REF(AC,3)>REF(ac1,3) and REF(AC,3)>REF(AC,4) and COUNT(AC<ac1,3)=3 and REF(AC,1)>0 and AC<0; DRAWICON(s4,AC,5) ALIGN0; DRAWTEXT(s4,AC, 'S'),align5,COLORWHITE; 鱷魚線指標(biāo): var1:=(HIGH+LOW)/2; 唇:SMA(var1,5,1),SHIFT3,COLORGREEN; 齒:SMA(var1,8,1),SHIFT5,COLORRED; 顎:SMA(var1,13,1),SHIFT8,COLORBLUE; {平衡線} P1:=REF(HIGH,1)>HIGH AND REF(HIGH,1)>顎; 平衡線買:REF(REF(HIGH,1),BARSLAST(p1)),LINETHICK0,COLORWHITE; STICKLINE(CROSS(HIGH,平衡線買) AND LOW>平衡線買,(HIGH+LOW)/2,(HIGH+LOW)/2,14,0),COLORWHITE; STICKLINE(CROSS(HIGH,平衡線買) AND LOW<=平衡線買,平衡線買,平衡線買,14,0),COLORWHITE; P2:=REF(LOW,1)<LOW AND REF(LOW,1)<顎; 平衡線賣:REF(REF(LOW,1),BARSLAST(p2)),LINETHICK0,COLORMAGENTA; STICKLINE(CROSS(平衡線賣,LOW) AND HIGH<平衡線賣,(HIGH+LOW)/2,(HIGH+LOW)/2,14,0),COLORMAGENTA; STICKLINE(CROSS(平衡線賣,LOW) AND HIGH>=平衡線賣,平衡線賣,平衡線賣,14,0),COLORMAGENTA; ho:=HIGH>REF(HIGH,1) and HIGH>REF(HIGH,2) and HIGH>=REFX(HIGH,1) and IF(HIGH=REFX(HIGH,2),HIGH>REFX(HIGH,3),HIGH>REFX(HIGH,2)); fxh:=CROSS(ho,0.9); hh:=REF(HIGH,BARSLAST(fxh)); lo:=LOW<REF(LOW,1) and LOW<REF(LOW,2) and LOW<=REFX(LOW,1) and IF(LOW=REFX(LOW,2),LOW<REFX(LOW,3),LOW<REFX(LOW,2)); fxl:=CROSS(lo,0.9); ll:=REF(LOW,BARSLAST(fxl)); 上分形: hh,, POINTDOT,ColorEA91B5; STICKLINE(CLOSE,hh,hh,5,0),LINETHICK1,COLORRED; 下分形: ll, POINTDOT,Color3791B5; STICKLINE(CLOSE,ll,ll,5,0),LINETHICK1,COLORYELLOW; Y:=(HIGH+LOW)/2; AO:=MA(Var1,5)-MA(Var1,34); AC:=MA(Y,5)-MA(Y,34)-MA(MA(Y,5)-MA(Y,34),5)linethick1; ac1:=REF(AC,1); {stickline(AC>ac1,20,ac+20,8,0),colorRED;} {stickline(AC<ac1,20,ac+20,8,0),colorgreen;} Var1:=(HIGH+LOW)/2; AO:=MA(Var1,5)-MA(Var1,35),linethick1; ao1:=REF(ao,1); {stickline(Ao>ao1,0,ao,8,0),colorRED;} {stickline(Ao<ao1,0,ao,8,0),colorgreen;} STICKLINE(AC>ac1 and Ao>ao1,HIGH,LOW,0.1,0),COLORRED; m:=IF(CLOSE>OPEN,0,1); STICKLINE(AC>ac1 and Ao>ao1 and CLOSE<OPEN,CLOSE,OPEN,5,1),colorred; STICKLINE(AC>ac1 and Ao>ao1 and CLOSE>OPEN,CLOSE,OPEN,5,0),colorred; STICKLINE(AC>ac1 and Ao<ao1 or AC<ac1 and Ao>ao1,HIGH,LOW,0.1,0),COLORGRAY; STICKLINE((AC>ac1 and Ao<ao1 or AC<ac1 and Ao>ao1) and CLOSE>OPEN,CLOSE,OPEN,5,0),COLORGRAY; STICKLINE((AC>ac1 and Ao<ao1 or AC<ac1 and Ao>ao1) and CLOSE<OPEN,CLOSE,OPEN,5,1),COLORGRAY; STICKLINE(AC<ac1 and Ao<ao1,HIGH,LOW,0.1,0),COLORGREEN; STICKLINE(AC<ac1 and Ao<ao1 and CLOSE>OPEN,CLOSE,OPEN,5,0),COLORGREEN; STICKLINE(AC<ac1 and Ao<ao1 and CLOSE<OPEN,CLOSE,OPEN,5,1),COLORGREEN; R1:=REF(SMA(Y,8,1),5); R2:=IF(C<R1,0,R1);R3:=IF(C>R1,0,R1); {========AO及AC方向========} DRAWTEXT(ISLASTBAR AND AO>REF(AO,1) AND AC>REF(AC,1),1.0004*R1,'↑↑'),SHIFT1,COLORRED; DRAWTEXT(ISLASTBAR AND AO<REF(AO,1) AND AC<REF(AC,1),1.0004*R1,'↓↓'),SHIFT1,COLORGREEN; DRAWTEXT(ISLASTBAR AND AO>REF(AO,1) AND AC<REF(AC,1),1.0004*R1,'↑↓'),SHIFT1,COLORGRAY; DRAWTEXT(ISLASTBAR AND AO<REF(AO,1) AND AC>REF(AC,1),1.0004*R1,'↓↑'),SHIFT1,COLORGRAY; |
|