高低畫線主圖均線交叉斜線指標(biāo)公式文華指標(biāo)分享

MA5:MA(C,5);
MA10:MA(C,10);
JC:=CROSS(MA5,MA10);
SC:=CROSS(MA10,MA5);
HHN:=VALUEWHEN(SC,HHVBARS(H,BARSLAST(JC)+1)+1);
AA:=BACKSET(SC&& BARSLAST(JC)>=3,HHN) ;? ? ? ? //增加距離上次金叉大于等于3(可以自行修改)
LLN:=VALUEWHEN(JC,LLVBARS(L,BARSLAST(SC)+1)+1);
BB:=BACKSET(JC&& BARSLAST(SC)>=3,LLN);? ? ? ? ? //增加距離上次死叉大于等于3(可以自行修改)
DRAWLINE1(CROSS(AA,0.5),H,CROSS(BB,0.5),L,0),COLORWHITE,DOT,LINETHICK1;
DRAWLINE1(CROSS(BB,0.5),L,CROSS(AA,0.5),H,0),COLORMAGENTA,DOT,LINETHICK1;
H10:=MA(H,10),DOT;
L10:=MA(L,10),DOT;
JCH:=BARSLAST(CROSS(C,H10))+1;
SCH:=BARSLAST(CROSSDOWN(C,H10))+1;
JCL:=BARSLAST(CROSS(C,L10))+1;
SCL:=BARSLAST(CROSSDOWN(C,L10))+1;
AH:REF(HHV(MAX(O,C),JCH),SCH);
AL:REF(LLV(MIN(O,C),SCL),JCL);
JC1:=CROSS(C,H10),NODRAW;
JC2:=CROSS(C,L10),NODRAW;
SC1:CROSSDOWN(C,H10),NODRAW;
SC2:CROSSDOWN(C,L10),NODRAW;
JC1S:=REF(SUMBARS(JC2,1)<SUMBARS(JC1,1) && EXIST(JC1,SUMBARS(JC2,1))=0,1) &&JC1 || (JC1&&JC2);
SC1S:=REF(SUMBARS(SC1,1)<SUMBARS(JC1,1) && EXIST(SC2,SUMBARS(SC1,1))=0,1) &&SC2 || (SC2&&SC1);
N1:=HHVBARS(MAX(O,C),SUMBARS(JC1S,1));
N2:=LLVBARS(MIN(O,C),SUMBARS(SC1S,1)) ;
X1:BACKSET(SC1S,N1+1),NODRAW;
X2:BACKSET(JC1S,N2+1),NODRAW;
XX1:=CROSS(X1,0.5);
XX2:=CROSS(X2,0.5);
SX1:=MOD(COUNT(XX1,BARPOS),2)=0;
SX2:=MOD(COUNT(XX2,BARPOS),2)=0;
BJ1:=BACKSET(ISLASTBAR,SUMBARS(XX1,3));
BJ2:=BACKSET(ISLASTBAR,SUMBARS(XX2,3));
DRAWLINE1(BJ1&&CROSS(X1,0.5)&&SX1=0 ,MAX(O,C),BJ1&&CROSS(X1,0.5)&&SX1=1 ,MAX(O,C),0),COLORRED;
DRAWLINE1(BJ1&&CROSS(X1,0.5)&&SX1=1 ,MAX(O,C),BJ1&&CROSS(X1,0.5)&&SX1=0 ,MAX(O,C),0),COLORRED;
DRAWLINE1(BJ2&&CROSS(X2,0.5)&&SX2=0,MIN(O,C),BJ2&&CROSS(X2,0.5)&&SX2=1 ,MIN(O,C),0),COLORGREEN;
DRAWLINE1(BJ2&&CROSS(X2,0.5)&&SX2=1,MIN(O,C),BJ2&&CROSS(X2,0.5)&&SX2=0 ,MIN(O,C),0),COLORGREEN;