文华财经趋势多空转折指标源码:红色和洋红色实线看多,绿色虚线看空
SHORT:=12;
LONG:=26;
M:=12;
DIF:=EMA(CLOSE,SHORT)-EMA(CLOSE,LONG);
DEA:=EMA(DIF,M);
MACD:=2*(DIF-DEA);
KK:=IF(DIF>DEA,5,-5);
JCSC:=(M-1)/(M+1)*DEA/(1-2/(M+1));
{计算出金叉死叉时的DIFF值}
DD:=(MACD/2+(DEA*(M-1)/(M+1)))/(1-2/(M+1));
DIF拐头价:=MA(C,10),COLORGREEN,POINTDOT;
金死叉价:=MA(C,10),NODRAW;
柱变向价:=(DD*(SHORT+1)*(LONG+1)-(LONG+1)*(SHORT-1)*EMA(C,SHORT)+(SHORT+1)*(LONG-1)*EMA(C,LONG))/(2*((LONG+1)-(SHORT+1))),COLORYELLOW,POINTDOT;
黄铢消失见顶:=IF(柱变向价>=DIF拐头价,柱变向价,NULL),COLORYELLOW,CIRCLEDOT,LINETHICK1;
上拐:IF(DIF拐头价<柱变向价,DIF拐头价,NULL),RGB(255,51,255),LINETHICK2;
下拐:IF(DIF拐头价>=柱变向价,DIF拐头价,NULL),COLOR33FF33,POINTDOT,LINETHICK4;
ZJ:=上拐,COLOR0000FF;
HY:=金死叉价,COLORFF00FF;
IF(ZJ>REF(ZJ,1),ZJ,NULL),COLORRED,LINETHICK2;
IF(HY>REF(HY,1),HY,NULL),COLORMAGENTA,LINETHICK2,NODRAW;
IF(HY<REF(HY,1),HY,NULL),COLORBLUE,LINETHICK2,NODRAW;
HD0:=CROSS(DIF,DEA);
金收:=REF(L,BARSLAST(HD0)),COLORYELLOW,DOT;
LD0:=CROSS(DEA,DIF);
死收:=REF(H,BARSLAST(LD0)),COLOR00FF00,DOT;