当前位置: 网站首页 > 股票软件公式 > 同花顺公式 > 文章 当前位置: 同花顺公式 > 文章

同花顺源码:大资金进出,主图成本线,TD组合

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

大资金进出:

看主力资金 有未来函数

VAR3:=(CLOSE-MA(CLOSE,5))/MA(CLOSE,5)*100;

VAR4:=(CLOSE-MA(CLOSE,23))/MA(CLOSE,23)*100;

VAR5:=(CLOSE-MA(CLOSE,34))/MA(CLOSE,34)*100;

VAR6:=(VAR3+VAR4+VAR5)/3;

VAR7:=EMA(VAR6,7);

指标: EMA(EMA(VAR3,5),5)*3, COLORSTICK;

VAR8:=IF(VAR6<=-20,10,0);

VAR9:=HHV(VAR8,10);

STICKLINE(VAR8=10,20,10,5,0),COLOR6666FF;

VARA:=IF(VAR9 AND CROSS(MA(CLOSE,3),MA(CLOSE,5)),20,0);

K:EMA(VAR7,5)*2, , COLORFF00FF;

D:EMA(K,5), , colorwhite;

J:K*3-D*2, ,coloryellow;

VARB:=BETWEEN(CLOSE,MA(CLOSE,3),MA(CLOSE,5)) AND J>10;

换手:= VOL/CAPITAL*100, , coloryellow;

成交〖万手〗:=VOL/10000, ,colorwhite;

DRAWTEXT(VAR8=10 AND FILTER(VAR8=10,5),-10,'近底部'),LINETHICK1,coloryellow;

STICKLINE(VAR8=10 AND FILTER(VAR8=10,5),-1.6,-10,5,0),coloryellow;

DRAWTEXT(VARA=20,15,'底部'),LINETHICK1,colorwhite;

STICKLINE((VARA=20),0,10,5,0),colorwhite;

VARC:=(ZIG(3,5)>REF(ZIG(3,5),1)) AND (REF(ZIG(3,5),1)<=REF(ZIG(3,5),2)) AND (REF(ZIG

(3,5),2)<=REF(ZIG(3,5),3));

VARD:=(ZIG(3,5)<REF(ZIG(3,5),1)) AND (REF(ZIG(3,5),1)>=REF(ZIG(3,5),2)) AND (REF(ZIG

(3,5),2)>=REF(ZIG(3,5),3));

STICKLINE((VARC=1),(-14),0,4,0),COLOR0000FF;

DRAWTEXT((VARC=1),(-14),'买'),COLOR0000FF;

STICKLINE((VARD=1),14,0,4,0),COLOR00FF00;

DRAWTEXT((VARD=1),18,'卖'),COLOR00FF00;

VARE:=MA(100*(CLOSE-LLV(CLOSE,34))/(HHV(HIGH,34)-LLV(LOW,34)),5)-20;

VARF:=100-3*SMA((CLOSE-LLV(LOW,75))/(HHV(HIGH,75)-LLV(LOW,75))*100,20,1)+2*SMA(SMA

((CLOSE-LLV(LOW,75))/(HHV(HIGH,75)-LLV(LOW,75))*100,20,1),15,1);

VAR10:=100-3*SMA((OPEN-LLV(LOW,75))/(HHV(HIGH,75)-LLV(LOW,75))*100,20,1)+2*SMA(SMA

((OPEN-LLV(LOW,75))/(HHV(HIGH,75)-LLV(LOW,75))*100,20,1),15,1);

VAR11:=VARF<REF(VAR10,1) AND VOL>REF(VOL,1) AND CLOSE>REF(CLOSE,1);

DRAWTEXT(VAR11 AND COUNT(VAR11,30)=1,15,'大资金活动'),LINETHICK1,COLORFF00FF;

{STICKLINE(VAR11 AND COUNT(VAR11,30)=1,1,10,5,0),COLORFF00FF;}

VAR12:=(HIGH+LOW+CLOSE)/3;

VAR13:=(VAR12-MA(VAR12,14))/(0.015*AVEDEV(VAR12,14));

VAR14:=(VAR12-MA(VAR12,70))/(0.015*AVEDEV(VAR12,70));

VAR15:=IF(VAR13>=150 AND VAR13<200 AND VAR14>=150 AND VAR14<200,10,0);

VAR16:=IF(VAR13<=-150 AND VAR13>-200 AND VAR14<=-150 AND VAR14>-200,-10,VAR15);

VAR17:=(CLOSE-MA(CLOSE,13))/MA(CLOSE,13)*100;

VAR18:=100-ABS(VAR17);

VAR19:=IF(VAR18<90,VAR18,100);

VAR1A:=IF(VARE>0,VARE,0);

VAR1B:=IF(VAR14>=200 AND VAR13>=150,15,IF(VAR14<=-200 AND VAR13<=-150,-15,VAR16))+60;

VAR1C:=VAR1A>48 AND VAR1B>60 AND VAR19<100;

DRAWTEXT(VAR1C AND COUNT(VAR1C,30)=1,15,'大笔出货'),LINETHICK1,COLORFFCC66;

STICKLINE(VAR1C AND COUNT(VAR1C,30)=1,0,10,5,0),COLORFFCC66;




主图成本线:

N:=5;M:=35;
VAR1:=SMA(MAX(MAX(HIGH-LOW,ABS(HIGH-REF(CLOSE,1))),ABS(LOW-REF(CLOSE,1))),M,1);
VAR2:=HIGH-REF(HIGH,1);
VAR3:=REF(LOW,1)-LOW;
VAR4:=SMA(IF(VAR2>0 AND VAR2>VAR3,VAR2,0),M,1);
VAR5:=SMA(IF(VAR3>0 AND VAR3>VAR2,VAR3,0),M,1);
VAR6:=VAR4*100/VAR1;
VAR7:=VAR5*100/VAR1;
VAR8:=SMA(ABS(VAR7-VAR6)/(VAR7+VAR6)*100,M,1);
VAR9:=(VAR8+REF(VAR8,N))/2;
VARA:=SUM(HIGH-OPEN,M)/SUM(OPEN-LOW,M)*100;
VARB:=SUM(MAX(0,HIGH-REF(CLOSE,1)),M)/SUM(MAX(0,REF(CLOSE,1)-LOW),M)*100;
VARC:=AMOUNT/VOL/100;
VARD:=(3*HIGH+LOW+OPEN+2*CLOSE)/7;
VARE:=SUM(AMOUNT,N)/VARC/100;
VAR10:=SUM(AMOUNT,M)/VARC/100;
VAR12:=REF(AMOUNT,1)+REF(AMOUNT,2)+REF(AMOUNT,3)+REF(AMOUNT,4);
VAR13:=VAR12/CAPITAL;
VAR14:=VOL/CAPITAL*VARD+VAR13*REF(VARC,1);
LHZ5: IF(DATE,DMA(VARD,VOL/VARE),0);
LHZ35: IF(DATE,DMA(VARD,VOL/VAR10),0);
市场绝对成本: IF(DATE,DMA(VARD,VOL/CAPITAL),0),POINTDOT;
上轨:= SMA(AMOUNT/VOL/100,M,1)*1.12,POINTDOT;
下轨:= SMA(AMOUNT/VOL/100,M,1)*0.88,POINTDOT;
均价:=(C+REF(C,1)+REF(C,2)*3)/5;
压力J:=1.025*均价;
支撑JR:=0.97*均价;
TT0:=CONST(BARSLAST(压力J));
TT1:=CONST(BARSLAST(支撑JR));
STICKLINE(PERIODNAME=5 AND CURRBARSCOUNT=TT1+1,支撑JR,支撑JR+0.01,40,0),COLOR00FF00;
STICKLINE(PERIODNAME=5 AND CURRBARSCOUNT=TT0+1,压力J,压力J-0.01,40,0),colormagenta;
十三日均线:MA(C,13),LINETHICK3;
持股:IF(十三日均线>=REF(十三日均线,1),十三日均线,DRAWNULL),colorred,LINETHICK3;




TD组合:

做个同花顺版的德马克TD系列指标( 顶尖财经 股票学院: http://www.58188.com )

ThomasR.DeMark(德马克),TD系列指标创始人。TD指标有大概有70多种,当中应用最多的是TD序列和TD组合。TD序列是由价格反转、TD结构、TD计数三大部分组成;而TD组合基本上和TD序列类似,只是在计数部分有一些差异,相对来讲TD组合的计数条件要求更严格一些。

 A1:=C>=REF(C,4);

A:=C<REF(C,4);
AA:=C<REF(C,4) AND REF(A1,1);
T:=BARSLAST(AA),NODRAW;
M:=(T=0 AND REFX(&T=1 AND NOT(A),1)) OR (REFX(&T=2 AND NOT(A),2)) OR (REFX(&T=3 AND NOT(A),3)) OR (REFX(&T=4 AND NOT(A),4)) OR (REFX(&T=5 AND NOT(A),5))
OR (REFX(&T=6 AND NOT(A),6)) OR (REFX(&T=7 AND NOT(A),7)) OR (REFX(&T=8 AND NOT(A),8));
M1:=T=1 AND REFX(&T=2 AND NOT(A),1) OR (REFX(&T=3 AND NOT(A),2)) OR (REFX(&T=4 AND NOT(A),3)) OR (REFX(&T=5 AND NOT(A),4)) OR (REFX(&T=6 AND NOT(A),5))
OR (REFX(&T=7 AND NOT(A),6)) OR (REFX(&T=8 AND NOT(A),7));
M2:=T=2 AND REFX(&T=3 AND NOT(A),1) OR (REFX(&T=4 AND NOT(A),2)) OR (REFX(&T=5 AND NOT(A),3)) OR (REFX(&T=6 AND NOT(A),4)) OR (REFX(&T=7 AND NOT(A),5)) OR (REFX(&T=8 AND NOT(A),6));
M3:=T=3 AND REFX(&T=4 AND NOT(A),1)OR (REFX(&T=5 AND NOT(A),2)) OR (REFX(&T=6 AND NOT(A),3)) OR (REFX(&T=7 AND NOT(A),4)) OR (REFX(&T=8 AND NOT(A),5));
M4:=T=4 AND REFX(&T=5 AND NOT(A),1) OR (REFX(&T=6 AND NOT(A),2)) OR (REFX(&T=7 AND NOT(A),3)) OR (REFX(&T=8 AND NOT(A),4));
M5:=T=5 AND REFX(&T=6 AND NOT(A),1) OR (REFX(&T=7 AND NOT(A),2)) OR (REFX(&T=8 AND NOT(A),3));
M6:=T=6 AND REFX(&T=7 AND NOT(A),1) OR (REFX(&T=8 AND NOT(A),2));
M7:=T=7 AND REFX(&T=8 AND NOT(A),1);
N:=T=1 AND REF(T=0 AND AA,1) AND A;
N1:=T=2 AND REF(N,1) AND A;
N2:=T=3 AND REF(N1,1) AND A;
N3:=T=4 AND REF(N2,1) AND A;
N4:=T=5 AND REF(N3,1) AND A;
N5:=T=6 AND REF(N4,1) AND A;
N6:=T=7 AND REF(N5,1) AND A;
N7:=T=8 AND REF(N6,1) AND A;
DRAWTEXT(T=0,H*1.02,'1'),colorgreen;
DRAWTEXT(N,H*1.02,'2'),colorgreen;
DRAWTEXT(N1,H*1.02,'3'),colorgreen;
DRAWTEXT(N2,H*1.02,'4'),colorgreen;
DRAWTEXT(N3,H*1.02,'5'),colorgreen;
DRAWTEXT(N4,H*1.02,'6'),colorgreen;
DRAWTEXT(N5,H*1.02,'7'),colorgreen;
DRAWTEXT(N6,H*1.02,'8'),colorgreen;
DRAWTEXT(N7,H*1.02,'9'),coloryellow;
DRAWICON(N7,H*1.04,1),colorgreen;
DRAWTEXT(M,H*1.02,'1'),colorblack;
DRAWTEXT(M1,H*1.02,'2'),colorblack;
DRAWTEXT(M2,H*1.02,'3'),colorblack;
DRAWTEXT(M3,H*1.02,'4'),colorblack;
DRAWTEXT(M4,H*1.02,'5'),colorblack;
DRAWTEXT(M5,H*1.02,'6'),colorblack;
DRAWTEXT(M6,H*1.02,'7'),colorblack;
DRAWTEXT(M7,H*1.02,'8'),colorblack;
B1:=C<=REF(C,4);
B:=C>REF(C,4);
BB:=C>REF(C,4) AND REF(B1,1);
T1:=BARSLAST(BB),NODRAW;
M111:=(T1=0 AND REFX(&T1=1 AND NOT(B),1)) OR (REFX(&T1=2 AND NOT(B),2)) OR (REFX(&T1=3 AND NOT(B),3)) OR (REFX(&T1=4 AND NOT(B),4)) OR (REFX(&T1=5 AND NOT(B),5))
OR (REFX(&T1=6 AND NOT(B),6)) OR (REFX(&T1=7 AND NOT(B),7)) OR (REFX(&T1=8 AND NOT(B),8));
M11:=T1=1 AND REFX(&T1=2 AND NOT(B),1) OR (REFX(&T1=3 AND NOT(B),2)) OR (REFX(&T1=4 AND NOT(B),3)) OR (REFX(&T1=5 AND NOT(B),4)) OR (REFX(&T1=6 AND NOT(B),5))
OR (REFX(&T1=7 AND NOT(B),6)) OR (REFX(&T1=8 AND NOT(B),7));
M22:=T1=2 AND REFX(&T1=3 AND NOT(B),1) OR (REFX(&T1=4 AND NOT(B),2)) OR (REFX(&T1=5 AND NOT(B),3)) OR (REFX(&T1=6 AND NOT(B),4)) OR (REFX(&T1=7 AND NOT(B),5)) OR (REFX(&T1=8 AND NOT(B),6));
M33:=T1=3 AND REFX(&T1=4 AND NOT(B),1)OR (REFX(&T1=5 AND NOT(B),2)) OR (REFX(&T1=6 AND NOT(B),3)) OR (REFX(&T1=7 AND NOT(B),4)) OR (REFX(&T1=8 AND NOT(B),5));
M44:=T1=4 AND REFX(&T1=5 AND NOT(B),1) OR (REFX(&T1=6 AND NOT(B),2)) OR (REFX(&T1=7 AND NOT(B),7)) OR (REFX(&T1=8 AND NOT(B),4));
M55:=T1=5 AND REFX(&T1=6 AND NOT(B),1) OR (REFX(&T1=7 AND NOT(B),2)) OR (REFX(&T1=8 AND NOT(B),3));
M66:=T1=6 AND REFX(&T1=7 AND NOT(B),1) OR (REFX(&T1=8 AND NOT(B),2));
M77:=T1=7 AND REFX(&T1=8 AND NOT(B),1);
N111:=T1=1 AND REF(T1=0 AND BB,1) AND B;
N11:=T1=2 AND REF(N111,1) AND B;
N22:=T1=3 AND REF(N11,1) AND B;
N33:=T1=4 AND REF(N22,1) AND B;
N44:=T1=5 AND REF(N33,1) AND B;
N55:=T1=6 AND REF(N44,1) AND B;
N66:=T1=7 AND REF(N55,1) AND B;
N77:=T1=8 AND REF(N66,1) AND B;
DRAWTEXT(T1=0,H*1.02,'1'),COLOR9900CC;
DRAWTEXT(N111,H*1.02,'2'),COLOR9900CC;
DRAWTEXT(N11,H*1.02,'3'),COLOR9900CC;
DRAWTEXT(N22,H*1.02,'4'),COLOR9900CC;
DRAWTEXT(N33,H*1.02,'5'),COLOR9900CC;
DRAWTEXT(N44,H*1.02,'6'),COLOR9900CC;
DRAWTEXT(N55,H*1.02,'7'),COLOR9900CC;
DRAWTEXT(N66,H*1.02,'8'),COLOR9900CC;
DRAWTEXT(N77,H*1.02,'9'),COLORFFFF00;
DRAWICON(N77,H*1.04,2),colorred;
DRAWTEXT(M111,H*1.02,'1'),colorblack;
DRAWTEXT(M11,H*1.02,'2'),colorblack;
DRAWTEXT(M22,H*1.02,'3'),colorblack;
DRAWTEXT(M33,H*1.02,'4'),colorblack;
DRAWTEXT(M44,H*1.02,'5'),colorblack;
DRAWTEXT(M55,H*1.02,'6'),colorblack;
DRAWTEXT(M66,H*1.02,'7'),colorblack;
DRAWTEXT(M77,H*1.02,'8'),colorblack;
 

上一篇:同花顺源码:主力清仓,小杨斜率抓牛股,自创高抛低吸

下一篇:同花顺源码:主力资金吃吐,主散坑,底部吸筹