N:=9;
M1:=3;
M2:=3;
RSV1:=(CLOSE-LLV(LOW,N))/(HHV(HIGH,N)-LLV(LOW,N))*100;
K1:=SMA(RSV1,M1,1);
D1:=SMA(K1,M2,1);
MAJ1:=3*K1-2*D1;
RSV2:=(INDEXC-LLV(INDEXL,N))/(HHV(INDEXH,N)-LLV(INDEXL,N))*100;
K2:=SMA(RSV2,M1,1);
D2:=SMA(K2,M2,1);
MAJ2:=3*K2-2*D2;
TM:=(MAJ1-MAJ2);
TJ2:=MAJ1>REF(MAJ1,1) AND MAJ2>REF(MAJ2,1) AND TM>=REF(TM,1) AND REF(TM,1)<REF(TM,2) ;
TJ3:=EXIST(crOSS(MAJ1,0),2) AND MAJ2>REF(MAJ2,1);
红箭头买:TJ3;