通达信指标(2)-新建主图指标源码详细操作步骤(添加行业板块指标test)

Published

step 1:首先打开通达信软件,点击左上角的【功能】-【公式系统】-【公式管理器】

step 2:点击【常用指标】-【其他类型】--再点击右上角的【新建】

step 3:在公式编辑器界面,把公式粘进来,最后点击确定即可。

 

{--显示股票所属的自定义版块--}
DRAWTEXT_FIX(1,0.48,0.03,0,STRCAT('自定义板块: ',ZDBLOCK)),COLOR00FFFF;

{--显示股票所属版块--}

DRAWTEXT_FIX(ISLASTBAR,0.01,0.02,0,HYBLOCK);
DRAWTEXT_FIX(ISLASTBAR,0.01,0.06,0,DYBLOCK);
DRAWTEXT_FIX(ISLASTBAR,0.01,0.1,0,GNBLOCK);
DRAWTEXT_FIX(ISLASTBAR,0.01,0.15,0,FGBLOCK);


{--显示自定义外部数据--}

Z1:=SIGNALS_USER(2,0);


Z2:=VAR2STR(Z1,0);

Z3:=EXTERNVALUE(0,2);

DRAWTEXT(1,HIGH,Z2);
DRAWNUMBER(1,LOW,Z1);



MA1:MA(CLOSE,M1);
MA2:MA(CLOSE,M2);
MA3:MA(CLOSE,M3);
MA4:MA(CLOSE,M4);

Z5:=EXTERNVALUE(0,1);
DRAWTEXT_FIX(C>0,0.12,0.11,0,EXTERNSTR(0,1)),COLORWHITE,LINETHICK2;
DRAWTEXT_FIX(C>0,0.19,0.11,0,Z5),COLORWHITE,LINETHICK2;

step 4:在主图叠加test指标