当前位置: 网站首页 > 股票软件公式 > 通达信公式 > 文章 当前位置: 通达信公式 > 文章

通达信源码:布局,macd叠加,短线布局

点击: 次    来源:顶尖财经    作者:股市狙击 - 小 + 大

1、布局

把《提前布局》公式修改优化。
同时增加了几条线,使趋势更加明显。
因看盘需要我自己改了名称,
 
下面说一下我对改指标的理解。
 
一、当“底”线低于0时,指标画出红色柱状线,此时可以视为第一介入时机。{绿色箭头标识的地方}
二、“买”点提示,视为底部确认点。{图中黄色箭头标识的}
三、上涨趋势成立,当指标中G3\G6\G8形成多头,即是上涨阶段。{图中黄线、洋红线和绿线,即红色箭头和方框标识的地方}
四、高点预警提示,当涨幅达到一定程度时,会在指标蓝色柱上方出现绿色柱头,提示高位预警。{图中黄圈位置}
 
注:本人使用该指标是在60分钟周期,同时参考日线走势,请大家在使用过程中根据自己的喜好酌情操作。
 
另,图中洋红色指示点为倍量阳线,作为盘中量能的参考。

{布局副图}
LC:=REF(CLOSE,1);
RSI5:=((SMA(MAX((CLOSE - LC),0),5,1) / SMA(ABS((CLOSE - LC)),5,1)) * 100);
TTR:=SUM(MAX(MAX((HIGH - LOW),ABS((HIGH - REF(CLOSE,1)))),ABS((LOW - REF(CLOSE,1)))),10);
HD:=(HIGH - REF(HIGH,1));
LD:=(REF(LOW,1) - LOW);
DMP:=SUM(IF(((HD > 0) AND (HD > LD)),HD,0),10);
DMM:=SUM(IF(((LD > 0) AND (LD > HD)),LD,0),10);
PDI:=((DMP * 100) / TTR);
MDI:=((DMM * 100) / TTR);
ADX:=MA(((ABS((MDI - PDI)) / (MDI + PDI)) * 100),5);
AV:=(RSI5 + ADX);
DXR:=(((ADX + REF(ADX,5)) / 2) + RSI5);
{0,COLORFF00FF;}
WR10:=((100 * (HHV(HIGH,10) - CLOSE)) / (HHV(HIGH,10) - LLV(LOW,10)));
NEWVOL:=(RSI5 - WR10);
底:(AV + NEWVOL);
底5:MA(底,5),COLORGRAY;
STICKLINE((底>= 0),0,底,0.3,1),LINETHICK2,COLORCC6600;
STICKLINE((底< 0),0,底,0.8,1),LINETHICK6,COLORRED;
趋势线:=LLV(底,1),COLORFFFFFF;
STICKLINE((趋势线 >230 ),250,趋势线,0.8,1),LINETHICK6,COLORGREEN;
AA:=REF(CLOSE,1);
BBB:=SMA(MAX(CLOSE-AA,0),21,1)/SMA(ABS(CLOSE-AA),21,1)*1000;
HHH:=BBB-LLV(BBB,27);
CCC:=LLV(BBB,27)-BBB;
WWW58188COM:=LLV(BBB,27)-BBB;
SS:=(MA(CCC,2)*3+CCC*13)/16;
G3:MA(HHH,3),COLORYELLOW;
G6:MA(HHH,6),COLORMAGENTA;
G8:MA(HHH,8),LINETHICK1,COLORGREEN;{原值 5}
QQ:=(MA(HHH,5)*3+HHH*13)/16,COLORYELLOW,LINETHICK1,DOTLINE;{原值 2}
MM:=MA(CCC,5);
WW:=IF(QQ<G8 ,SS,MM);
EE:=IF(SS<MM ,G8,QQ);
买:IF(EE-WW<5.6,120,0),COLORRED;
博:IF(EE-WW<5.6 AND G8<20,180,0),COLORYELLOW;
DRAWICON(QQ<=0,200,1);
200,DOTLINE;
量:=V/REF(V,1)>1.8;
倍量:IF((G6>G8 OR (G8<50 AND G3>G6 AND G6>REF(G6,1))) AND G3>REF(G3,1) AND 底5>REF(底5,1) AND 量,200,0),COLORMAGENTA,LINETHICK2;



2、macd叠加

因画线显示有未来,不影响信号( 顶尖财经 股票学院: http://www.58188.com )  
使用方法:
热点板块选股   k线选择60线上附近,macd金叉,出信号 关注

{MACD叠加}
M:=30;
DIF:=EMA(CLOSE,12)-EMA(CLOSE,26);
DEA:=EMA(DIF,9);
MACD:=(DIF-DEA)*2;
OBVH:=CONST(HHV(OBV,FROMOPEN));
OBVL:=CONST(LLV(OBV,FROMOPEN));
DIFH:=CONST(HHV(DIF,FROMOPEN));
DIFL:=CONST(LLV(DIF,FROMOPEN));
X:=(OBVH-OBVL)/(DIFH-DIFL); 
XBASE:=(OBVH+OBVL)/2;
XDIF:DIF*X+XBASE,COLORWHITE;
XDEA:EMA(XDIF,9),COLORYELLOW;
XMACD:=MACD*X;
STICKLINE(XMACD>0,XBASE,XMACD+XBASE,0,1),COLORRED,LINETHICK2;
STICKLINE(XMACD<0,XBASE,XMACD+XBASE,0,1),COLORFFFF00,LINETHICK2;
VA:=IF(CLOSE>REF(CLOSE,1),VOL,-VOL);
OBV:SUM(IF(CLOSE=REF(CLOSE,1),0,VA),0)COLORGRAY;
MAOBV:MA(OBV,M),DOTLINE,COLORLIRED;
N:=10;
A1:=REF(OBV,N)=HHV(OBV,2*N+1);
B1:=FILTER(A1,N);
C1:=BACKSET(B1,N+1);
D1:=FILTER(C1,N);
T线:REF(OBV,BARSLAST(D1)),COLORFF6600,NODRAW;
STICKLINE(C>0,T线,T线,6,0),COLORFF6600;
DRAWICON(CROSS(OBV,T线),T线*0.99,1);



3、短线布局

LC:=REF(CLOSE,1);
RSI5:=((SMA(MAX((CLOSE - LC),0),5,1) / SMA(ABS((CLOSE - LC)),5,1)) * 100);
TTR:=SUM(MAX(MAX((HIGH - LOW),ABS((HIGH - REF(CLOSE,1)))),ABS((LOW - REF(CLOSE,1)))),10);
HD:=(HIGH - REF(HIGH,1));
LD:=(REF(LOW,1) - LOW);
DMP:=SUM(IF(((HD > 0) AND (HD > LD)),HD,0),10);
DMM:=SUM(IF(((LD > 0) AND (LD > HD)),LD,0),10);
PDI:=((DMP * 100) / TTR);
MDI:=((DMM * 100) / TTR);
ADX:=MA(((ABS((MDI - PDI)) / (MDI + PDI)) * 100),5);
AV:=(RSI5 + ADX);
DXR:=(((ADX + REF(ADX,5)) / 2) + RSI5);
{0,COLORFF00FF;}
WR10:=((100 * (HHV(HIGH,10) - CLOSE)) / (HHV(HIGH,10) - LLV(LOW,10)));
NEWVOL:=(RSI5 - WR10);
底:=(AV + NEWVOL),VOLSTICK;
底5:=MA(底,5),COLORGRAY;
趋势线:=LLV(底,1),COLORFFFFFF;
STICKLINE((趋势线 >230 ),250,趋势线,0.8,1),LINETHICK6,COLORGREEN;
AA:=REF(CLOSE,1);
BBB:=SMA(MAX(CLOSE-AA,0),21,1)/SMA(ABS(CLOSE-AA),21,1)*1000;
HHH:=BBB-LLV(BBB,27);
CCC:=LLV(BBB,27)-BBB;
SS:=(MA(CCC,2)*3+CCC*13)/16;
G3:MA(HHH,3),COLORYELLOW;
G6:=MA(HHH,6),COLORMAGENTA;
G8:=MA(HHH,8),LINETHICK1,COLORGREEN;{原值 5}
QQ:=(MA(HHH,5)*3+HHH*13)/16,COLORYELLOW,LINETHICK1,DOTLINE;{原值 2}
MM:=MA(CCC,5);
WW:=IF(QQ<G8 ,SS,MM);
EE:=IF(SS<MM ,G8,QQ);
实量:=V,COLORYELLOW,NODRAW;
成交量额:=(AMOUNT+V)/2,VOLSTICK;
量:=V/REF(V,1)>1.8;
净VAR1:=VOL/((HIGH-LOW)*2-ABS(CLOSE-OPEN));
买盘:=IF(CLOSE>OPEN,净VAR1*(HIGH-LOW),IF(CLOSE<OPEN,净VAR1*((HIGH-OPEN)+(CLOSE-LOW)),VOL/2)),COLORRED,NODRAW;
卖盘:=-IF(CLOSE>OPEN,0-净VAR1*((HIGH-CLOSE)+(OPEN-LOW)),IF(CLOSE<OPEN,0-净VAR1*(HIGH-LOW),0-VOL/2)),COLORGREEN,NODRAW;
净买:=(买盘-卖盘),VOLSTICK;
VAR2:=(HIGH-LOW);
VAR3:=ABS((OPEN-CLOSE));
VAR4:=(HIGH-IF((CLOSE>OPEN),CLOSE,OPEN));
VAR5:=(IF((CLOSE>OPEN),OPEN,CLOSE)-LOW);
VAR6:=((VAR3/VAR2)*VOL);
VAR7:=((VAR4/VAR2)*VOL);
VAR8:=((VAR5/VAR2)*VOL);
VAR9:=IF(((VOL/CAPITAL) >0.001),1,EXP(ABS(LOG(((VOL/CAPITAL)*100)))));  
VARA:=(((CLOSE-MA(CLOSE,5))/MA(CLOSE,5))*100);  
进QQ:=VAR6>=VAR7 AND VAR6>= VAR8 AND CLOSE<OPEN;
进MMM:=CLOSE<EMA(CLOSE,5) AND 进QQ;
进JJJ:=CLOSE>=EMA(CLOSE,5) AND 进QQ;
进JJ:=VAR6>=VAR7 AND VAR6>=VAR8 AND CLOSE>OPEN;
进XX:=VAR8>VAR6 AND VAR8>VAR7;
进MM:=VAR7>VAR6 AND VAR7>VAR8;
量AA:=VOL/((HIGH-LOW)*2-ABS(CLOSE-OPEN));
买量:=IF(CLOSE>OPEN,量AA*(HIGH-LOW),IF(CLOSE<OPEN,量AA*((HIGH-OPEN)+ (CLOSE-LOW)),VOL/2));
卖量:=IF(CLOSE>OPEN,0-量AA*((HIGH-CLOSE)+(OPEN-LOW)),IF(CLOSE<OPEN,0- 量AA*(HIGH-LOW),0-VOL/2));
进出量:买量+卖量,NODRAW;
净量:进出量+卖量,NODRAW;
昨日净量:=REF(净量,1);
净量比:进出量/净量,COLORMAGENTA,NODRAW;
额:=AMOUNT/100000000,VOLSTICK,COLORFF00FF;
额VAR1:=AMOUNT/((HIGH-LOW)*2-ABS(CLOSE-OPEN));
流入亿:=IF(CLOSE>OPEN,额VAR1*(HIGH-LOW),IF(CLOSE<OPEN,额VAR1*((HIGH-OPEN)+(CLOSE-LOW)),AMOUNT/2))/100000000,COLORRED,NODRAW;
流出亿:=IF(CLOSE>OPEN,0-额VAR1*((HIGH-CLOSE)+(OPEN- LOW)),IF(CLOSE<OPEN,0-额VAR1*(HIGH-LOW),0-AMOUNT/2))/100000000,COLORMAGENTA,NODRAW;
差亿:=流入亿+流出亿,COLORFFFF00,NODRAW;
净:=EMA(EMA(差亿,2),2),COLOR00FFFF,NODRAW;
WWW58188COM:=EMA(净,2);
净1:=EMA(净,2);
流:=EMA(净1,7);
净流:3*EMA(净1+流,2),COLORRED,NODRAW;
五日量额比:成交量额/REF(MA(成交量额,5),1),COLORMAGENTA,NODRAW;
跌停:=C<=DTPRICE(REF(CLOSE,1),0.097);
STICKLINE((底>=0) AND 净买>=0,0,底,0.6,0),LINETHICK2,COLORYELLOW;
STICKLINE(进出量<0 AND 净买<0,0,底,3.2,0),COLOR006600;
STICKLINE(进出量<0 AND 净买<0,0,底,2.6,0),COLOR008800;
STICKLINE(进出量<0 AND 净买<0,0,底,1.9,0),COLOR00AA00;
STICKLINE(进出量<0 AND 净买<0,0,底,1.1,0),COLOR00CC00;
STICKLINE(进出量<0 AND 净买<0,0,底,0.3,0),COLOR00FF00;
STICKLINE(进MMM OR 跌停,0,底,0.0,0),COLORGREEN;
STICKLINE(进MMM OR 跌停,0,底,3.1,0),COLORFF0000;
STICKLINE(进MMM OR 跌停,0,底,1.9,0),COLORFF0000;
STICKLINE(进MMM OR 跌停,0,底,0.1,0),COLORFFFF00;
STICKLINE(净买>=0 AND 进JJ>=1 AND 底<0,0,底,2.3,0 ),COLOR880088;
STICKLINE(净买>=0 AND 进JJ>=1 AND 底<0,0,底,1.6,0 ),COLORAA00AA;
STICKLINE(净买>=0 AND 进JJ>=1 AND 底<0,0,底,0.8,0 ),COLORCC00CC;
STICKLINE(净买>=0 AND 进JJ>=1 AND 底<0,0,底,0.1,0 ),COLOREE00EE;
STICKLINE(净买>=0 AND 底>=0 AND 底>=REF(底,1),0,底,3.2,0),COLOR0000BB;
STICKLINE(净买>=0 AND 底>=0 AND 底>=REF(底,1),0,底,1.3,0),COLOR2233DD;
STICKLINE(净买>=0 AND 底>=0 AND 底>=REF(底,1),0,底,0.3,0),COLOR6677FF;
STICKLINE(净买>=0 AND 底>=0 AND 底>=REF(底,1) AND 净流>=REF(净流,1),0,底,0.1,0),COLORYELLOW;
STICKLINE((G6>G8 OR (G8<50 AND G3>G6 AND G6>REF(G6,1))) AND 净买>=0 AND G3>REF(G3,1) AND 底5>REF(底5,1) AND 量,0,底,2.3,0),COLORMAGENTA;
AMV1:G3,COLORRED,LINETHICK2;
AMV2:SMA(G3,2,1),COLORYELLOW,LINETHICK2;
AMV3:SMA(AMV2,2,1),COLORGREEN,LINETHICK2;

上一篇:通达信公式下载:追涨新风尚,涨停双响炮选股,强势选股NCCI

下一篇:通达信源码:分仓抄底,转强要拉一波,天地周期