股资源-股票学习站-学炒股-股票课程-炒股教程-分析选股指标-入门基础知识

 找回密码
 注册昵称

QQ登录

只需一步,快速开始

搜索
上一主题 下一主题

[指标编写] 通达信威廉波段主图指标公式源码


    [-----复制链接-----]
楼主
 通达信源码安装路径:1,工具栏点击公式选项。2,弹出公式窗口点击新建。3,把源码复制到指标编辑器保存。4,回到K线图界面安装建立好的公式 || 2024-9-6 09:12:06

{指标介绍:
1、当KDJ中的J>K,并在"特别信号"之上时,显示红色K线;
2、当KDJ中的J<K,并在"特别信号"之上时,显示黄色K线;
3、当KDJ中的J>K,并在"特别信号"之下时,显示粉色K线;
4、当KDJ中的J<K,并在"特别信号"之下时,显示蓝色K线;
5、红色K线为多头信号,当第一次出现时显示“钱袋子”买入;
6、保留了最后10天的成交量数据,放在主图右下角,供参考。}

HGW:=DYNAINFO(3)*1,COLOR0000FF;
RSV:=(CLOSE-LLV(LOW,9))/(HHV(HIGH,9)-LLV(LOW,9))*100+50/100;
K:=SMA(RSV,3,1);
D:=SMA(K,3,1);
J:=3*K-2*D;
KK:=HGW+K/100;
DD:=HGW+D/100;
JJ:=HGW+J/100;
EE:=50/100+HGW;
AAA:=JJ>=KK AND KK>=EE;
BBB:=JJ>=KK AND KK< EE;
DDD:=JJ< KK AND KK>=EE;
EEE:=JJ< KK AND KK< EE;
STICKLINE(AAA,H,L,0,0),COLOR0000FF;
STICKLINE(BBB,H,L,0,0),COLORFF00FF;
STICKLINE(DDD,H,L,0,0),COLOR00FFFF;
STICKLINE(EEE,H,L,0,0),COLORFFFF00;
STICKLINE(AAA,CLOSE,OPEN,3.2,0),COLOR000099;
STICKLINE(AAA,CLOSE,OPEN,1.8,0),COLOR0000BB;
STICKLINE(AAA,CLOSE,OPEN,1.3,0),COLOR0000DD;
STICKLINE(AAA,CLOSE,OPEN,0.5,0),COLOR0000FF;
STICKLINE(BBB,CLOSE,OPEN,3.2,0),COLOR990099;
STICKLINE(BBB,CLOSE,OPEN,1.8,0),COLORAA00AA;
STICKLINE(BBB,CLOSE,OPEN,1.3,0),COLORDD00DD;
STICKLINE(BBB,CLOSE,OPEN,0.5,0),COLORFF00FF;
STICKLINE(DDD,C,O,3.2,0),COLOR009999;
STICKLINE(DDD,C,O,2.4,0),COLOR00BBBB;
STICKLINE(DDD,C,O,1.0,0),COLOR00DDDD;
STICKLINE(DDD,C,O,0.6,0),COLOR00FFFF;
STICKLINE(EEE,C,O,3.2,0),COLOR999900;
STICKLINE(EEE,C,O,1.6,0),COLORBBBB00;
STICKLINE(EEE,C,O,1.0,0),COLORDDDD00;
STICKLINE(EEE,C,O,0.5,0),COLORFFFF00;
LC:=REF(CLOSE,1);
rsi1:=SMA(MAX(CLOSE-LC,0),3,1)/SMA(Abs(CLOSE-LC),3,1)*100;
SELL2:=(crOSS(88,RSI1));
DRAWTEXT(SELL2,HIGH*1.02,'←卖'),COLOR00FF00;
ACB1:=C-REF(C,1);
ACB2:=100*EMA(EMA(ACB1,6),6)/EMA(EMA(ABS(ACB1),6),6);
ACB3:=IF(LLV(ACB2,2)=LLV(ACB2,7) AND COUNT(ACB2< 0,2) AND CROSS(ACB2,MA(ACB2,2)),1,0);
ACB4:=FILTER(ACB3=1,5);
红色:=BARSLASTCOUNT(AAA)=1;
DRAWTEXT(红色,LOW*0.998,'←买'),COLOR00FFFF;
DRAWICON(红色,L,9);
DRAWTEXT_FIX(1,0,0,0,HYBLOCK);
威廉波段:=100-(HHV(HIGH,34)-CLOSE)/(HHV(HIGH,34)-LLV(LOW,34))*100;
威廉风险:=IF(威廉波段>95,(100/100+HGW)-(100/100+HGW)*0.009,100/100+HGW),COLOR00FFFF,LINETHICK0;
WLDB:=IF(威廉波段< 5,(0/100+HGW)+(0/100+HGW)*0.009,0/100+HGW),COLORFFFF00,LINETHICK1;
ZGB:vol*100/HSCOL.HSCOL,NODRAW;
DRAWTEXT(ZGB-REF(ZGB,1)>50,H,'解禁日')COLORGREEN;
生命线:MA(C,30)LINETHICK1,COLORWHITE;
牛熊线:MA(C,60)LINETHICK1,COLORRED;
黄金线:(EMA(C,18)),POINTDOT,LINETHICK5,COLORYELLOW;
神奇线:MA(C,43)DOTLINE,LINETHICK1,COLORGREEN;
_10日涨跌%:=(C-REF(CLOSE,10))/REF(CLOSE,10)*100,COLORGREEN,NODRAW;
涨家数:INDEXADV,COLOR0080FF,NODRAW;
跌家数:INDEXDEC,COLORGREEN,NODRAW;
涨停:C+0.05>=(ROUND(REF(C,1)*(100+10*(2-NAMELIKE('ST'))/2))/100),COLOR0080FF,NODRAW;
跌停:C-0.05<=(ROUND(REF(C,1)*(100-10*(2-NAMELIKE('ST'))/2))/100),COLORGREEN,NODRAW;
TOTAL:=IF(PERIOD=1,5,IF(PERIOD=2,15,IF(PERIOD=3,30,IF(PERIOD=4,60,IF(PERIOD=5,240,1)))));
MTIME:=MOD(FROMOPEN,TOTAL);
CTIME:=IF(MTIME< 0.5,TOTAL,MTIME);
VV:=IF(CURRBARSCOUNT=1,VOL*TOTAL/CTIME,V);
N9:=120;
A100:=CONST(HHV(H,N9)-LLV(L,N9))/CONST(HHV(VV,N9));
B100:=CONST(LLV(L,N9))-CONST(HHV(VV,N9))*A100/8;
天数:=10;
STICKLINE(CURRBARSCOUNT=1 && (SETCODE=0 || SETCODE=1),B100+VV*A100/8,B100,-1,-1),COLOR00C0C0;
STICKLINE(C>=O AND CURRBARSCOUNT<=天数,B100+VV*A100/8,B100,3,1),COLOR3232FF;
STICKLINE(C< O AND CURRBARSCOUNT<=天数,B100+VV*A100/8,B100,3,0),COLORFFFF54;
Z1:=STRCAT(HYBLOCK,' ');
Z2:=STRCAT(Z1,FGBLOCK);
Z3:=STRCAT(Z2,DYBLOCK);
Z4:=STRCAT(Z3,' ');
DRAWTEXT_FIX(ISLASTBAR,0.00,0.99,0,STRCAT(Z4,GNBLOCK)),COLORYELLOW;
A1000:=REF(C,1);
涨停A:=IF((C-A1000)*100/A1000>=(10-0.01*100/A1000),1,0);
跌停A:=IF((A1000-C)*100/A1000>=(10-0.01*100/A1000),1,0);
涨停次数:=COUNT(涨停A,BARSSINCE(涨停A)+1);
跌停次数:=COUNT(跌停A,BARSSINCE(跌停A)+1);
DRAWNUMBER(涨停A,HIGH*1.04,涨停次数),COLORYELLOW;
DRAWNUMBER(跌停A,HIGH*1.04,跌停次数),COLORCYAN;
DRAWNUMBER_FIX(CURRBARSCOUNT=1,0.62,0.95,0,涨停次数),COLORYELLOW;
DRAWNUMBER_FIX(CURRBARSCOUNT=1,0.72,0.95,0,跌停次数),COLORCYAN;
DRAWTEXT_FIX(CURRBARSCOUNT=1,0.55,0.95,0,'上市以来共涨停:'),COLORYELLOW;
DRAWTEXT_FIX(CURRBARSCOUNT=1,0.65,0.95,0,'上市以来共跌停:'),COLORCYAN;





回复

举报

QQ|

GMT+8, 2024-11-27 23:30

快速回复 返回顶部 返回列表