您现在的位置:程序化交易>> 股票公式>> 通达信>> 通达信公式>>正文内容

趋势判断(副图指标公式、公式、源码、演示图、说明)[通达信公式]

相关标签:

 

 

原理解析:


 

 来源:程序化99( WWW.CXH99.COM )

源码:

 

 

STICKLINE(C>0,H,L,3,0),COLORBLACK;{背景色是什么就填什么颜色}
{时间设置}
LTA:=FINANCE(7)+300000000;
GB:=2*IF(FINANCE(7)<100000000000,FLOOR(ABS((FINANCE(7)/1000000000-1))),FLOOR(ABS((FINANCE(7)/1000000000-1)))/10),NODRAW ;
C1:=CLOSE;
V1:=TIME;
A1:=COUNT(BARSCOUNT(C)=1 AND TIME<102000 ,0 );
T:=IF(V1<130000,(FLOOR(V1/10000)-9.5)*60+(FLOOR(V1/100)-100*FLOOR(V1/10000)),
(FLOOR(V1/10000)-11)*60+(FLOOR(V1/100)-100*FLOOR(V1/10000))),NODRAW;
成交额:AMOUNT,NODRAW;
大额线:=50*3+300*GB,COLOR00FFFF;VV2:=SUM(AMOUNT,T),NODRAW;
初正1:=IF(T=1 AND DYNAINFO(4)>=DYNAINFO(3),VV2,0);
初负1:=IF(T=1 AND DYNAINFO(4)<DYNAINFO(3),VV2,0);
初正2:=CONST(SUM(IF(T=1,初正1,0),T)),NODRAW;
初负2:=CONST(SUM(IF(T=1,初负1,0),T)),NODRAW;
初正:=CONST(SUM(IF(初正1>大额线 AND T=1,初正1,0),T)),NODRAW;
初负:=CONST(SUM(IF(初负1>大额线 AND T=1,初负1,0),T)),NODRAW;
T00:=IF(C1>REF(C1,1),0.9,-0.9);
T01:=IF(C1<REF(C1,1),-0.9,0.9);
T02:=T00+T01;
TT1:=BARSLAST(CROSS(T02,0));
TT2:=BARSLAST(CROSS(0,T02));
TT:=IF(T02=1.8,1,IF(T02=-1.8,-1,0));
正V1:=IF(TT=1 OR (TT=0 AND TT1>TT2),成交额,0);
负V1:=IF(TT=-1 OR (TT=0 AND TT1<TT2),成交额,0);
正总1:=初正1+SUM(正V1,T),NODRAW,COLOR0000FF;
负总1:=初负1+SUM(负V1,T),NODRAW,COLOR00FF00;
总:=(正总1+负总1)+初正2+初负2,NODRAW;
正V:=IF(正V1>大额线,正V1,0);
负V:=IF(负V1>大额线,负V1,0);
正总:初正+SUM(正V,T),NODRAW,COLOR0000FF;
负总:初负+SUM(负V,T),NODRAW,COLOR00FF00;
差%:(正总-负总)/总*100,COLOR00FF00,NODRAW;TTA:=INTPART(2*T/5);
KP30:=T<240;
KPGD:=H=HHV(H,0) AND KP30;
GDSJ:=BARSLAST(KPGD);
{强弱界}
MMA30:=EMA(CLOSE,30);
强弱界定:=EMA(CLOSE,900);
{DRAWBAND(MMA30,RGB(128,0,128),强弱界定,RGB(15,96,96));}
DRAWICON(CROSS(MMA30,强弱界定),H,1);
CC:=CLOSE,COLORWHITE,LINETHICK2;
VAR7:=SMA(CC,6.18,1);
VAR71:=ATAN((VAR7-REF(VAR7,1)))*180/3.1416;
VAR8:=SMA(VAR7,3.14,1);
VAR81:=ATAN((VAR8-REF(VAR8,1)))*180/3.1416;
RCC:=DYNAINFO(3);
S2:=SMA(C,3,1);
S6:=SMA(C,5,1);
DK:=4*(S2-S6);
KK:=1;{暗轨}
{AA1:=PLOYLINE(CLOSE<COST(50) AND T>5,COST(20));
BB1:=PLOYLINE(CLOSE<COST(50) AND T>5,COST(80));
DRAWBAND(BB1,RGB(50,50,50),AA1,DRAWNULL);}
{CYC}
VAR1:=AMOUNT/VOL/100;
VAR2:=(3*HIGH+LOW+OPEN+2*CLOSE)/7;
VAR3:=SUM(AMOUNT,5)/VAR1/100;
VAR4:=SUM(AMOUNT,13)/VAR1/100;
VAR5:=SUM(AMOUNT,34)/VAR1/100;
CYC5:=DMA(VAR2,VOL/VAR3);
CYC13:=DMA(VAR2,VOL/VAR4);
CYC34:=DMA(VAR2,VOL/VAR5);
{DRAWBAND(CYC5,RGB(238,130,238),CYC13,DRAWNULL);
DRAWBAND(CYC13,RGB(150,0,150),CYC34,DRAWNULL);}
{分时MACD}
昨收:=DYNAINFO(3);
HH:=DYNAINFO(5);
LL:=DYNAINFO(6);
FK:=MAX(HH-昨收,昨收-LL)*0.1;
ZS:=昨收-FK*3.2;
Q1:=昨收-FK*3.22;
Q2:=昨收-2*FK*3.22;
Q3:=昨收-3*FK*3.2;
MA5:=MA(CLOSE,5);
MA10:=MA(CLOSE,10);
MA20:=MA(CLOSE,20);
MA30:=MA(CLOSE,30);
DIF:=(EMA(CLOSE,13) - EMA(CLOSE,24));
DEA:=(EMA(DIF,6));
MACD:=5*(DIF-DEA);
{STICKLINE(MACD>=0 AND MACD>=REF(MACD,1),RCC*KK,MACD*4+RCC*KK,3,1)
,COLORFF00FF,LINETHICK3;}
STICKLINE(MACD>=0 AND MACD< REF(MACD,1),RCC*KK,MACD*4+RCC*KK,0,0),COLOR00FF00,LINETHICK3;
STICKLINE(MACD<0 AND MACD>=REF(MACD,1),RCC*KK,MACD*4+RCC*KK,0,0)
COLORFF00FF,{COLOR4ABEFF},LINETHICK3;
{STICKLINE(MACD<0 AND MACD< REF(MACD,1),RCC*KK,MACD*4+RCC*KK,3,1)
,COLORBLUE,LINETHICK3;}
STICKLINE(DK>0,RCC*KK,RCC*KK+DK,0,0),COLORRED;
STICKLINE(DK<0,RCC*KK,RCC*KK+DK,0,0),COLORFFFF00;
{多头MACD}
DIFF:=EMA(CLOSE,240)-EMA(CLOSE,240)*100;
DEAA:=EMA(DIFF,18);
多头MACD:=(-3*(DIFF-DEAA))*20,NODRAW;
ZD:=HHV(多头MACD,0);
ZX:=LLV(多头MACD,0);
CZ:=(Q2-Q3)/6;
FDM:=MAX(ABS(ZD),ABS(ZX))*1.5;
RB:=(Q2+Q3)/2+2*(Q2-Q3)/3/FDM*多头MACD;
STICKLINE(多头MACD>0,RB,(Q2+Q3)/2,0,0),LINETHICK1,COLOR0000FF;
STICKLINE(多头MACD<0,RB,(Q2+Q3)/2,0,0),LINETHICK1,COLOR00FF00;
{火焰山及底部信号}
FAA:=WINNER(CLOSE+CLOSE*15/100)*100;
FBB:=WINNER(CLOSE+CLOSE*0/100)*100;
FCC:=FAA-FBB;
FDD:=(WINNER(CLOSE-CLOSE*0.1/100)-WINNER(CLOSE-CLOSE*15/100))*100;
FEE:=FCC<3 AND FDD<0.5 AND OPEN!=LOW;
FA1:=DYNAINFO(6);
FA2:=IF(LOW>FA1,0,IF(HIGH<FA1,1,(FA1-LOW+0.01)/(HIGH-LOW+0.01)));
FA3:=VOL/WINNER(LOW);
FA4:=REF(HHV(CLOSE,120),1);
FA5:=REF(LLV(CLOSE,120),1);
FA6:=100*(CLOSE-FA5)/(FA4-FA5);
FA7:=FA2>0 OR FA2=1;
FA8:=FA7 AND FA3/REF(FA3,3)>=3 AND FA6<80;
FA9:=REF(FA8,1) OR REF(FA8,2) OR REF(FA8,3) OR REF(FA8,4);
FA10:=FA8 AND FA9;
FA11:=IF(FILTER(FA8,3),5,0);
FA12:=IF(FILTER(FA10,3) OR FEE,10,0);
EEEE:=(RCC-ZS)/5;
FVAR1:=REF(LOW,1);
FVAR2:=SMA(ABS(LOW-FVAR1),13,1)/SMA(MAX(LOW-FVAR1,0),13,1);
FVAR3:=EMA(FVAR2,13);
FVAR4:=LLV(LOW,34);
FVAR51:=EMA(IF(LOW<=FVAR4,FVAR3,0),3);
FVAR5:=IF(FVAR51>20,20,FVAR51);
DRAWTEXT(FA11,(Q2+Q3)/2*1.02,'↑进'),COLOR00FFFF;
DRAWTEXT(FA12,(Q2+Q3)/2*1.03,',↑加');
主力进场:STICKLINE(FVAR5>REF(FVAR5,1),(Q2+Q3)/2,(Q2+Q3)/2+FVAR5*EEEE,10,1),
COLORFF00FF;
洗盘:IF(FVAR5<REF(FVAR5,1),FVAR5,0)COLORGREEN,NODRAW;
STICKLINE(FVAR5<REF(FVAR5,1),(Q2+Q3)/2,(Q2+Q3)/2+FVAR5*EEEE,5,1),COLORCYAN;
FVAR6:=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);
FVAR7:=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);
FVAR8:=FVAR6<REF(FVAR7,1) AND VOL>REF(VOL,1) AND CLOSE>REF(CLOSE,1);
DRAWTEXT(FVAR8 AND COUNT(FVAR8,30)=1,(Q2+Q3)/2+3*EEEE,'迹');
JCCOUNT:=COUNT(CROSS(DIF,DEA),BARSLAST(DEA>=0));
二次金叉:=CROSS(DIF,DEA) AND DEA<0 AND COUNT(JCCOUNT=2,21)=1;
STICKLINE(二次金叉,(Q2+Q3)/2,(Q2+Q3)/2*1.01,4,0),COLORFF00FF;
DRAWTEXT(二次金叉,(Q2+Q3)/2*1.01,' 二金'),COLORYELLOW;
HHH:=MA(CLOSE,10);
GGG:=MA(CLOSE,12);
上:=EMA((MA(HIGH,3) * 1.05),30);
下:=EMA((MA(LOW,3) * 0.96),30);
决战:STICKLINE((((CROSS(DIF,DEA) AND ((下 - REF(下,1)) > 0)) AND (MACD >= REF(MACD,1))) AND
(DIF < 0)),(Q2+Q3)/2,(Q2+Q3)/2*1.01,1,0),COLOR0000FF;
DRAWTEXT((((CROSS(DIF,DEA) AND ((下 - REF(下,1)) > 0)) AND (MACD >= REF(MACD,1))) AND (DIF
<= 0)),(Q2+Q3)/2*1.01,'DIF金叉'),COLOR0000FF;
{两个主要买进信号}
RSV:=((CLOSE-LLV(LOW,240))/(HHV(HIGH,240)-LLV(LOW,240))*200-100);
K:=SMA(SMA(RSV,18,1),3,1);
D:=MA(EMA(K,18),3);
短买:=CROSS(K,D) AND K>0 AND CLOSE<DYNAINFO(3)*1.07;
DRAWTEXT(短买,(Q2+Q3)/2+(Q2-Q3)/1,'短买'),COLORFF00FF;
YY:=SMA(VOL,30,1);
量1:=(YY-LLV(LLV(YY,1),30))/(HHV(HHV(YY,1),30)-LLV(LLV(YY,1),30));
量:=(YY-LLV(LLV(YY,1),30))/(HHV(HHV(YY,1),30)-LLV(LLV(YY,1),30))>0.92;
短横:=((HHV(CLOSE,TTA)-LLV(CLOSE,TTA))/CLOSE)<0.04;
横后上涨:=(CLOSE/DYNAINFO(3))>=1.02=0 AND 短横 AND 量 AND CROSS(C,(MA(C*V,TTA)/MA(V,TTA) + AVEDEV(C,TTA)*2));
上涨:=FILTER((CROSS(横后上涨,0)AND 量 AND T>60
OR (T>60 AND CLOSE<DYNAINFO(3)*1.04 AND (量1<0.5 OR 量1=1) AND BARSLAST(CROSS(C,(MA(C*V,TTA)/MA(V,TTA) + AVEDEV(C,TTA)*2)))<3
AND CROSS(C,MA(HHV(C,TTA),1)))),30);
DRAWTEXT(上涨,(Q2+Q3)/2+(Q2-Q3)/1,'涨'),COLORRED,LINETHICK3;
HHHH:REF(H,GDSJ),COLORFFFFFF,POINTDOT,LINETHICK1;
过顶:IF(CROSS(C,HHHH),1,0),COLOR00FF00,POINTDOT,NODRAW;
冲高:IF(FILTER(CROSS(C,HHHH*1.01),15),1,0),COLOR00FFFF,POINTDOT,NODRAW;
{DRAWBAND(VAR7,RGB(255,550,80),VAR8,RGB(0,225,225));}
DRAWTEXT(过顶,HHHH*1.005,'↑'),COLOR00FF00;
DRAWTEXT(冲高,HHHH*1.005,'☆'),COLOR00FFFF;
C;
HIGH;
LOW;
DRAWBAND(HIGH,RGB(139,0,139),LOW,DRAWNULL);
DRAWBAND(C,RGB(65,105,225),LOW,DRAWNULL);
STICKLINE(VAR71>0 AND VAR7>REF(VAR7,1), VAR7,REF(VAR7,1),4,0),COLORRED;
STICKLINE(VAR71<0 AND VAR7<REF(VAR7,1), VAR7,REF(VAR7,1),4,1),COLORGREEN;
STICKLINE(VAR81>0,VAR8,REF(VAR8,1),4,0),COLOR00CCFF;
STICKLINE(VAR81<0,VAR8,REF(VAR8,1),4,1),COLORBBCCCC;
C,LINETHICK1,COLORFFFFFF;
A:=REF(H,8)=HHV(H,2*8+1);
B1:=FILTER(A,8);
C3:=BACKSET(B1,8+1);
D1:=FILTER(C3,8);{高点}
R11:=BACKSET(ISLASTBAR,BARSLAST(D1)+1); S11:=R11>REF(R11,1);
压1:DRAWLINE(D1,H,S11,H,1),COLORFF6600,LINETHICK1;
A2:=REF(L,8)=LLV(L,2*8+1);
B2:=FILTER(A2,8);
C2:=BACKSET(B2,8+1);
D2:=FILTER(C2,8);{低点}
T11:=BACKSET(ISLASTBAR,BARSLAST(D2)+1); U11:=T11>REF(T11,1);
撑1:DRAWLINE(D2,L,U11,L,1),COLORFF6600,LINETHICK1;
M:=INTPART(3*8/5);
A12:=REF(H,M)=HHV(H,2*M+1);
B12:=FILTER(A12,M);
C12:=BACKSET(B12,M+1);
D12:=FILTER(C12,M);{波段高点}
R112:=BACKSET(ISLASTBAR,BARSLAST(D12)+1); S112:=R112>REF(R112,1);
压2:DRAWLINE(D12,H,S112,H,1)COLOR9999CC,LINETHICK1;
A22:=REF(L,M)=LLV(L,2*M+1);
B22:=FILTER(A22,M);
C22:=BACKSET(B22,M+1);
D22:=FILTER(C22,M);{{波段低点}
T112:=BACKSET(ISLASTBAR,BARSLAST(D22)+1); U112:=T112>REF(T112,1);
撑2:DRAWLINE(D22,L,U112,L,1)COLOR9999CC,{COLORFFCCCC},LINETHICK1,;
XU:=PEAK(C,IF(PERIOD<5,5,10),1)*0.999,COLORFFCC99,LINETHICK1;{箱顶}
XD:=TROUGH(C,IF(PERIOD<5,5,10),1)*0.998,COLORFF99CC,LINETHICK1;{箱底}
XTB:=XD!=REF(XD,2) && XD=REF(XD,1);
XTS:=XU!=REF(XU,2) && XU=REF(XU,1);
DRAWICON(XTB,MIN(XD,L)*0.990,1);
升段:DRAWLINE(XTB,MIN(LLV(L,1),XD),XTS,MAX(HHV(H,1),XU),0)
COLOR000099,LINETHICK1;{XTBL}
跌段:DRAWLINE(XTS,MAX(HHV(H,1),XU),XTB,MIN(LLV(L,1),XD),0)
COLOR009900,LINETHICK1;{XTSL}
DRAWTEXT(XTB,MIN(XD,L)*0.984,'下跌终点!满仓]'),COLOR0000DD;
DRAWICON(XTS,MAX(XU,H)*1.006,2);
DRAWTEXT(XTS,MIN(XU,H)*1.006,'上升终点!清仓]')COLOR00DD00;

 

公式导入教程: 【通达信公式源码导入方法教程】 【同花顺公式源码导入方法教程】 【大智慧新一代公式源码导入方法教程

 

 

有思路,想编写各种指标公式,交易模型,选股公式,还原公式的朋友

可联系技术人员 QQ: 262069696  点击在线交流或微信:cxhjy888 进行 有偿收费 编写!(注:由于人数限制,QQ或微信请选择方便的一个联系我们就行,加好友时请简单备注下您的需求,否则无法通过。谢谢您!)

怎么收费,代编流程等详情请点击查阅!

(注:由于人数限制,QQ或微信请选择方便的一个联系我们就行,加好友时请简单备注下您的需求,否则无法通过。谢谢您!)

 


【字体: 】【打印文章】【查看评论

相关文章

    没有相关内容