操盘MACD

{操盘MACD、系统设置MACD}

DIFF:=EMA(CLOSE,12) - EMA(CLOSE,26),COLORMAGENTA;

DEA1:=EMA(DIFF,9),COLORYELLOW;

MACD1:=(DIFF-DEA1)*2,COLORSTICK;

{通达信MACD与MACD周线金叉共振指标源码

命名为操盘MACD}

DIF:EMA(CLOSE,6)-EMA(CLOSE,13),COLORWHITE;

DEA:EMA(DIF,4.5);

MACD:(DIF-DEA)*2,COLORSTICK;

IF(MACD>0,MACD,DRAWNULL),COLORSTICK;

{金叉共振}

VAR04:="MACD.DIF#WEEK"(6,13,4.5);

VAR05:="MACD.DEA#WEEK"(6,13,4.5);

VAR06:="MACD.MACD#WEEK"(6,13,4.5);

VAR7:="MACD.DIF#MONTH"(6,13,4.5);

VAR8:="MACD.DEA#MONTH"(6,13,4.5);

{VAR04:=MA(DIF,5);

VAR05:=MA(DEA,5);

VAR7:=MA(DIF,22);

VAR8:=MA(DEA,22);}

{短线操盘信号}

{M:=EMA(EMA(C,5)-EMA(C,13),1),COLORYELLOW,LINETHICK2;

上翘:DRAWTEXT(ISLASTBAR AND M>REF(M,1),DEA,' ▲'),COLORRED;

下拐:DRAWTEXT(ISLASTBAR AND M<REF(M,1),DEA, ' ▼ '),COLORCCEE00;}

上翘:IF( DIF>REF(DIF,1),DIF,DRAWNULL),COLORRED,LINETHICK2;

下拐:IF( DIF<REF(DIF,1),DIF,DRAWNULL),COLORWHITE,LINETHICK2;

DRAWTEXT(ISLASTBAR AND 上翘,DIF,' ▲'),COLORDD00FF;

DRAWTEXT(ISLASTBAR AND 下拐,DIF, ' ▼ '),COLORCCEE00;

{成交量指标}

TOTAL:=IF(PERIOD=1,5,IF(PERIOD=2,15,IF(PERIOD=3,30,IF(PERIOD=4,60,IF(PERIOD=5,TOTALFZNUM,1)))));

MTIME:=MOD(FROMOPEN,TOTAL);

CTIME:=IF(MTIME<0.5,TOTAL,MTIME);

VVOL:=IF((CURRBARSCOUNT=1 AND DYNAINFO(8)>1),VOL*(TOTAL+3)/(CTIME+3),DRAWNULL),NODRAW;

STICKLINE((CURRBARSCOUNT=1 AND DYNAINFO(8)>1),VVOL,0,-1,-1),COLOR00C0C0,NODRAW;

VOLUME:=VOL,VOLSTICK;

MAVOL1:=MA(VOLUME,5);

MAVOL2:=MA(VOLUME,10);

FLTJ3:=V>=MAVOL1*1.5;

周金叉:IF(CROSS(VAR04,VAR05) ,-0.25,0),LINESTICK, COLORMAGENTA,LINETHICK2;

月金叉:IF(CROSS(VAR7,VAR8),-0.35,0),LINESTICK, COLORRED,LINETHICK2;

出海1:=IF((CROSS(DIF,-0.025) AND FLTJ3),0.2,0),LINESTICK,COLORYELLOW,LINETHICK1;

出海2:=IF((CROSS(DIF,0.0) AND FLTJ3),0.2,0),LINESTICK,COLORYELLOW,LINETHICK1;

出海:IF((出海1 OR 出海2),0.2,0),LINESTICK,COLORYELLOW,LINETHICK1;

{L'★卖'};

{周SKDJ(在日线周期使用)}

周K:="SKDJ.K#WEEK"(9,3);

周D:="SKDJ.D#WEEK"(9,3);

KK:=MA(周K,5);

DD:=MA(周D,5);

周K金叉:IF(CROSS(KK,DD)AND KK<40,0.382,DRAWNULL)LINESTICK, COLORMAGENTA,LINETHICK4;

{月SKDJ(在日线周期使用)}

月K:="SKDJ.K#MONTH"(9,3);

月D:="SKDJ.D#MONTH"(9,3);

K2:=MA(月K,22);

D2:=MA(月D,22);

月K金叉:IF(CROSS(K2,D2)AND K2<50,0.382,DRAWNULL)LINESTICK, COLORYELLOW,LINETHICK4;

销售毛利率:(FINANCE(20)-FINANCE(21) )/FINANCE(20)*100,NODRAW,COLORYELLOW;{N1=50销售毛利率,40,巴菲特选股}

净利率:FINANCE(30)/FINANCE(20)*100,NODRAW;{净利率,N2>5}

净资产收益率:FINANCE(30)/FINANCE(19)*100,NODRAW;{净资产收益率,N3>13};

{通达信MACD二次金叉选股公式:}

{DIFF:=EMA(CLOSE,12)-EMA(CLOSE,26);

DEA:=EMA(DIFF,9);

MACD:=2*(DIFF-DEA);}

AAX:=BARSLAST(REF(CROSS(DIF,DEA),1));

底背离:=REF(CLOSE,AAX+1)>CLOSE AND DIF>REF(DIF,AAX+1) AND CROSS(DIF,DEA);

{DRAWTEXT(底背离,DIF,'←底背离'),COLORWHITE;}

JCCOUNT:=COUNT(CROSS(DIF,DEA),BARSLAST(DEA>0.0) );

二次金叉:=(CROSS(DIF,DEA) AND 底背离) AND DEA<0 AND COUNT(JCCOUNT=2,BARSLAST(DEA>0.0))>=1 ;

DRAWICON(二次金叉,DEA,9);

(0)

相关推荐