FBFD通达信公式 主图 源码附图
M5:MA(CLOSE,5),COLORWHITE;
M10:MA(CLOSE,10),COLORYELLOW;
M60:MA(CLOSE,60),COLORMAGENTA;
M年:MA(CLOSE,255),COLORCYAN;
X_1:=TDXDLL8(1,PERIOD,HIGH,LOW);
DRAWLINE(X_1=1,HIGH,X_1=(-1),LOW,0),DOTLINE,COLORYELLOW;
DRAWLINE(X_1=(-1),LOW,X_1=1,HIGH,0),DOTLINE,COLORYELLOW;
X_2:=TDXDLL8(2,0,0,0);
DRAWLINE(X_2=1,HIGH,X_2=(-1),LOW,0),COLORBLUE,LINETHICK2;
DRAWLINE(X_2=(-1),LOW,X_2=1,HIGH,0),COLORBLUE,LINETHICK2;
X_3:=CLOSE>REF(CLOSE,4);
X_4:=BARSLASTCOUNT(X_3);
X_5:=X_4=9;
X_6:=ISLASTBAR AND BETWEEN(X_4,5,8);
X_7:=(BACKSET(X_5>0,9) OR BACKSET(X_6>0,X_4))*X_4;
DRAWTEXT(X_7>0,HIGH*1.02,VAR2STR(X_7,0)),COLORMAGENTA;
DRAWTEXT(X_4=9,HIGH*1.02,1),COLORGREEN;
X_8:=CLOSE<REF(CLOSE,4);
X_9:=BARSLASTCOUNT(X_8);
X_10:=X_9=9;
X_11:=ISLASTBAR AND BETWEEN(X_9,5,8);
X_12:=(BACKSET(X_10>0,9) OR BACKSET(X_11>0,X_9))*X_9;
DRAWTEXT(X_12>0,LOW*0.98,VAR2STR(X_12,0)),COLORGREEN;
DRAWTEXT(X_9=9,LOW*0.98,1),COLORRED;
STICKLINE(CLOSE>=OPEN,OPEN,CLOSE,3,1),COLORLIRED;
STICKLINE(CLOSE<OPEN,OPEN,CLOSE,3,1),COLORLIGREEN;
STICKLINE(CLOSE>=OPEN,HIGH,CLOSE,0,1),COLORLIRED;
STICKLINE(CLOSE>=OPEN,LOW,OPEN,0,1),COLORLIRED;
STICKLINE(CLOSE<OPEN,HIGH,OPEN,0,1),COLORLIGREEN;
STICKLINE(CLOSE<OPEN,CLOSE,LOW,0,1),COLORLIGREEN;
X_13:=NAMELIKE(2)=1 OR NAMELIKE(3)=1 OR NAMELIKE(4)=1 OR NAMELIKE(5)=1 OR NAMELIKE(6)=1;
X_14:=CLOSE/REF(CLOSE,1)>=1.0992 OR (CLOSE/REF(CLOSE,1)>1.0495 AND X_13) AND CLOSE=HIGH AND PERIOD=5;
X_15:=REF(CLOSE,1)/CLOSE>=1.0995 OR (REF(CLOSE,1)/CLOSE>1.0495 AND X_13) AND CLOSE=LOW AND PERIOD=5;
STICKLINE(X_14,CLOSE,OPEN,2.5,0),COLORMAGENTA;
STICKLINE(X_15,CLOSE,OPEN,2.5,0),COLORLIBLUE;
未来函数检测结果如下:
该公式包含未来函数:BACKSET
解密、编写股票、期货策略请联系QQ或微信同号:88652583
相关股票指标公式
原理解析:
输出M5:收盘价的5日简单移动平均,画白色
输出M10:收盘价的10日简单移动平均,画黄色
输出M60:收盘价的60日简单移动平均,画洋红色
输出M年:收盘价的255日简单移动平均,画青色
X_1赋值:TDXDLL8(1,PERIOD,最高价,最低价)
DRAWLINE(X_1=1,最高价,X_1=(-1),最低价,0),DOTLINE,画黄色
DRAWLINE(X_1=(-1),最低价,X_1=1,最高价,0),DOTLINE,画黄色
X_2赋值:TDXDLL8(2,0,0,0)
DRAWLINE(X_2=1,最高价,X_2=(-1),最低价,0), 画蓝色, 线宽为2
DRAWLINE(X_2=(-1),最低价,X_2=1,最高价,0), 画蓝色, 线宽为2
X_3赋值:收盘价>4日前的收盘价
X_4赋值:BARSLASTCOUNT(X_3)
X_5赋值:X_4=9
X_6赋值:ISLASTBAR AND BETWEEN(X_4,5,8)
X_7赋值:(BACKSET(X_5>0,9) OR BACKSET(X_6>0,X_4))*X_4
DRAWTEXT(X_7>0,最高价*1.02,VAR2STR(X_7,0)),画洋红色
当满足条件X_4=9时,在最高价*1.02和1位置书写文字
X_8赋值:收盘价<4日前的收盘价
X_9赋值:BARSLASTCOUNT(X_8)
X_10:=X_9=9
X_11:=ISLASTBAR AND BETWEEN(X_9,5,8)
X_12:=(BACKSET(X_10>0,9) OR BACKSET(X_11>0,X_9))*X_9
DRAWTEXT(X_12>0,最低价*0.98,VAR2STR(X_12,0)),画绿色
当满足条件X_9=9时,在最低价*0.98和1位置书写文字
当满足条件收盘价>=开盘价时,在开盘价和收盘价之间画柱状线
当满足条件收盘价<开盘价时,在开盘价和收盘价之间画柱状线
当满足条件收盘价>=开盘价时,在最高价和收盘价之间画柱状线
当满足条件收盘价>=开盘价时,在最低价和开盘价之间画柱状线
当满足条件收盘价<开盘价时,在最高价和开盘价之间画柱状线
当满足条件收盘价<开盘价时,在收盘价和最低价之间画柱状线
X_13:=NAMELIKE(2)=1 OR NAMELIKE(3)=1 OR NAMELIKE(4)=1 OR NAMELIKE(5)=1 OR NAMELIKE(6)=1
X_14:=收盘价/1日前的收盘价>=1.0992 OR (收盘价/1日前的收盘价>1.0495 AND X_13) AND 收盘价=最高价 AND PERIOD=5
X_15:=1日前的收盘价/收盘价>=1.0995 OR (1日前的收盘价/收盘价>1.0495 AND X_13) AND 收盘价=最低价 AND PERIOD=5
当满足条件X_14时,在收盘价和开盘价之间画柱状线
当满足条件X_15时,在收盘价和开盘价之间画柱状线