通达信【弱转强战法】经历弱势阶段后突然强势反转的交易机会 主副图 源码
{弱转强主图源码如下}
MA5:MA(C,5),COLORWHITE;
MA10:MA(C,10),COLORYELLOW;
MA30:=MA(C,30),COLORMAGENTA;
MA60:MA(C,60),COLORGREEN;
MA120:MA(C,120),COLORBLUE;
涨停:=CLOSE>=ZTPRICE(REF(CLOSE,1),0.1);
跌停:=CLOSE<=DTPRICE(REF(CLOSE,1),0.1);
STICKLINE(涨停,O,C,3,0),COLORMAGENTA;
STICKLINE(跌停,O,C,3,0),COLORGREEN;
BK1:=STRCAT(STRSPACE(DYBLOCK),HYBLOCK);
BK2:=STRCAT(STRSPACE(BK1),GNBLOCK);
BK3:=STRCAT(STRSPACE(BK2),FGBLOCK);
BK4:=STRCAT(STRSPACE(BK3),ZHBLOCK);
HS:=100*DYNAINFO(8)/CAPITAL;
ZHWS:=STRCAT(VAR2STR(DYNAINFO(8)/10000,2),'万手');
JHS:=STRCAT('今换手:',STRCAT(VAR2STR(HS,2),'%'));
JHS1:=STRCAT(JHS,' ≈ ');
DRAWTEXT_FIX(1,0.67,0.05,0,STRCAT(JHS1,ZHWS))COLORYELLOW;
CJE:=DYNAINFO(8)*DYNAINFO(11);
DW:=IF(CJE/1000000>1,'亿','万');
AB:=IF(CJE/1000000>1,CJE/1000000,CJE/100);
DRAWTEXT_FIX(1,0.2,0.15,0,STRCAT(STRCAT('成交额:',CON2STR(AB,2)),DW))COLORYELLOW;
JJCJL:=DYNAINFO(15)/DYNAINFO(4)/100;
JJJEDW:=IF(DYNAINFO(15)>10000,'万元','元');
JJJE:=IF(DYNAINFO(15)>10000,CON2STR(DYNAINFO(15)/10000,1),CON2STR(DYNAINFO(15),1));
JJJE1:=STRCAT(JJJE,JJJEDW);
JJ:=STRCAT('竞价:',STRCAT(CON2STR(JJCJL,0),'手'));
JJ1:=STRCAT(JJ,' = ');DRAWTEXT_FIX(1,0.2,0.05,0,STRCAT(JJ1,JJJE1))COLORMAGENTA;
ZTT:=CLOSE/REF(CLOSE,1)>=1.0987;STICKLINE(ZTT,(REF(C,1)+C)/2,(REF(C,1)+C)/2,24,0);
顶部:=REFDATE(HHV(H,13),DATE);
底部:=REFDATE(LLV(L,13),DATE);
WYZHIBIAO1:=顶部-(顶部-底部)*0.191;
WYZHIBIAO2:=顶部-(顶部-底部)*0.382;
WYZHIBIAO3:=顶部-(顶部-底部)*0.5;
WYZHIBIAO4:=顶部-(顶部-底部)*0.618;
WYZHIBIAO5:=顶部-(顶部-底部)*0.809;
顶:IF(CURRBARSCOUNT<=30,REFDATE(顶部,DATE),DRAWNULL),COLORGREEN,DOTLINE;
L618:IF(CURRBARSCOUNT<=30,REFDATE(WYZHIBIAO4,DATE),DRAWNULL),COLORBROWN,DOTLINE;
底:IF(CURRBARSCOUNT<=30,REFDATE(底部,DATE),DRAWNULL),COLORCYAN,DOTLINE;
DRAWTEXT(CURRBARSCOUNT=30,顶部*0.99,' 实顶'),COLORGREEN;
DRAWTEXT(CURRBARSCOUNT=30,L618*0.99,' 高抛低吸'),COLORBROWN;
DRAWTEXT(CURRBARSCOUNT=30,底部*0.99,' 启动点'),COLORCYAN;
VAR0:=SMA(MAX(CLOSE-REF(C,1),0),12,1)/SMA(ABS(CLOSE-REF(C,1)),15,1)*100;
DRAWTEXT(CROSS(82,VAR0),L*1.0,'←跑'),COLORWHITE;
JH:=SMA(MAX(C-REF(C,1),0),5,1)/SMA(ABS(C-REF(C,1)),5,1)*100;
DRAWICON(CROSS(84,JH),H*1.02,6);
字:=STRCAT(STRCAT(STRCAT(STRCAT('名称: ',STKNAME),' 代码: '),CODE),' ' );
板块:=STRCAT('概念板块: ',GNBLOCK);
DRAWTEXT_FIX(ISLASTBAR,0,0,0,STRCAT(字,板块)),COLORYELLOW;
YC:=REF(CLOSE,1);
止损价位:=(YC*1.0035*97+0.2)/99.65;
DRAWTEXT_FIX(C!=0,0.2,0.1,0,STRCAT('止损价位 ',STRCAT(CON2STR(止损价位,2),' 元'))),COLORBLUE;
E:=(HIGH+LOW+OPEN+2*CLOSE)/5;
明日阻力:=2*E-LOW;
明日支撑:=2*E-HIGH;
明日突破:=E+(HIGH-LOW);
明日反转:=E-(HIGH-LOW);
今日阻力:=REF(明日阻力 , 1);
今日支撑:=REF(明日支撑 , 1);
DRAWTEXT_FIX(C!=0,0,0.05,0,STRCAT('今日阻力:',STRCAT(CON2STR(今日阻力,2),' 元'))),COLORFFFF00;
DRAWTEXT_FIX(C!=0,0,0.1,0,STRCAT('今日支撑:',STRCAT(CON2STR(今日支撑,2),' 元'))),COLORRED;
DRAWTEXT_FIX(C!=0,0,0.15,0,STRCAT('明日突破:',STRCAT(CON2STR(明日突破,2),' 元'))),COLORFF00FF;
DRAWTEXT_FIX(C!=0,0,0.2,0,STRCAT('明日阻力:',STRCAT(CON2STR(明日阻力,2),' 元'))),COLORFFFF00;
DRAWTEXT_FIX(C!=0,0,0.25,0,STRCAT('明日支撑:',STRCAT(CON2STR(明日支撑,2),' 元'))),COLORRED;
DRAWTEXT_FIX(C!=0,0,0.3,0,STRCAT('明日反转:',STRCAT(CON2STR(明日反转,2),' 元'))),COLORYELLOW;
A:=HHV(HIGH,13)=HIGH AND HIGH>REF(HIGH,1);
A1:=FILTER(A,12);
B:=LLV(LOW,13)=LOW AND LOW< REF(LOW,1);
B1:=FILTER(B,12);
TS1:=BARSLAST(A1);
箱顶:REF(HIGH,TS1),COLORFF00FF,NODRAW;
STICKLINE(1,箱顶,箱顶,1.5,0),COLOR00CCCC;
TS2:=BARSLAST(B1);
箱底:REF(LOW,TS2),COLORWHITE,NODRAW;
STICKLINE(1,箱底,箱底,2,0),COLORWHITE;
箱高:100*(箱顶-箱底)/箱底,NODRAW;
均价:=(3*C+H+L+O)/6;
VAR1:=(8*均价+7*REF(均价,1)+6*REF(均价,2)+5*REF(均价,3)+ 4*REF(均价,4)+3*REF(均价,5)+2*REF(均价,6)+REF(均价,8))/36;
VAR2:=(LLV(VAR1,2)+LLV(VAR1,4)+LLV(VAR1,6))/3;
吾1:=REF(VAR1,1)=REF(VAR2,1) AND VAR1>VAR2 AND CLOSE>VAR1;
吾2:=VAR1>VAR2 AND VAR1>REF(VAR1,1) AND VAR2>REF(VAR2,1) AND H/VAR1< 1.1 AND L>VAR2 AND CLOSE>VAR1;
吾3:=VAR1>VAR2 AND VAR1>REF(VAR1,1) AND VAR2>=REF(VAR2,1) AND H/VAR1>1.1;
吾4:=VAR1>VAR2 AND VAR1>REF(VAR1,1) AND VAR2>REF(VAR2,1) AND CLOSE>VAR2 AND CLOSE< VAR1;
吾5:=(VAR1>VAR2 AND VAR2>REF(VAR2,1) AND VAR1<>REF(VAR1,1) AND CLOSE<VAR2) OR (VAR1>VAR2 AND VAR1<REF(VAR1,1) AND VAR2< REF(VAR2,1) AND CLOSE<VAR2);
吾6:=REF(VAR1,1)>REF(VAR2,1) AND VAR1=VAR2 AND CLOSE< VAR2;
友1:=VAR1=VAR2 AND CLOSE< VAR2 OR (VAR1< REF(VAR1,1) AND VAR2< REF(VAR2,1) AND REF(VAR1,1)=REF(VAR2,1) AND CLOSE< VAR2);
友2:=VAR1=VAR2 AND CLOSE>VAR1;
SAT:=(AMOUNT/C)/(HHV(AMOUNT,20)/HHV(C,20));
量能饱和度:=IF(SAT>1,1,SAT)*100;
DRAWTEXT_FIX(BARSTATUS=2 AND 吾1,0.5,0.05,0,'调整结束短线介入'),COLORRED;
DRAWTEXT_FIX(BARSTATUS=2 AND 吾2,0.5,0.05,0,'上升通道走势良好'),COLORRED;
DRAWTEXT_FIX(BARSTATUS=2 AND 吾3,0.5,0.05,0,'股价偏离注意调整'),COLORRED;
DRAWTEXT_FIX(BARSTATUS=2 AND 吾4,0.5,0.05,0,'上升通道调整洗盘'),COLORGREEN;
DRAWTEXT_FIX(BARSTATUS=2 AND 吾5,0.5,0.05,0,'转向特征注意离场'),COLORGREEN;
DRAWTEXT_FIX(BARSTATUS=2 AND 吾6,0.35,0.05,0,'通道改变坚决离场'),COLORGREEN;
DRAWTEXT_FIX(BARSTATUS=2 AND 友1,0.5,0.05,0,'下跌通道只宜观望'),COLORGREEN;
DRAWTEXT_FIX(BARSTATUS=2 AND 友2,0.5,0.05,0,'短期底部准备进入'),COLORYELLOW;
{弱转强副图源码如下}
CC1:CCI(25),COLORSTICK,COLOR40FF00;
DRAWICON(CROSS(200,CCI),250,2);
DRAWICON(CROSS(CCI,-200),-250,1);
转强:CCI>0,COLOR0000D5,NODRAW;
STICKLINE(CCI>0,0,CCI,2,0),COLOR0000D5;
弱转强:CROSS(CCI,-200) AND CCI>REF(CCI,1),COLOR00DFDF,NODRAW;
STICKLINE(CROSS(CCI,-200) AND CCI>REF(CCI,1),CCI,0,2,0),COLOR00DFDF;
强转弱:CROSS(200,CCI) AND CCI<REF(CCI,1),COLOR00CA00,NODRAW;
STICKLINE(CROSS(200,CCI) AND CCI<REF(CCI,1),0,CCI,2,0),COLOR00CA00;
生命CCI线:CCI(84),COLORWHITE,LINETHICK1;
DBX:-100.00,COLORYELLOW,LINETHICK2;
JJX:300.00,COLORWHITE,LINETHICK2;
SMX:100.00,COLORRED,LINETHICK2;
NOTEXT1:200,COLORYELLOW,LINETHICK1;
NOTEXT2:-200,COLORMAGENTA,LINETHICK1;
NOTEXT3:100,COLORGREEN,LINETHICK1;
DRAWTEXT(CROSS(生命CCI线,DBX),DBX,'★准备买'),COLORRED;
DRAWTEXT(CROSS(生命CCI线,JJX),JJX,'★风险'),COLORRED;
DRAWTEXT(CROSS(生命CCI线,SMX),SMX,'★强'),COLORMAGENTA;
未来函数检测结果如下:
该公式包含未来函数:CAPITAL
该公式包含未来函数:DYNAINFO
解密、编写股票、期货策略请联系QQ或微信同号:88652583
相关股票指标公式
原理解析:
输出{弱转强主图源码如下}MA5:C的5日简单移动平均,COLORWHITE
输出MA10:C的10日简单移动平均,COLORYEL最低价
MA30赋值:C的30日简单移动平均,COLORMAGENTA
输出MA60:C的60日简单移动平均,COLORGREEN
输出MA120:C的120日简单移动平均,COLORBLUE
涨停赋值:CLOSE>=ZTPRICE(1日前的CLOSE,0.1)
跌停赋值:CLOSE<=DTPRICE(1日前的CLOSE,0.1)
当满足条件涨停时,在O和C之间画柱状线
当满足条件跌停时,在O和C之间画柱状线
BK1赋值:STRCAT(STRSPACE(DYBLOCK),HYBLOCK)
BK2赋值:STRCAT(STRSPACE(BK1),GNBLOCK)
BK3赋值:STRCAT(STRSPACE(BK2),FGBLOCK)
BK4赋值:STRCAT(STRSPACE(BK3),ZHBLOCK)
HS赋值:100*DYNAINFO(8)/CAPITAL
ZHWS赋值:STRCAT(VAR2STR(DYNAINFO(8)/10000,2),'万手')
JHS赋值:STRCAT('今换手:',STRCAT(VAR2STR(HS,2),'%'))
JHS1:=STRCAT(JHS,' ≈ ')
DRAWTEXT_FIX(1,0.67,0.05,0,STRCAT(JHS1,ZHWS))COLORYEL最低价
CJE赋值:DYNAINFO(8)*DYNAINFO(11)
如果CJE/1000000>1返回'亿'否则返回'万'
如果CJE/1000000>1返回CJE/1000000否则返回CJE/100
DRAWTEXT_FIX(1,0.2,0.15,0,STRCAT(STRCAT('成交额:',CON2STR(AB,2)),DW))COLORYEL最低价
JJCJL赋值:DYNAINFO(15)/DYNAINFO(4)/100
JJJEDW赋值:IF(DYNAINFO(15)>10000,'万元','元')
JJJE赋值:IF(DYNAINFO(15)>10000,CON2STR(DYNAINFO(15)/10000,1),CON2STR(DYNAINFO(15),1))
JJJE1:=STRCAT(JJJE,JJJEDW)
JJ赋值:STRCAT('竞价:',STRCAT(CON2STR(JJCJL,0),'手'))
JJ1:=STRCAT(JJ,' = ')
DRAWTEXT_FIX(1,0.2,0.05,0,STRCAT(JJ1,JJJE1))COLORMAGENTA
ZTT赋值:CLOSE/1日前的CLOSE>=1.0987
STICKLINE(ZTT,(1日前的C+C)/2,(1日前的C+C)/2,24,0)
顶部赋值:REFDATE(13日内H最高值,DATE)
底部赋值:REFDATE(13日内L最低值,DATE)
WYZHIBIAO1赋值:顶部-(顶部-底部)*0.191
WYZHIBIAO2赋值:顶部-(顶部-底部)*0.382
WYZHIBIAO3赋值:顶部-(顶部-底部)*0.5
WYZHIBIAO4赋值:顶部-(顶部-底部)*0.618
WYZHIBIAO5赋值:顶部-(顶部-底部)*0.809
输出顶:IF(CURRBARSCOUNT<=30,REFDATE(顶部,DATE),DRAWNULL),COLORGREEN,DOTLINE
输出L618:IF(CURRBARSCOUNT<=30,REFDATE(WYZHIBIAO4,DATE),DRAWNULL),COLORBROWN,DOTLINE
输出底:IF(CURRBARSCOUNT<=30,REFDATE(底部,DATE),DRAWNULL),COLORCYAN,DOTLINE
当满足条件CURRBARSCOUNT=30时,在顶部*0.99和' 实顶'位置书写文字
当满足条件CURRBARSCOUNT=30时,在L618*0.99和' 高抛低吸'位置书写文字
当满足条件CURRBARSCOUNT=30时,在底部*0.99和' 启动点'位置书写文字
VAR0赋值:SMA(CLOSE-1日前的C和0较大值,12,1)/SMA(CLOSE-1日前的C的绝对值,15,1)*100
DRAWTEXT(82上穿VAR0,L*1.0,'←跑'),COLORWHITE
JH赋值:SMA(C-1日前的C和0较大值,5,1)/SMA(C-1日前的C的绝对值,5,1)*100
DRAWICON(84上穿JH,H*1.02,6)
字:=STRCAT(STRCAT(STRCAT(STRCAT('名称: ',STKNAME),' 代码: '),CODE),' ' )
板块:=STRCAT('概念板块: ',GNBLOCK)
DRAWTEXT_FIX(ISLASTBAR,0,0,0,STRCAT(字,板块)),COLORYEL最低价
YC赋值:1日前的CLOSE
止损价位赋值:(YC*1.0035*97+0.2)/99.65
DRAWTEXT_FIX(C!=0,0.2,0.1,0,STRCAT('止损价位 ',STRCAT(CON2STR(止损价位,2),' 元'))),COLORBLUE
E赋值:(最高价+最低价+OPEN+2*CLOSE)/5
明日阻力赋值:2*E-最低价
明日支撑赋值:2*E-最高价
明日突破赋值:E+(最高价-最低价)
明日反转赋值:E-(最高价-最低价)
今日阻力赋值: 1日前的明日阻力
今日支撑赋值: 1日前的明日支撑
DRAWTEXT_FIX(C!=0,0,0.05,0,STRCAT('今日阻力:',STRCAT(CON2STR(今日阻力,2),' 元'))),COLORFFFF00
DRAWTEXT_FIX(C!=0,0,0.1,0,STRCAT('今日支撑:',STRCAT(CON2STR(今日支撑,2),' 元'))),COLORRED
DRAWTEXT_FIX(C!=0,0,0.15,0,STRCAT('明日突破:',STRCAT(CON2STR(明日突破,2),' 元'))),COLORFF00FF
DRAWTEXT_FIX(C!=0,0,0.2,0,STRCAT('明日阻力:',STRCAT(CON2STR(明日阻力,2),' 元'))),COLORFFFF00
DRAWTEXT_FIX(C!=0,0,0.25,0,STRCAT('明日支撑:',STRCAT(CON2STR(明日支撑,2),' 元'))),COLORRED
DRAWTEXT_FIX(C!=0,0,0.3,0,STRCAT('明日反转:',STRCAT(CON2STR(明日反转,2),' 元'))),COLORYEL最低价
A赋值:13日内最高价最高值=最高价 AND 最高价>1日前的最高价
A1:=A的12过滤
B赋值:13日内最低价最低值=最低价 AND 最低价< 1日前的最低价
B1:=B的12过滤
TS1赋值:上次A1距今天数
箱输出顶:TS1日前的最高价,COLORFF00FF,NODRAW
当满足条件1时,在箱顶和箱顶之间画柱状线
TS2赋值:上次B1距今天数
箱输出底:TS2日前的最低价,COLORWHITE,NODRAW
当满足条件1时,在箱底和箱底之间画柱状线
输出箱高:100*(箱顶-箱底)/箱底,NODRAW
均价赋值:(3*C+H+L+O)/6
VAR1:=(8*均价+7*1日前的均价+6*2日前的均价+5*3日前的均价+ 4*4日前的均价+3*5日前的均价+2*6日前的均价+8日前的均价)/36
VAR2:=(2日内VAR1最低值+4日内VAR1最低值+6日内VAR1最低值)/3
吾1赋值:1日前的VAR1=1日前的VAR2 AND VAR1>VAR2 AND CLOSE>VAR1
吾2赋值:VAR1>VAR2 AND VAR1>1日前的VAR1 AND VAR2>1日前的VAR2 AND H/VAR1< 1.1 AND L>VAR2 AND CLOSE>VAR1
吾3赋值:VAR1>VAR2 AND VAR1>1日前的VAR1 AND VAR2>=1日前的VAR2 AND H/VAR1>1.1
吾4赋值:VAR1>VAR2 AND VAR1>1日前的VAR1 AND VAR2>1日前的VAR2 AND CLOSE>VAR2 AND CLOSE< VAR1
吾5赋值:(VAR1>VAR2 AND VAR2>1日前的VAR2 AND VAR1<>1日前的VAR1 AND CLOSEVAR2 AND VAR1<1日前的VAR1 AND VAR2< 1日前的VAR2 AND CLOSE吾6赋值:1日前的VAR1>1日前的VAR2 AND VAR1=VAR2 AND CLOSE< VAR2
友1赋值:VAR1=VAR2 AND CLOSE< VAR2 OR (VAR1< 1日前的VAR1 AND VAR2< 1日前的VAR2 AND 1日前的VAR1=1日前的VAR2 AND CLOSE< VAR2)
友2赋值:VAR1=VAR2 AND CLOSE>VAR1
SAT:=(AMOUNT/C)/(20日内AMOUNT最高值/20日内C最高值)
如果SAT>1返回1否则返回SAT
当满足条件BARSTATUS=2 AND 吾1时,在横轴0.5纵轴0.05位置书写文字
当满足条件BARSTATUS=2 AND 吾2时,在横轴0.5纵轴0.05位置书写文字
当满足条件BARSTATUS=2 AND 吾3时,在横轴0.5纵轴0.05位置书写文字
当满足条件BARSTATUS=2 AND 吾4时,在横轴0.5纵轴0.05位置书写文字
当满足条件BARSTATUS=2 AND 吾5时,在横轴0.5纵轴0.05位置书写文字
当满足条件BARSTATUS=2 AND 吾6时,在横轴0.35纵轴0.05位置书写文字
当满足条件BARSTATUS=2 AND 友1时,在横轴0.5纵轴0.05位置书写文字
当满足条件BARSTATUS=2 AND 友2时,在横轴0.5纵轴0.05位置书写文字
{弱转强副图源码如下}CC1:CCI(25),COLORSTICK,COLOR40FF00
DRAWICON(200上穿CCI,250,2)
DRAWICON(CCI上穿-200,-250,1)
输出转强:CCI>0,COLOR0000D5,NODRAW
当满足条件CCI>0时,在0和CCI之间画柱状线
弱输出转强:CCI上穿-200 AND CCI>1日前的CCI,COLOR00DFDF,NODRAW
STICKLINE(CCI上穿-200 AND CCI>1日前的CCI,CCI,0,2,0),COLOR00DFDF
输出强转弱:200上穿CCI AND CCI<1日前的CCI,COLOR00CA00,NODRAW
STICKLINE(200上穿CCI AND CCI<1日前的CCI,0,CCI,2,0),COLOR00CA00
输出生命CCI线:CCI(84),COLORWHITE,LINETHICK1
DBX:-100.00,COLORYEL最低价,LINETHICK2
JJX:300.00,COLORWHITE,LINETHICK2
输出SMX:100.00,COLORRED,LINETHICK2
NOTEXT1:200,COLORYEL最低价,LINETHICK1
NOTEXT2:-200,COLORMAGENTA,LINETHICK1
NOTEXT3:100,COLORGREEN,LINETHICK1
DRAWTEXT(生命CCI线上穿DBX,DBX,'★准备买'),COLORRED
DRAWTEXT(生命CCI线上穿JJX,JJX,'★风险'),COLORRED
DRAWTEXT(生命CCI线上穿SMX,SMX,'★强'),COLORMAGENTA