K線圖疊加MACD指標(biāo)公式
2019-05-05 11:33 綜投網(wǎng)
STICKLINE(C>=O,C,O,3,0),COLOR000045;
STICKLINE(C>=O,C,O,2.5,0),COLOR000065;
STICKLINE(C>=O,C,O,2,0),COLOR000085;
STICKLINE(C>=O,C,O,1.5,0),COLOR0000A5;
STICKLINE(C>=O,C,O,1,0),COLOR0000C5;
STICKLINE(C>=O,C,O,0.5,0),COLOR0000E5;
STICKLINE(C>=O,H,L,0,0),COLOR0000F5;
STICKLINE(C
STICKLINE(C
STICKLINE(C
STICKLINE(C
STICKLINE(C
STICKLINE(C
STICKLINE(C
DDIF:EMA(CLOSE,12)-EMA(CLOSE,26),NODRAW;
DDEA:EMA(DDIF,9),NODRAW;
DMACD:(DDIF-DDEA)*2,NODRAW;
上市天數(shù):=BARSCOUNT(C); N:=IF(上市天數(shù)<90,上市天數(shù)-1,90);
基點(diǎn):=CONST(LLV(L,N)); 基:=CONST(HHV(H,N))-基點(diǎn);
分:=CONST(LLV(DDIF,N)); 百:=CONST(HHV(DDIF,N))-分;
CC比:=(DDIF-分)/百; XCX:=CC比*基+基點(diǎn);
DIF:=XCX; NOTEXTDDIF:DIF,COLORWHITE;
DEA:=EMA(DIF,9); NOTEXTDDEA:DEA,COLORYELLOW;
基準(zhǔn)零線:=(0-分)/百*基+基點(diǎn); NOTEXT基準(zhǔn)零線:基準(zhǔn)零線,POINTDOT,COLORLIRED;
MACD:=(DIF-DEA)*2;
STICKLINE(MACD>=0,基準(zhǔn)零線,基準(zhǔn)零線+MACD,0,0),COLORLIRED;
STICKLINE(MACD<0,基準(zhǔn)零線,基準(zhǔn)零線+MACD,0,0),COLORLICYAN;
A1:=BARSLAST(REF(CROSS(DIF,DEA),1));
底部結(jié)構(gòu):=REF(C,A1+1)>C AND DIF>REF(DIF,A1+1) AND CROSS(DIF,DEA);
DRAWLINE(A1=0,REF(DEA,1),底部結(jié)構(gòu),REF(DEA,A1+1),0),COLORMAGENTA,LINETHICK1;
STICKLINE(底部結(jié)構(gòu),DEA,REF(DEA,A1+1),0,0),COLORMAGENTA,LINETHICK1;
DRAWTEXT(底部結(jié)構(gòu)>0,REF(DEA,A1+1),'底背離'),COLORMAGENTA;
A2:=BARSLAST(REF(CROSS(DEA,DIF),1));
頂部結(jié)構(gòu):=REF(C,A2+1)
DRAWLINE(A2=0,REF(DEA,1),頂部結(jié)構(gòu),REF(DEA,A2+1),0),COLORGREEN,LINETHICK1;
STICKLINE(頂部結(jié)構(gòu),DEA,REF(DEA,A2+1),0,0),COLORGREEN,LINETHICK1;
DRAWTEXT(頂部結(jié)構(gòu)>0,REF(DEA,A2+1),'頂背離'),COLORGREEN;
市盈率1:=DYNAINFO(39);
營業(yè)收入:=FINANCE(20)/10000;
銷售毛利率:=((FINANCE(20)-FINANCE(21))/FINANCE(20)*100);
凈利潤:=FINANCE(30)/10000;
凈利潤比率:=(FINANCE(30)/FINANCE(20)*100);
主營利潤率1:=(FINANCE(23)/FINANCE(20)*100);
優(yōu)質(zhì)資產(chǎn)率:=((FINANCE(19)-FINANCE(22)-FINANCE(27))/FINANCE(19));{理論上越大越好但不同行業(yè)有不同標(biāo)準(zhǔn)};
現(xiàn)金負(fù)債比:=(FINANCE(25)/FINANCE(15));{缺長期負(fù)債或負(fù)債總額,理論上越大越好但不同行業(yè)有不同標(biāo)準(zhǔn)};
凈利同增率:=FINANCE(43);
DRAWTEXT_FIX(1,0.42,0.10,1,'市盈率:'),COLORYELLOW;
DRAWTEXT_FIX(1,0.42,0.15,1,'收入 萬元:'),COLORYELLOW;
DRAWTEXT_FIX(1,0.42,0.20,1,'銷售毛利率:'),COLORYELLOW;
DRAWTEXT_FIX(1,0.42,0.25,1,'凈利 萬元:'),COLORYELLOW;
DRAWTEXT_FIX(1,0.42,0.30,1,'凈利潤率 :'),COLORYELLOW;
DRAWTEXT_FIX(1,0.42,0.35,1,'主營利潤率:'),COLORYELLOW;
DRAWTEXT_FIX(1,0.42,0.40,1,'優(yōu)質(zhì)資產(chǎn)率:'),COLORYELLOW;
DRAWTEXT_FIX(1,0.42,0.45,1,'現(xiàn)金負(fù)債比:'),COLORYELLOW;
DRAWNUMBER_FIX(1,0.47,0.10,1,市盈率1),COLORWHITE;
DRAWNUMBER_FIX(1,0.47,0.15,1,營業(yè)收入),COLORWHITE;
DRAWNUMBER_FIX(1,0.47,0.20,1,銷售毛利率),COLORWHITE;
DRAWNUMBER_FIX(1,0.47,0.25,1,凈利潤),COLORWHITE;
DRAWNUMBER_FIX(1,0.47,0.30,1,凈利潤比率),COLORWHITE;
DRAWNUMBER_FIX(1,0.47,0.35,1,主營利潤率1),COLORWHITE;
DRAWNUMBER_FIX(1,0.47,0.40,1,優(yōu)質(zhì)資產(chǎn)率),COLORWHITE;
DRAWNUMBER_FIX(1,0.47,0.45,1,現(xiàn)金負(fù)債比),COLORWHITE;
市凈率:=CONST(DYNAINFO(7) / FINANCE(34));
營收同比增:=FINANCE(44);
每股凈資產(chǎn):=FINANCE(34);
每股收益季:=CONST(FINANCE(33)/(5-FINANCE(37)));
每股現(xiàn)金流:=CONST((FINANCE(25)/FINANCE(1)));
每股未分配:=CONST(FINANCE(32));
每股公積金:=CONST(FINANCE(18));
DRAWTEXT_FIX(1,0.54,0.10,1,'市凈率 :'),COLORYELLOW;
DRAWTEXT_FIX(1,0.54,0.15,1,'收入同比增 :'),COLORYELLOW;
DRAWTEXT_FIX(1,0.54,0.20,1,'每股凈資產(chǎn):'),COLORYELLOW;
DRAWTEXT_FIX(1,0.54,0.25,1,'凈利同比增:'),COLORYELLOW;
DRAWTEXT_FIX(1,0.54,0.30,1,'每股收益季:'),COLORYELLOW;
DRAWTEXT_FIX(1,0.54,0.35,1,'每股現(xiàn)金流:'),COLORYELLOW;
DRAWTEXT_FIX(1,0.54,0.40,1,'每股未分配:'),COLORYELLOW;
DRAWTEXT_FIX(1,0.54,0.45,1,'每股公積金:'),COLORYELLOW;
DRAWNUMBER_FIX(1,0.57,0.10,1,市凈率),COLORWHITE;
DRAWNUMBER_FIX(1,0.57,0.15,1,營收同比增),COLORWHITE;
DRAWNUMBER_FIX(1,0.57,0.20,1,每股凈資產(chǎn)),COLORWHITE;
DRAWNUMBER_FIX(1,0.57,0.25,1,凈利同增率),COLORWHITE;
DRAWNUMBER_FIX(1,0.57,0.30,1,每股收益季),COLORWHITE;
DRAWNUMBER_FIX(1,0.57,0.35,1,每股現(xiàn)金流),COLORWHITE;
DRAWNUMBER_FIX(1,0.57,0.40,1,每股未分配),COLORWHITE;
DRAWNUMBER_FIX(1,0.57,0.45,1,每股公積金),COLORWHITE;
CONST(C),COLORCYAN,DOTLINE;