飞狐超级混沌AC副图指标
源码
Y:=(HIGH+LOW)/2;
AO:=MA(Y ,5 )-MA(Y ,34 );
AC:AO-MA( AO,5),linethick0;
ac1:=ref(AC,1);
明中值反转价:(5*34*5*AO-5*34*5*MA(AO,5)+5*34*4*MA(AO,4)+5*4*33*MA(Y,33)-4*34*4*MA(Y,4))/116,linethick0;
明中值零轴穿越价:(5*34*MA(AO,4)-34*4*MA(Y,4)+5*33*MA(Y,33))/29,linethick0;
stickline(AC>ac1,0,ac,8,0),colorRED;
stickline(AC<ac1,0,ac,8,0),colorgreen;
DU0:=CROSS(AC,0);
UD0:=CROSS(0,AC);
TDU0:=BARSLAST(DU0);
TUD0:=BARSLAST(UD0);
DU3:=REF(DU0,1);
UD3:=REF(UD0,1);
TDU3:=BARSLAST(DU3);
TUD3:=BARSLAST(UD3);
UDGLINE:=IF(TDU3<TUD3,REF(HHV(H,2),TDU3),REF(LLV(L,2),TUD3)),COLORYELLOW;
JDU0:=REF(C,1)<=REF(UDGLINE,1) AND C>UDGLINE AND TDU0<TUD0;
JUD0:=REF(C,1)>=REF(UDGLINE,1) AND C<UDGLINE AND TUD0<TDU0;
JDU1:=JDU0 AND COUNT(JDU0,TDU0)=1;
JUD1:=JUD0 AND COUNT(JUD0,TUD0)=1;
JDU2:=JDU1 AND REF(BARSLAST(JUD1),1)<REF(BARSLAST(JDU1),1);
JUD2:=JUD1 AND REF(BARSLAST(JUD1),1)>REF(BARSLAST(JDU1),1);
JDU3:=JDU1 AND REF(BARSLAST(JUD1),1)>REF(BARSLAST(JDU1),1);
JUD3:=JUD1 AND REF(BARSLAST(JUD1),1)<REF(BARSLAST(JDU1),1);
DRAWTEXT(JDU2,LLV(AC,20)/2,'空转多');
DRAWTEXT(JUD2,HHV(AC,20),'多转空');
DRAWTEXT(JDU3,LLV(AC,20)/2,'多续多');
DRAWTEXT(JUD3,HHV(AC,20),'空续空');
DRAWICON(JDU1 OR BARSLAST(JDU1)<BARSLAST(JUD1),0,10),ALIGN4;
DRAWICON(JUD1 OR BARSLAST(JDU1)>BARSLAST(JUD1),0,11),ALIGN5;
JUU:=JDU1 OR BARSLAST(JDU1)<BARSLAST(JUD1);
JDD:=JUD1 OR BARSLAST(JDU1)>BARSLAST(JUD1);
DRAWICON(JUU AND (CROSS(0,AC) OR REF(CROSS(0,AC),1)),AC,4);
DRAWICON(JDD AND (CROSS(AC,0) OR REF(CROSS(AC,0),1)),AC,5),ALIGN0;
BSLINE:=IF(BARSLAST(JDU2)<BARSLAST(JUD2),IF(REF(CROSS(0,AC),1),LLV(L,2),REF(LLV(L,2),BARSLAST(REF(CROSS(0,AC),1)))),IF(REF(CROSS(AC,0),1),HHV(H,2),REF(HHV(H,2),BARSLAST(REF(CROSS(AC,0),1))))),COLORMAGENTA;
DRAWICON(JUU AND (CROSS(0,AC) OR REF(CROSS(0,AC),1)),AC,4);
DRAWICON(JDD AND (CROSS(AC,0) OR REF(CROSS(AC,0),1)),AC,5),ALIGN0;
DRAWICON(JDU1 OR BARSLAST(JDU1)<BARSLAST(JUD1),0,10),ALIGN4;
DRAWICON(JUD1 OR BARSLAST(JDU1)>BARSLAST(JUD1),0,11),ALIGN5;
ACUT:=BARSLAST(CROSS(AC,0));
ACDT:=BARSLAST(CROSS(0,AC));
ACUL:=IF(AC>=0,HHV(AC,ACUT+1),REF(HHV(AC,ACUT+1),ACDT+1));
ACDL:=IF(AC<0,LLV(AC,ACDT+1),REF(LLV(AC,ACDT+1),ACUT+1));
ACU2L:=REF(ACUL,ACUT+1);
ACD2L:=REF(ACDL,ACDT+1);
DRAWICON(LLV(AC,4)>0 AND AC<REF(AC,1) AND REF(AC,1)>REF(AC,2) AND REF(AC,2)>REF(AC,3),-ac/20,9);
DRAWICON(HHV(AC,4)<0 AND AC>REF(AC,1) AND REF(AC,1)<REF(AC,2) AND REF(AC,2)<REF(AC,3),0,8),ALIGN0;
DRAWICON((JUD1 OR BARSLAST(JDU1)>BARSLAST(JUD1)) AND AC>=0 AND REF(AC,1)<REF(ACU2L,1) AND AC>ACU2L,AC,12),ALIGN0;
DRAWICON((JDU1 OR BARSLAST(JDU1)<BARSLAST(JUD1)) AND AC<0 AND REF(AC,1)>REF(ACD2L,1) AND AC<ACD2L,AC,12);