波段操作分时主图通达信公式 主图 源码 测试图
时间:=TIME=100000;
N:=BARSLAST(时间),COLOR808080;
常数:CONST(IF(N=0,C,REF(C,N))),COLOR004848,DOTLINE;
CS1:=CONST(IF(N,HHV(H,0),REF(HHV(H,0),N))),COLOR808080;
CS2:=CONST(IF(N,LLV(L,0),REF(LLV(L,0),N))),COLOR808080;
STICKLINE(时间=1,CS1,CS2,-1,0),COLOR808080;
H1:=MAX(DYNAINFO(3),DYNAINFO(5));
L1:=MIN(DYNAINFO(3),DYNAINFO(6));
P1:=H1-L1;
阻力:L1+P1*7/8,COLOR00FFFF,DOTLINE;
DRAWTEXT(CURRBARSCOUNT=1,阻力,'阻力'),COLOR00FFFF;
支撑:L1+P1*0.5/8,COLORRED,DOTLINE;
DRAWTEXT(CURRBARSCOUNT=1,支撑,'支撑'),COLORA2A2FF;
中:(支撑+阻力)/2,COLORC0C0C0,DOTLINE;
现价:CLOSE,COLORWHITE,LINETHICK1;
QZS:=(EMA(CLOSE,10)+EMA(CLOSE,32))/2;
VAR1:=(EMA(CLOSE,30)+EMA(CLOSE,72))/2;
VAR2:=(EMA(VOL,10)+EMA(VOL,32))/2;
VAR3:=(VAR1+VAR2)/2;
VAR4:=EMA(VAR3,30);
VAR5:=EMA(VAR3,60);
VAR6:=EVERY(VAR1>REF(VAR1,1),5) AND EVERY(VAR4>REF(VAR4,1),5);
DRAWBAND(VAR1,RGB(150,30,30),EMA(VAR1,60),RGB(0,110,30));
牵引线:VAR1,COLORYELLOW;
趋势关注:IF(CROSS(VAR1,EMA(VAR1,60)) AND VAR6,1,0),NODRAW,COLORRED;
量价关注:IF(CROSS(VAR3,VAR5) AND VAR6,1,0),NODRAW,COLORWHITE;
冲击量:IF(VAR3>VAR5 AND VAR6,1,0),NODRAW,COLORYELLOW;
STICKLINE(QZS>VAR1,QZS,VAR1,1,0),COLORFF00FF;
STICKLINE(冲击量=1,QZS,VAR1,1,0),COLORYELLOW;
DRAWICON(趋势关注=1,EMA(VAR1,60),13);
DRAWTEXT(量价关注=1,EMA(VAR1,60),'L0V'),COLORWHITE;
MR:=C< 支撑 AND CROSS(C,REF(C,2));
STICKLINE(CROSS(现价,支撑),C,中,2,0),COLOR00F0F0;
STICKLINE(MR=1,支撑,中,2,0),COLOR00F0F0;
DRAWICON(MR=1 OR CROSS(现价,支撑),中,34);
STICKLINE(CROSS(支撑,现价),支撑,(支撑-中)/5+支撑,2,0),COLOR00F0F0;
MC:=C>阻力 AND CROSS(REF(C,2),C);
STICKLINE(CROSS(阻力,现价),C,中,2,0),COLORFFFF00;
STICKLINE(MC=1,阻力,中,2,0),COLORFFFF00;
DRAWICON(MC=1 OR CROSS(阻力,现价),中,35);
STICKLINE(CROSS(现价,阻力),阻力,阻力-(支撑-中)/5,2,0),COLORFFFF00;
DRAWTEXT(ISLASTBAR,(支撑+阻力)/2,'中'),COLORWHITE;
均价:SUM(V*C,0)/SUM(V,0),COLOR004080,DOTLINE;
DRAWTEXT(CURRBARSCOUNT=4,均价,'均'),COLORFFFFFF,LINETHICK2;
最新:C,LINETHICK9,COLORFFFF00;
IF(C>=REF(C,1),C,DRAWNULL),LINETHICK9,COLORRED;
AA:=SUM(AMOUNT,BARSCOUNT(C))/SUM(VOL*100,BARSCOUNT(C));
BB:=BETWEEN(C/AA,C+H,C-H);
DRAWICON(ISLASTBAR AND C>REF(C,1),C,1);
DRAWICON(ISLASTBAR AND C< REF(C,1),C,2);
W:=BARSLAST(DAY-REF(DAY,1))+1;
FSJX:SUM(CLOSE*VOL,W)/SUM(VOL,W),LINETHICK2,COLORYELLOW;
IF(FSJX< REF(FSJX,1),FSJX,DRAWNULL),LINETHICK2,COLORGREEN;
未来函数检测结果如下:
该公式包含未来函数:DYNAINFO
解密、编写股票、期货策略请联系QQ或微信同号:88652583
相关股票指标公式
原理解析:
时间赋值:TIME=100000
N赋值:上次时间距今天数,COLOR808080
输出常数:CONST(IF(N=0,C,N日前的C)),COLOR004848,DOTLINE
CS1赋值:CONST(IF(N,0日内H最高值,REF(0日内H最高值,N))),COLOR808080
CS2赋值:CONST(IF(N,0日内L最低值,REF(0日内L最低值,N))),COLOR808080
当满足条件时间=1时,在CS1和CS2之间画柱状线
H1赋值:MAX(DYNAINFO(3),DYNAINFO(5))
L1赋值:MIN(DYNAINFO(3),DYNAINFO(6))
P1赋值:H1-L1
输出阻力:L1+P1*7/8,COLOR00FFFF,DOTLINE
当满足条件CURRBARSCOUNT=1时,在阻力和'阻力'位置书写文字
输出支撑:L1+P1*0.5/8,画红色,DOTLINE
当满足条件CURRBARSCOUNT=1时,在支撑和'支撑'位置书写文字
输出中:(支撑+阻力)/2,COLORC0C0C0,DOTLINE
输出现价:收盘价,COLORWHITE,LINETHICK1
QZS赋值:(收盘价的10日指数移动平均+收盘价的32日指数移动平均)/2
VAR1赋值:(收盘价的30日指数移动平均+收盘价的72日指数移动平均)/2
VAR2赋值:(成交量的10日指数移动平均+成交量的32日指数移动平均)/2
VAR3赋值:(VAR1+VAR2)/2
VAR4赋值:VAR3的30日指数移动平均
VAR5赋值:VAR3的60日指数移动平均
VAR6赋值:EVERY(VAR1>1日前的VAR1,5) AND EVERY(VAR4>1日前的VAR4,5)
DRAWBAND(VAR1,RGB(150,30,30),VAR1的60日指数移动平均,RGB(0,110,30))
输出牵引线:VAR1,COLORYELLOW
输出趋势关注:IF(CROSS(VAR1,VAR1的60日指数移动平均) AND VAR6,1,0),NODRAW,画红色
输出量价关注:IF(VAR3上穿VAR5 AND VAR6,1,0),NODRAW,COLORWHITE
如果VAR3>VAR5 AND VAR6返回1否则返回0
当满足条件QZS>VAR1时,在QZS和VAR1之间画柱状线
当满足条件冲击量=1时,在QZS和VAR1之间画柱状线
DRAWICON(趋势关注=1,VAR1的60日指数移动平均,13)
DRAWTEXT(量价关注=1,VAR1的60日指数移动平均,'L0V'),COLORWHITE
MR赋值:C< 支撑 AND CROSS(C,2日前的C)
STICKLINE(现价上穿支撑,C,中,2,0),COLOR00F0F0
当满足条件MR=1时,在支撑和中之间画柱状线
DRAWICON(MR=1 OR 现价上穿支撑,中,34)
STICKLINE(支撑上穿现价,支撑,(支撑-中)/5+支撑,2,0),COLOR00F0F0
MC赋值:C>阻力 AND CROSS(2日前的C,C)
STICKLINE(阻力上穿现价,C,中,2,0),COLORFFFF00
当满足条件MC=1时,在阻力和中之间画柱状线
DRAWICON(MC=1 OR 阻力上穿现价,中,35)
STICKLINE(现价上穿阻力,阻力,阻力-(支撑-中)/5,2,0),COLORFFFF00
DRAWTEXT(ISLASTBAR,(支撑+阻力)/2,'中'),COLORWHITE
输出均价:0的V*C日累和/0的V日累和,COLOR004080,DOTLINE
当满足条件CURRBARSCOUNT=4时,在均价和'均'位置书写文字
输出最新:C,LINETHICK9,COLORFFFF00
IF(C>=1日前的C,C,DRAWNULL),LINETHICK9,画红色
AA赋值:SUM(AMOUNT,C的有效数据周期数)/SUM(成交量*100,C的有效数据周期数)
BB赋值:BETWEEN(C/AA,C+H,C-H)
DRAWICON(ISLASTBAR AND C>1日前的C,C,1)
DRAWICON(ISLASTBAR AND C< 1日前的C,C,2)
W赋值:上次DAY-1日前的DAY距今天数+1
输出FSJX:W的收盘价*成交量日累和/W的成交量日累和,LINETHICK2,COLORYELLOW
IF(FSJX< 1日前的FSJX,FSJX,DRAWNULL),LINETHICK2,COLORGREEN