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

 找回密码
 注册昵称

QQ登录

只需一步,快速开始

搜索
上一主题 下一主题

[通达信] 通达信筹码布林操盘主图指标公式源码


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

DRAWGBK(O>C,RGB(48,41,124),RGB(0,0,0),0,'1',0);
Z1:=STRCAT(HYBLOCK,'');
Z2:=STRCAT(Z1,DYBLOCK);
Z3:=STRCAT(Z2,' ');
DRAWTEXT_FIX(ISLASTBAR,0,0,0,STRCAT(Z3,GNBLOCK)),COLORRED;
{布林}
MB:=MA(CLOSE,20),COLORWHITE,COLORRED;
bbiboll:(MA(C,3)+MA(C,6)+MA(C,12)+MA(C,24))/4,COLORRED;
上极限:MB+2*STD(C,20),COLORYELLOW,DOTLINE;
下极限:MB-2*STD(C,20),COLORWHITE,DOTLINE;
强势线:MA(C,25)+MA(C,25)*20/100,COLORWHITE,DOTLINE,LINETHICK2;
{
BBIBOLL:(MA(C,3)+MA(C,6)+MA(C,12)+MA(C,24))/4,COLORRED;
UPR:BBIBOLL+6*STD(BBIBOLL,11),COLORYELLOW,DOTLINE;
DWN:BBIBOLL-6*STD(BBIBOLL,11),COLORWHITE,DOTLINE;}
{操盘线}
ZZ:=(O+H+L)/3;
庄线:EMA(ZZ,55),COLORYELLOW;
操盘线:EMA(ZZ,7),COLORWHITE;
ZLZL1:=C<操盘线;
ZLZL2:=C>=庄线;
VAR1:=CLOSE>REF(CLOSE,1) AND CLOSE>REF(CLOSE,2);
VAR2:=REF(VAR1,1) AND CLOSE<=REF(CLOSE,1) AND CLOSE>=REF(CLOSE,2);
VAR3:=REF(VAR2,1) AND CLOSE>=REF(CLOSE,1) AND CLOSE<=REF(CLOSE,2);
VAR4:=REF(VAR3,1) AND CLOSE<=REF(CLOSE,1) AND CLOSE>=REF(CLOSE,2);
VAR5:=REF(VAR4,1) AND CLOSE>=REF(CLOSE,1) AND CLOSE<=REF(CLOSE,2);
VAR6:=REF(VAR5,1) AND CLOSE<=REF(CLOSE,1) AND CLOSE>=REF(CLOSE,2);
VAR7:=REF(VAR6,1) AND CLOSE>=REF(CLOSE,1) AND CLOSE<=REF(CLOSE,2);
VAR8:=REF(VAR7,1) AND CLOSE<=REF(CLOSE,1) AND CLOSE>=REF(CLOSE,2);
VAR9:=REF(VAR8,1) AND CLOSE>=REF(CLOSE,1) AND CLOSE<=REF(CLOSE,2);
VARA:=REF(VAR9,1) AND CLOSE<=REF(CLOSE,1) AND CLOSE>=REF(CLOSE,2);
VARB:=REF(VARA,1) AND CLOSE>=REF(CLOSE,1) AND CLOSE<=REF(CLOSE,2);
VARC:=REF(VARB,1) AND CLOSE<=REF(CLOSE,1) AND CLOSE>=REF(CLOSE,2);
VARD:=CLOSE<REF(CLOSE,1) AND CLOSE<REF(CLOSE,2);
VARE:=REF(VARD,1) AND CLOSE>=REF(CLOSE,1) AND CLOSE<=REF(CLOSE,2);
VARF:=REF(VARE,1) AND CLOSE<=REF(CLOSE,1) AND CLOSE>=REF(CLOSE,2);
VAR10:=REF(VARF,1) AND CLOSE>=REF(CLOSE,1) AND CLOSE<=REF(CLOSE,2);
VAR11:=REF(VAR10,1) AND CLOSE<=REF(CLOSE,1) AND CLOSE>=REF(CLOSE,2);
VAR12:=REF(VAR11,1) AND CLOSE>=REF(CLOSE,1) AND CLOSE<=REF(CLOSE,2);
VAR13:=REF(VAR12,1) AND CLOSE<=REF(CLOSE,1) AND CLOSE>=REF(CLOSE,2);
VAR14:=REF(VAR13,1) AND CLOSE>=REF(CLOSE,1) AND CLOSE<=REF(CLOSE,2);
VAR15:=REF(VAR14,1) AND CLOSE<=REF(CLOSE,1) AND CLOSE>=REF(CLOSE,2);
VAR16:=REF(VAR15,1) AND CLOSE>=REF(CLOSE,1) AND CLOSE<=REF(CLOSE,2);
VAR17:=REF(VAR16,1) AND CLOSE<=REF(CLOSE,1) AND CLOSE>=REF(CLOSE,2);
VAR18:=REF(VAR17,1) AND CLOSE>=REF(CLOSE,1) AND CLOSE<=REF(CLOSE,2);
VAR19:=REF(VARD OR VARE OR VARF OR VAR10 OR VAR11 OR VAR12 OR VAR13 OR
VAR14 OR VAR15 OR VAR16 OR VAR17 OR VAR18,1) AND VAR1;
VAR1A:=REF(VAR1 OR VAR2 OR VAR3 OR VAR4 OR VAR5 OR VAR6 OR VAR7 OR
VAR8 OR VAR9 OR VARA OR VARB OR VARC,1) AND VARD;
DRAWICON(VAR19 AND C>操盘线,L*0.998,1);
DRAWICON(VAR1A,H*1.002,2),NODRAW;
TJ5:=REF("cci.CCI",1)<-100 AND "CCI.CCI">REF("CCI.CCI",1);
TJ6:=REF("kdj.J"(9,3,3),1)<20 AND "kdJ.J"(9,3,3)>REF( "KDJ.J"(9,3,3),1);
TJ7:=REF("rsi.RSI1",1)<20 AND "RSI.RSI1">REF("RSI.RSI1",1);
TJ8:=COUNT(TJ5,5) AND COUNT(TJ6,5) AND COUNT(TJ7,5);
大底:=crOSS(TJ8,0.5);
DRAWICON(大底,L*0.991,11);
T1:EMA(SLOPE(CLOSE,34)*20+CLOSE,75),COLORYELLOW,NODRAW;
T2:MA(C,120),COLORCYAN,LINETHICK2,NODRAW;
T3:MA(C,250),COLORGREEN,LINETHICK2,NODRAW;
乖离线:=((C-REF(T1,1))/20+T1)*1.20;
TT1:=CROSS(T1,T2) AND CROSS(T1,T3) AND V>REF(V,1);
TT2:=T1>REF(T1,2) AND V>REF(V,1) AND CROSS(C,T1);
DRAWICON((T2>=REF(T2,1) AND CROSS(C,T1) AND CROSS(C,T2) AND V>REF(V,1)),L*0.997,9);
DRAWICON(TT2,L*0.980,11);
DRAWICON(CROSS(C,乖离线) AND L!=H,H*1.003,12);
N1:=10;
N2:=3;
N3:=6;
PJJ:=DMA((((HIGH + LOW) + (CLOSE * 2)) / 4),0.9);
JJ:=REF(EMA(PJJ,3),1);
QJJ:=(vol / (((HIGH - LOW) * 2) - Abs((CLOSE - OPEN))));
XVL:=(IF((CLOSE > OPEN),(QJJ * (HIGH - LOW)),IF((CLOSE < OPEN),(QJJ * ((HIGH - OPEN) + (CLOSE - LOW))),(VOL / 2))) + IF((CLOSE > OPEN),(0 - (QJJ * ((HIGH - CLOSE) + (OPEN - LOW)))),IF((CLOSE < OPEN),(0 - (QJJ * (HIGH - LOW))),(0 - (VOL / 2)))));
ZLL:=(VOL / CAPITAL);
HSL1:=IF((ZLL > 10),10,ZLL);
HSL:=((XVL / 20) / 1.15);
攻击流量:=(((HSL * 0.55) + (REF(HSL,1) * 0.33)) + (REF(HSL,2) * 0.22));
STICKLINE(((HSL * 0.4) >= 0),((HSL/1000) * 1.0),0,1,0),COLORRED,NODRAW;
STICKLINE(((HSL * 0.4) < 0),((HSL/1000) * 1.0),0,1,0),COLORBLUE,NODRAW;
力度: (HSL / 1000),LINETHICK0,NODRAW;
A1:=SUM(力度,N1);
A2:=EMA(A1,N2);
A3:=EMA(A1,N3);
累积能量:A1,NODRAW;
bias1:(CLOSE-MA(CLOSE,6))/MA(CLOSE,6)*100,NODRAW;
买:DRAWICON(CROSS(A1,A3) AND C>操盘线,L*0.998,1),NODRAW;
卖:DRAWICON(CROSS(A3,A1) AND BIAS1>1,H*1.002,10),NODRAW;
VAR1Y:=(CLOSE-MA(CLOSE,21))/MA(CLOSE,21)*100;
VAR2Y:=(CLOSE-LLV(LOW,43))/(HHV(HIGH,43)-LLV(LOW,43))*100;
VAR3Y:=SMA(VAR2Y,2,1);
卖出:100+(-ABS(VAR1Y)),NODRAW;
预防:SMA(VAR3Y,2,1),COLORRED,LINETHICK2,NODRAW;
DRAWICON(CROSS(预防,卖出),H*1.02,2),NODRAW;
VV:=(C+L+H)/3;
DSA:=SMA(EMA(VV,2),2,1)LINETHICK2,COLORRED;
Y396:=DSA;
险1:=Y396*1.1,COLORLIRED;
险2:=Y396*1.125,COLORLIRED;
险3:=Y396*1.15,COLORLIRED;
良1:=Y396*0.9,COLORLIBLUE;
良2:=Y396*0.875,COLORLIBLUE;
良3:=Y396*0.85,COLORLIBLUE;
变色:=IF(Y396<REF(Y396,1),Y396,DRAWNULL),LINETHICK2,COLORBLUE;
WSR1:=(CLOSE-MA(CLOSE,5))/MA(CLOSE,5)*100;
WSR2:=CROSS(WSR1,5);
WSR3:=CROSS(8,WSR1);
WSR4:=CROSS(WSR1,-5);
WSR5:=CROSS(WSR1,-8);
WSR6:=WSR3;
WSR7:=WSR4 OR WSR5;
WSR8:=WSR7 AND FILTER(WSR7,5);
WSR10:DRAWICON(WSR8,L-0.01,1),NODRAW;
WSR9:=WSR6 AND FILTER(WSR6,5);
WSR11:DRAWICON(WSR9,H+0.01,10),NODRAW;
WSR12:=O<良3;
DRAWICON(WSR12 AND FILTER(WSR12,12),L-0.03,9);
W1:=C>REF(C,1) AND macd<REF(MACD,1) AND MACD>0 AND V<REF(V,1);
W2:=C>REF(C,1) AND MACD<0 AND MACD<REF(MACD,1) AND V<REF(V,1);
XG:=W1 OR W2;
VAR1AA:=AMOUNT/VOL/7;
VAR2AA:=(3*HIGH+LOW+OPEN+2*CLOSE)/7;
VAR3AA:=SUM(AMOUNT,10)/VAR1AA/7;
VAR4AA:=DMA(VAR2AA,VOL/VAR3AA);
VAR5AA:=(CLOSE-VAR4AA)/VAR4AA*100,COLORLIMAGENTA;
XG1:=CROSS(VAR5AA,MA(VAR5AA,2)) AND VAR5AA<0 AND C<(HHV(H,5)*0.88) AND REF(O>C,1) AND REF(O>C,2);
XG3:=XG AND XG1 AND L<良1;
WSR13:=O>良3 AND L<良1 OR XG3;
DRAWICON(WSR13 AND FILTER(WSR13,10),L-0.03,5);
WSR14:=H>险3;
DRAWICON(WSR14 AND FILTER(WSR14,15),H+0.03,10);
WSR15:=H<险3 AND H>险2;
DRAWICON(WSR15 AND FILTER(WSR15,5),H+0.03,4),NODRAW;
ZLCM:=EMA(WINNER(CLOSE)*70,3),NODRAW;{//主力筹码估算}
SHCM:=EMA((WINNER(CLOSE*1.1)-WINNER(CLOSE*0.9))*80,3),NODRAW;{//散户筹码估算}
ZSHTL:=SHCM/(ZLCM+SHCM)*100,NODRAW;{//散户套牢筹码比率}
ZZLKP:=ZLCM/(ZLCM+SHCM)*100,NODRAW;{//主力控盘筹码比率}
ZZLJJ:=EMA(ZZLKP,89),NODRAW;{//主力警戒}
ZJLRQD:=INTPART(ZZLKP-ZZLJJ),NODRAW;{//资金流入强度}
天界:INTPART(ZSHTL),COLORCYAN,LINETHICK2,NODRAW;
凡间:ZJLRQD,LINETHICK2,COLORRED,NODRAW;
DRAWICON(CROSS(天界,凡间),H*1.02,12);
{七道防线}
DRAwrECTREL(300,125,900,125,180);
DRAWRECTREL(300,250,900,250,180);
DRAWRECTREL(300,375,900,375,180);
DRAWRECTREL(300,500,900,500,180);
DRAWRECTREL(300,625,900,625,180);
DRAWRECTREL(300,750,900,750,180);
DRAWRECTREL(300,875,900,875,RGB(0,0,255));
{STICKLINE(C<REF(C,1),H,L,0,0),COLORCYAN;
STICKLINE(C<REF(C,1),C,O,0,0),COLORBLUE;}
DRAWTEXT_FIX(1,0.3,0.875,1,'第一防线'),COLORWHITE;
DRAWTEXT_FIX(1,0.3,0.75,1,'第二防线'),COLORWHITE;
DRAWTEXT_FIX(1,0.3,0.625,1,'第三防线'),COLORWHITE;
DRAWTEXT_FIX(1,0.3,0.5,1,'第四防线'),COLORYELLOW;
DRAWTEXT_FIX(1,0.3,0.375,1,'第五防线'),COLORYELLOW;
DRAWTEXT_FIX(1,0.3,0.25,1,'第六防线'),COLORYELLOW;
DRAWTEXT_FIX(1,0.3,0.125,1,'第七防线'),COLORYELLOW;
{变色k线}
AA:=EMA(C,3) > EMA(C,21);
BB:=EMA(C,3) < EMA(C,21);
CC:= EMA(C,3) > EMA(C,8);
CC1:=EMA(C,3) < EMA(C,8);
DD:=CLOSE<OPEN;
STICKLINE(AA,H,L,0,0),COLOR007FFF;
STICKLINE(AA,O,C,3,0),COLOR007FFF;
STICKLINE(AA AND DD,O,C,3,1),COLOR007FFF;
STICKLINE(BB,H,L,0,0),COLORGREEN;
STICKLINE(BB,O,C,3,0),COLORGREEN;
STICKLINE(BB AND DD,O,C,3,1),COLORGREEN;
STICKLINE(BB AND CC,H,L,0,1),COLORF00FF0;
STICKLINE(BB AND CC,O,C,3,0),COLORF00FF0;
STICKLINE(BB AND CC AND DD,O,C,3,1),COLORF00FF0;
STICKLINE(AA AND CC1,H,L,0,0),COLORBLUE;
STICKLINE(AA AND CC1,O,C,3,1),COLORBLUE;
STICKLINE(AA AND CC1 AND DD,O,C,3,0),COLORBLUE;
{操盘K线};
STICKLINE(ZLZL1 AND ZLZL2,H,L,0,0),COLORBLUE;
STICKLINE(ZLZL1 AND ZLZL2,O,C,3,1),COLORBLUE;
STICKLINE(TT2,O,C,3,0),COLORYELLOW;





回复

举报

QQ|

GMT+8, 2024-11-17 00:21

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