以下是通达信横线识顶底指标公式(无源码的请下载附件导入)
MA5:MA(CLOSE,5),POINTDOT,LINETHICK4;
MA10:MA(CLOSE,10)COLORBLUE,POINTDOT,LINETHICK4;
MA20:MA(CLOSE,20)COLORRED,POINTDOT,LINETHICK3;
MA30:MA(CLOSE,30),COLORYELLOW,POINTDOT,LINETHICK3;
MA60:MA(CLOSE,60),POINTDOT,COLOR8080FF,LINETHICK4;
MA135:MA(CLOSE,135),POINTDOT,COLOR00FFFF,LINETHICK4;
MA250:MA(CLOSE,250),POINTDOT,COLORLICYAN,LINETHICK4;
DIF:=EMA(CLOSE,12)-EMA(CLOSE,26);
DEA:=EMA(DIF,9);
MACD:=(DIF-DEA)*2;
VA1:=HHVBARS(MACD,BARSLAST(MACD<0)+1);
VA2:=CROSS(BACKSET(CROSS(0,MACD) OR (ISLASTBAR AND MACD>0),REF(VA1,1)+2),0.5);
前高:=DRAWLINE(VA2,MACD,REF(VA2,1),REF(MACD,1),1),COLORWHITE;
VA3:=LLVBARS(MACD,BARSLAST(MACD>0)+1);
VA4:=CROSS(BACKSET(CROSS(MACD,0) OR (ISLASTBAR AND MACD<0),REF(VA3,1)+2),0.5);
前低:=DRAWLINE(VA4,MACD,REF(VA4,1),REF(MACD,1),1),COLORYELLOW;
X:IF(COUNT(MACD>0,BARSLAST(VA2))=BARSLAST(VA2),DRAWLINE(VA2,H,REF(VA2,1),REF(H,1),1),
DRAWNULL),COLORGREEN,LINETHICK2;
STICKLINE(MACD>0 AND C>X AND O>X,C,O,1,0),COLORRED;
STICKLINE(MACD>0 AND C>X AND O<X,C,X,1,0),COLORRED;
STICKLINE(MACD>0 AND MACD>前高,C,O,1,0),COLORYELLOW;
STICKLINE(REFX(VA2,1) OR REFX(VA4,1),C,O,1,0),COLORGREEN;
JC:=CROSS(DIF,DEA);
JTS:=BARSLAST(DIF<DEA);
SC:=CROSS(DEA,DIF);
STS:=BARSLAST(DIF>DEA);
价值低点:IF(JTS>0,DRAWLINE(JC,L,REF(JC,1),REF(L,1),1),DRAWNULL),COLORMAGENTA,LINETHICK2;
价值高点:IF(STS>0,DRAWLINE(SC,H,REF(SC,1),REF(H,1),1),DRAWNULL),COLORYELLOW,LINETHICK2;
JGGD:=DRAWLINE(SC,H,REF(SC,1),REF(H,1),1);
WW:=BARSLAST(VA4)<=REF(IF(VA4,BARSNEXT(JC),DRAWNULL),BARSLAST(VA4));
指标低点:IF(WW,DRAWLINE(VA4,L,REF(VA4,1),REF(L,1),1),DRAWNULL),COLORWHITE,LINETHICK2;
白线:=DRAWLINE(VA4,L,REF(VA4,1),REF(L,1),1);
STICKLINE(MAX(C,O)<指标低点,C,O,1,0),COLORWHITE;
STICKLINE(MAX(C,O)>指标低点 AND MIN(C,O)<指标低点,指标低点,MIN(C,O),1,0),COLORWHITE;
STICKLINE(价值低点<白线 AND MAX(C,O)>价值低点 AND MIN(C,O)<价值低点,价值低点,
MIN(C,O),1,0),COLORMAGENTA;
STICKLINE(价值低点<白线 AND MAX(C,O)<价值低点,C,O,1,0),COLORMAGENTA;
DRAWTEXT(价值低点<白线 AND O<价值低点 AND C>价值低点 AND MACD>REF(MACD,1) AND
REF(C,1)<价值低点 AND JTS>1,L*0.99,'挖坑竣事、还需确认'),COLORYELLOW;
DRAWTEXT(JC AND 价值低点>JGGD,L*0.99,'小心筑顶、红柱掩护');
DRAWTEXT(NOT(WW) AND C>价值高点 AND O<价值高点,L*0.99,'简朴骗术、时间调和');
DRAWTEXT(WW AND C>价值高点 AND O<价值高点,L*0.99,'再涨一段、留意真假'),COLORYELLOW;
DRAWTEXT_FIX(1,0.02,0.90,0,'财神705-正品标志'),COLOR00FFFF;
DRAWTEXT_FIX(1,0.00,0,0,'所属行业:')COLORCYAN;
DRAWTEXT_FIX(1,0.06,0,0,HYBLOCK),COLORWHITE;
DRAWTEXT_FIX(1,0.14,0,0,'所属地区:')COLORCYAN;
DRAWTEXT_FIX(1,0.20,0,0,DYBLOCK),COLORWHITE;
DRAWTEXT_FIX(C>0,0.0,0.05,0,STRCAT('业绩预报:',EXTERNSTR(0,3))),COLORWHITE;
DRAWTEXT_FIX(C>0,0.00,0.10,0,STRCAT('主题投资:',EXTERNSTR(0,7))),COLORRED;
DRAWTEXT_FIX(ISLASTBAR,0.65,0.8,0,HYBLOCK),COLOR00FF00;
DRAWTEXT_FIX(ISLASTBAR,0.75,0.8,0,DYBLOCK),COLOR00FFFF;
DRAWTEXT_FIX(ISLASTBAR,0.65,0.9,0,GNBLOCK),COLORYELLOW;
{以上为显示所属板块,地域,概念等};
总股本:=STRCAT(STRCAT('总股本: ',CON2STR(TOTALCAPITAL/1000000,2)),'亿');
流通盘:=STRCAT(STRCAT(' 流通盘: ',CON2STR(CAPITAL/1000000,2)),'亿');
全流通:=STRCAT(' 全流通: ',CON2STR((CAPITAL/1000000)/(TOTALCAPITAL/1000000),2));
市值:=STRCAT(STRCAT(' 流通市值: ',CON2STR((CAPITAL/1000000)*C,2)),'亿');
上市日期:=STRCAT(' 上市天数: ',CON2STR(FINANCE(42),0));
股本市值:=STRCAT('股本市值: ',STRCAT(STRCAT(STRCAT(STRCAT(总股本,流通盘),全流通),市值),上市日期));
746133611.png
|