通达信公式源码概况:
指标类别:通达信公式
授权方式: 免费版
指标评级: ★★★★★
指标分类: 策略
画线方法: 副图
M1:=8;M2:=25;M3:=12;M4:=50;
AEXP1:expma(CLOSE,M1)COLORBLUE,LINETHICK1;
AEXP2:EXPma(CLOSE,M2)COLORGREEN,LINETHICK2;
AEXP3:=EXPMA(C,M3)COLORLIGREEN,DOTLINE;
AEXP4:=EXPMA(C,M4)COLORWHITE,DOTLINE;
(MACD)副图源码
DIF1:=EMA(CLOSE,6)-EMA(CLOSE,13);
DEA1:=EMA(DIF1,5);
MACD1:=2*(DIF1-DEA1),STICK;
MACD2:EMA(MACD1,5)COLORWHITE;
蓝:STICKLINE(MACD1 MACD2ANDMACD1 0,0,MACD1,1,0),COLORBLUE;
粉:STICKLINE(MACD1 MACD2ANDMACD1 0,0,MACD1,1,1),COLORMAGENTA;
红:STICKLINE(MACD1 MACD2ANDMACD1 0,0,MACD1,1,1),COLORRED;
绿:STICKLINE(MACD1 MACD2ANDMACD1 0,0,MACD1,1,0),COLORGREEN;
A:DRAWTEXT(CROSS(粉,蓝),MACD1-0.1, 买 )COLORGREEN;
B:DRAWTEXT(CROSS(绿,红),MACD2-0.01, 卖 )COLORYELLOW;
IF(AEXP1 (REFV(AEXP1,1)),AEXP1,DRAWNULL),COLORRED,LINETHICK1;
IF(AEXP2 (REFV(AEXP2,1)),AEXP2,DRAWNULL),COLORMAGENTA,LINETHICK2;
IF(AEXP3 (REFV(AEXP3,1)),AEXP3,DRAWNULL),COLORYELLOW,DOTLINE;
IF(AEXP4 (REFV(AEXP4,1)),AEXP4,DRAWNULL),COLORLIRED,DOTLINE;
卖:=crOSS(AEXP1,AEXP2);
买:=CROSS(AEXP2,AEXP1);
DRAWTEXT(卖,AEXP1*0.995, 持股 ),COLORRED;
DRAWTEXT(买,AEXP2*1.03, 持币 ),COLORWHITE;
N:=1.03;
M5:MA(C,5);
M10:MA(C,10);
A:=BARSLAST(CROSS(M5,M10));
T:=BARSLAST(CURRBARSCOUNT=CONST(A)+1);
D:=MIN(M5,M10);
STICKLINE(T =0,REF(D,T),REF(D,T),6,0),COLORRED,LINETHICK2;
STICKLINE(T =0,REF(D*1.08,T),REF(D*1.08,T),6,-1),COLORLIMAGENTA;
STICKLINE(T =0,REF(D*0.92,T),REF(D*0.92,T),6,-1),COLORLIMAGENTA;
STICKLINE(T =0,REF(D*1.21,T),REF(D*1.21,T),6,-1),COLORGREEN;
STICKLINE(T =0,REF(D*0.79,T),REF(D*0.79,T),6,-1),COLORGREEN;
STICKLINE(T =0,REF(D*1.34,T),REF(D*1.34,T),6,-1),COLORYELLOW;
STICKLINE(T =0,REF(D*0.66,T),REF(D*0.66,T),6,-1),COLORYELLOW;
DRAWTEXT(T=0,REF(D,T)*N,VARCAT(VARCAT( 中心价: ,VAR2STR(REF(D,T),2)), 元 )),COLORWHITE;
DRAWTEXT(T=0,REF(D*1.08,T)*N,VARCAT(VARCAT( 压力1: ,VAR2STR(REF(D*1.08,T),2)), 元 ))COLORYELLOW;
DRAWTEXT(T=0,REF(D*1.21,T)*N,VARCAT(VARCAT( 压力2: ,VAR2STR(REF(D*1.21,T),2)), 元 ))COLORYELLOW;
DRAWTEXT(T=0,REF(D*1.34,T)*N,VARCAT(VARCAT( 压力3: ,VAR2STR(REF(D*1.34,T),2)), 元 ))COLORYELLOW;
DRAWTEXT(T=0,REF(D*0.92,T)*N,VARCAT(VARCAT( 支撑1: ,VAR2STR(REF(D*0.92,T),2)), 元 )),COLORMAGENTA;
DRAWTEXT(T=0,REF(D*0.79,T)*N,VARCAT(VARCAT( 支撑2: ,VAR2STR(REF(D*0.79,T),2)), 元 )),COLORMAGENTA;
DRAWTEXT(T=0,REF(D*0.66,T)*N,VARCAT(VARCAT( 支撑3: ,VAR2STR(REF(D*0.66,T),2)), 元 )),COLORMAGENTA;
STICKLINE(T=0,REF(D*0.66,T),REF(D*1.34,T),0,0),COLORRED;
公式解读:
每日通达信公式解答:
编写条件:
每日上午11:30分以前任何时候的选股公式。
编写方法:
ZTB:=IF(NAMELIKE( ST )ORNAMELIKE( *ST )ORNAMELIKE( SST )
ORNAMELIKE( S*ST )ORNAMELIKE( SST ),(C =ZTPRICE(REF(CLOSE,1),0.05)ANDC=H),
IF((CODELIKE( 688 )OR(CODELIKE( 300 )ANDDATE =1200824)),(C =ZTPRICE(REF(CLOSE,1),0.2)ANDC=H)
,(C =ZTPRICE(REF(CLOSE,1),0.1)ANDC=H)));
XG:ZTBANDFROMOPEN