趋势指标通达信指标公式源码
根据趋势指标背离指标通达信指标公式源码
根据趋势指标背离指标通达信指标公式源
码
引言
趋势指标背离指标是投资者在股票市场中用来判断股票价格走势是否背离趋势的一种技术分析工具。
本文将介绍通达信软件中使用的趋势指标背离指标的公式源码。
公式源码解析
以下是通达信软件中趋势指标背离指标的公式源码:
公式1:
SAR=[前一周期SAR]+[前一周期AF*(前一周期EP-前一周期SAR)]
其中,SAR代表后续发展停轨,AF代表加速因子,EP代表极点价格。
公式2:
VR=(AVS-BVS)/(AVS+BVS)
其中,VR代表成交量比率,AVS代表上升成交量,BVS代表
下降成交量。
公式3:
DMI:=(HHV(HIGH,N)-LLV(LOW,N))/N
其中,DMI代表指标值,HHV代表最高价的最高值,LLV代
表最低价的最低值,N代表周期。
公式4:
MACD:=EMA(CLOSE,SHORT)-EMA(CLOSE,LONG)
其中,MACD代表指标值,EMA代表指数平均值,CLOSE代
表收盘价,SHORT代表短期周期,LONG代表长期周期。
结论
趋势指标背离指标是通达信软件中常用的技术分析工具之一。
通过分析股票价格和成交量的走势,投资者可以使用这些公式来判
断市场的趋势是否背离实际情况,从而作出相应的投资决策。
然而,投资者在使用这些指标时应注意市场环境的变化和其他重要信息的
综合分析,以取得更准确的结果。
以上是根据趋势指标背离指标通达信指标公式源码的文档。
希望对您有所帮助。
量能趋势通达信指标公式源码
RV:=(CLOSE-LLV(LOW,27))/(HHV(HIGH,27)-LLV(LOW,27))*100;RG:=(CLOSE-LLV(LOW,5))/(HHV(HIGH,5)-LLV(LOW,5))*100;J0:=(HIGH+LOW)/2;QJ:=EMA(J0,3);J1:=IF(CLOSE>QJ,VOL,0);J2:=IF(CLOSE<QJ,VOL,0);量能:IF(CAPITAL<1,MA(VOL,74),MA(SUM(J1-J2,22),3)),COLOR00DDDD,NODRAW; 趋势:IF(CAPITAL<1,EMA(量能,360),EMA(量能,21)),COLOR008800,NODRAW; VAR3:=(量能-趋势);VAR44:=SMA(RV,3,1);VAR55:=SMA(VAR44,3,1);STICKLINE(VAR3>0,20,10,5,1),COLOR0000FF;STICKLINE(VAR3<0,100,90,10,1),COLOR00FF00;DRAWICON(CROSS(VAR44,VAR55) AND VAR55<30,2,1);DRAWICON(CROSS(VAR55,VAR44) AND VAR55>30,97,2);DRAWBAND(VAR55,RGB(0,22,224),VAR44,RGB(255,50,50));遵:IF(VAR55>=VAR44,VAR55,DRAWNULL),COLORRED;守:IF(VAR44>=VAR55,VAR44,DRAWNULL),COLORFF9900;纪:IF(VAR55>=VAR44,VAR44,DRAWNULL),COLOR00FFFF;律:IF(VAR44>=VAR55,VAR55,DRAWNULL),COLOR00FF00;KK:=EMA(SMA(RG,3,1),2),LINETHICK0;DD:=SMA(KK,3,1),LINETHICK0;DRAWBAND(KK,RGB(155,50,50),DD,RGB(0,100,50));持:IF(KK>=DD,KK,DRAWNULL),COLORRED;观:IF(DD>=KK,DD,DRAWNULL),COLORFF9900;股:IF(KK>=DD,DD,DRAWNULL),COLOR00FFFF;望:IF(DD>=KK,KK,DRAWNULL),COLOR00FF00;DRAWICON(CROSS(KK,DD),KK,23);DRAWTEXT(CROSS(VAR44,VAR55) AND CROSS(KK,DD),10,'共振'),COLOR00FFFF;共振点:=(CROSS(VAR44,VAR55) AND CROSS(KK,DD));STICKLINE(共振点>0,0,30,2,0),COLOR008888;STICKLINE(共振点>0,0,30,1.5,0),COLOR00AAAA;STICKLINE(共振点>0,0,30,0.8,0),COLOR00DDDD;STICKLINE(共振点>0,0,30,0.3,0),COLOR00FFFF;VAR1:=1;VAR2:=((((2*CLOSE)+HIGH)+LOW) / 4);低金叉进:20,COLORFF00FF,LINETHICK2;高死叉出:90,COLORBLUE,LINETHICK2;VAR4:=LLV(LOW,5);VAR5:=HHV(HIGH,4);C1:=(EMA((((VAR2-VAR4)/(VAR5-VAR4))*100),4)*VAR1),COLORFF00FF,LINETHICK2; C2:=(EMA(((0.667*REF(C1,1))+(0.333*C1)),2)*VAR1),COLORFFFFFF,LINETHICK2; 条件:=CROSS(C1,C2) AND C1<40;条件0:=CROSS(C2,C1) AND C1>90;TJ1:=CROSS(C1,C2);TJ2:=CROSS(C2,C1);TJ3:=CROSS(C1,C2) AND REF(C1,1)<20;TJ4:=CROSS(C2,C1) AND REF(C1,1)>80;DRAWTEXT(FILTER((REF(条件,1) AND (REF(LOW,1)>LOW OR TJ2))OR (REF(条件,2) AND (REF(LOW,2)>LLV(LOW,3) OR TJ2))OR (REF(条件,3) AND (REF(LOW,3)>LLV(LOW,4) OR TJ2)),4),70,'止'),COLORRED; {DRAWTEXT(FILTER((REF(条件,1) AND (REF(LOW,1)>LOW OR TJ2))OR (REF(条件,2) AND (REF(LOW,2)>LLV(LOW,3) OR TJ2))OR (REF(条件,3) AND (REF(LOW,3)>LLV(LOW,4) OR TJ2)),4),60,'跌'),COLORRED;} DRAWTEXT(FILTER((REF(条件,1) AND (REF(LOW,1)>LOW OR TJ2)) OR(REF(条件,2) AND (REF(LOW,2)>LLV(LOW,3) OR TJ2))OR (REF(条件,3) AND (REF(LOW,3)>LLV(LOW,4) OR TJ2)),4),65,'买'),COLORRED; DRAWTEXT(条件,20,'买'),COLORRED;STICKLINE(条件,0,20,2,0),COLORRED;DRAWTEXT(条件0,85,'卖'),COLORBLUE;DRAWTEXT(CROSS(C1,75),70,'险区'),COLORGREEN;DRAWTEXT(TJ3,65,'安'),COLORRED;DRAWTEXT(TJ3,60,'买'),COLORRED;DRAWTEXT(TJ4,85,'逃顶'),COLORBLUE;STICKLINE(TJ4,100,80,2,0),COLORGREEN;VAR200:=(CLOSE-LLV(LOW,20))/(HHV(HIGH,20)-LLV(LOW,20))*100; VAR300:=SMA(SMA(VAR200,3,1),3,1)/28.57;VAR400:=EMA(VAR300,5);操盘:=3*VAR300-2*VAR400;A1:=CROSS(操盘,VAR300) AND VAR300<2.1 AND C>O; STICKLINE(A1,20,0,4,0),COLOR770077;STICKLINE(A1,20,0,3,0),COLOR990099;STICKLINE(A1,20,0,2,0),COLORBB00BB;STICKLINE(A1,20,0,1,0),COLORDD00DD;STICKLINE(A1,20,0,0.3,0),COLORFF00FF;DRAWTEXT(A1,30,'财'),COLORFF00FF;★遵守纪律★:100,COLORRED,NODRAW;★交易之魂★:100,COLORRED,NODRAW;。
通达信指标公式源码 傻买傻卖公式趋势主图
{N(1,,100,6)}CC:IF(CURRBARSCOUNT<18,CONST(REF(C,1)),DRAWNULL),COLOR000000; 止赢:1.05*CC,COLORFFFFFF,LINETHICK2;止损:0.97*CC,COLORFFFFFF,LINETHICK2;{LOOW:BBI - 2.58*STD(BBI,10),COLOR000099,LINETHICK0};SAT:=IF((AMOUNT/C)/(HHV(AMOUNT,20)/HHV(C,20))*100>100,100,(AMOU NT/C)/(HHV(AMOUNT,20)/HHV(C,20))*100);AA10:MA(CLOSE,8),COLOR0000FF;AA12:MA(CLOSE,12),COLOR0000FF;BB10:=((ATAN((AA10 - REF(AA10,1))) * 3.1416) * 10);BB12:=((ATAN((AA12 - REF(AA12,1))) * 3.1416) * 10);MA13:=MA(CLOSE,13);DRAWBAND(AA10,RGB(150,0,100),AA12,RGB(256,96,96));X1:=(C+L+H)/3;BB13:=ATAN(EMA(X1,13)-REF(EMA(X1,13),1))*3.1416*10;EMA8:=EMA(C,8);DRAWTEXT(FILTER(BB13>1 AND EMA(X1,13)>REF(EMA(X1,8),1),10),EMA8,'∠45上升'),COLORWHITE;压力:=MA(REF(HHV(C,30),1),2),COLOR9DFFFF;支撑:=MA(REF(LLV(C,30),1),2),COLORABFF46;AA1:=AMOUNT/V;BB1:=L<AA1*0.9;CC1:=(C-REF(C,1))/REF(C,1)*100>1.2;DD1:=L<MA(C,5)*0.921;EE1:=V<MA(V,5)*1.5;FF1:=BB1 AND CC1 AND DD1 AND EE1;DRAWTEXT(FF1,(LOW* 0.99),'★老鼠仓'),COLOR4080FF;A51:=3*SMA((C-LLV(L,55))/(HHV(H,55)-LLV(L,55))*100,5,1)-2*SMA((C-LLV(L ,55))/(HHV(H,55)-LLV(L,55))*100,5,1);黑码线:=EMA(A51,5);A54:=((C-LLV(L,21))/(HHV(H,21)-LLV(L,21)))*100;趋势线:=(MA(3*SMA(A54,6,1)-2*SMA(SMA(A54,5,1),5,1),2));DRAWTEXT(CROSS(趋势线,0)AND 黑码线<40,(HIGH* 0.97),'★大黑码'),COLORYELLOW;LC:=REF(CLOSE,1);RSI:=((SMA(MAX((CLOSE - LC),0),3,1) / SMA(ABS((CLOSE - LC)),3,1)) * 100); FF:=EMA(CLOSE,3);MA15:=EMA(CLOSE,21);DRAWTEXT(CROSS(FF,MA15),(LOW * 0.98),'★底背离'),COLOR00FFFF; DRAWTEXT(CROSS(88,RSI),(HIGH * 1.02),'☆顶背离'),COLORFFFF00;VAR2:=LLV(LOW,27);VAR3:=HHV(HIGH,34);VAR4:=EMA((CLOSE-VAR2)/(VAR3-VAR2)*4,4)*25;注意买:=IF((VAR4<10),80,100);RSV:=(C-LLV(L,9))/(HHV(H,9)-LLV(L,9))*100;K:=SMA(RSV,3,1);D:=SMA(K,3,1);J:=3*K-2*D;超跌:=IF(J<0,10,0);BDDD:=LLV(J,2)=LLV(J,8);买入:=IF(CROSS(J,REF(J+0.01,1)) AND BDDD AND J<20,30,0); DRAWTEXT(买入AND 注意买=100 AND 超跌=0,LOW,'★短买'),COLORFFFFFF;MTM:=C-REF(C,1);DX:=100*EMA(EMA(MTM,6),6)/EMA(EMA(ABS(MTM),6),6);买:=IF(LLV(DX,2)=LLV(DX,7) AND COUNT(DX<0,2) ANDCROSS(DX,MA(DX,2)),1,0);DRAWTEXT(FILTER(买=1,5),LOW-0.09,'★拉升'),COLOR00FFFF;A7:=(EMA((OPEN+HIGH+LOW+CLOSE)/4,21)+EMA((OPEN+HIGH+LOW+CL OSE)/4,34)+EMA((OPEN+HIGH+LOW+CLOSE)/4,68))/3;VAR7:=FORCAST(A7,6);{MA3K:VAR7,COLORRED,LINETHICK0;MA5K:VAR7,COLORYELLOW,LINETHICK0;}STICKLINE(CLOSE> REF(CLOSE,1) ,HIGH,LOW,0,1 ),COLORRED; STICKLINE(CLOSE> REF(CLOSE,1) ,OPEN,CLOSE,3,0 ),COLOR000055; STICKLINE(CLOSE> REF(CLOSE,1) ,OPEN,CLOSE,2.7,0 ),COLOR000077; STICKLINE(CLOSE> REF(CLOSE,1) ,OPEN,CLOSE,2.1,0 ),COLOR000099; STICKLINE(CLOSE> REF(CLOSE,1) ,OPEN,CLOSE,1.5,0 ),COLOR0000BB; STICKLINE(CLOSE> REF(CLOSE,1) ,OPEN,CLOSE,0.9,0 ),COLOR0000DD; STICKLINE(CLOSE> REF(CLOSE,1) ,OPEN,CLOSE,0.3,0 ),COLOR0000FF; STICKLINE(CLOSE= REF(CLOSE,1) ,HIGH,LOW,0,1 ),COLORWHITE; STICKLINE(CLOSE= REF(CLOSE,1) ,OPEN,CLOSE,3,0 ),COLOR555555; STICKLINE(CLOSE= REF(CLOSE,1) ,OPEN,CLOSE,2.7,0 ),COLOR777777; STICKLINE(CLOSE= REF(CLOSE,1) ,OPEN,CLOSE,2.1,0 ),COLOR999999; STICKLINE(CLOSE= REF(CLOSE,1) ,OPEN,CLOSE,1.5,0 ),COLORBBBBBB; STICKLINE(CLOSE= REF(CLOSE,1) ,OPEN,CLOSE,0.9,0 ),COLORDDDDDD; STICKLINE(CLOSE= REF(CLOSE,1) ,OPEN,CLOSE,0.3,0 ),COLORFFFFFF; STICKLINE(CLOSE< REF(CLOSE,1) ,HIGH,LOW,0,1 ),COLORCYAN;STICKLINE(CLOSE< REF(CLOSE,1) ,OPEN,CLOSE,3,0 ),COLOR990000; STICKLINE(CLOSE< REF(CLOSE,1) ,OPEN,CLOSE,2.7,0 ),COLORCC0000; STICKLINE(CLOSE< REF(CLOSE,1) ,OPEN,CLOSE,2.1,0 ),COLORFF4400; STICKLINE(CLOSE< REF(CLOSE,1) ,OPEN,CLOSE,1.5,0 ),COLORFF8800; STICKLINE(CLOSE< REF(CLOSE,1) ,OPEN,CLOSE,0.9,0 ),COLORFFCC00; STICKLINE(CLOSE< REF(CLOSE,1) ,OPEN,CLOSE,0.3,0 ),COLORCYAN;趋势射线3X: DRAWLINE(L=LLV(L,3),L,C=HHV(C,3),L,0),COLOR9A90FF;趋势射线7: DRAWLINE(H=HHV(H,7),H,L=LLV(L,7),L,0),COLOR9AFF89;射线7X: DRAWLINE(L=LLV(L,7),L,H=HHV(H,7),L,0),COLOR9AFF89;趋势射线21: DRAWLINE(H=HHV(H,21),H,L=LLV(L,21),L,0),COLORC100FF; 射线21X: DRAWLINE(L=LLV(L,21),L,H=HHV(H,21),L,0),COLORC100FF;趋势射线35: DRAWLINE(H=HHV(H,35),H,L=LLV(L,35),L,0),COLORC1005B; 射线35X: DRAWLINE(L=LLV(L,35),L,H=HHV(H,35),L,0),COLORC1005B;趋势射线49: DRAWLINE(H=HHV(H,49),H,L=LLV(L,49),L,0),COLORYELLOW; 射线49X: DRAWLINE(L=LLV(L,49),L,H=HHV(H,49),L,0),COLORYELLOW; AA:=(REF(CLOSE,1)+REF(CLOSE,2)+OPEN)/3;DRAWTEXT_FIX(CURRBARSCOUNT=1,0.8,0.05,1,'今日保护价'),LINETHICK2,COLOR00FFFF;DRAWNUMBER_FIX(CURRBARSCOUNT=1,0.84,0.05,1,AA);DRAWTEXT_FIX(CURRBARSCOUNT=1,0.86,0.05,1,'元');重心:(2*C+H+L)/4,COLOR00FFFF,LINETHICK0;SJ:=WMA((重心-LLV(L,5))/(HHV(H,5)-LLV(L,5))*100,2);ZJ:=WMA(0.618*REF(SJ,1)+0.382*SJ,2);DRAWTEXT(CROSS(SJ,ZJ) AND SJ<30,L-0.3,'★'),COLOR00FFFF; DRAWTEXT(CROSS(ZJ,SJ) AND SJ>70,H+0.2,'★'),COLORFFFF00;A1:=EMA(C,14),COLORA2A200,LINETHICK1;A1X:=(A1-REF(A1,1))/REF(A1,1)*100,NODRAW;突破:REF(EMA(C,14),1),NODRAW;距离:(C-突破)/突破*100,NODRAW;出击:IF(A1X>=0,REF(EMA(C,14),BARSLAST(CROSS(A1X,0))+1),DRAWNULL),CO LORB000B0,LINETHICK1;休假:IF(A1X<0,REF(EMA(C,14),BARSLAST(CROSS(0,A1X))+1),DRAWNULL),COL ORFFFF00,LINETHICK1;涨幅:IF(A1X>=0,(C-出击)/出击*100,DRAWNULL)NODRAW;跌幅:IF(A1X<0,(C-休假)/休假*100,DRAWNULL)NODRAW;♂10%:IF(H>=出击*1.1,出击*1.1,DRAWNULL),COLORRED,DOTLINE,LINETHICK1;♂20%:IF(H>=出击*1.2,出击*1.2,DRAWNULL),COLORRED,DOTLINE,LINETHICK1;♂30%:IF(H>=出击*1.3,出击*1.3,DRAWNULL),COLORRED,DOTLINE,LINETHICK1;♀Ⅰ:IF(L<休假*0.9,休假*0.9,DRAWNULL),COLORGREEN,DOTLINE,LINETHICK1;♀Ⅱ:IF(L<休假*0.8,休假*0.8,DRAWNULL),COLORGREEN,DOTLINE,LINETHICK1;♀Ⅲ:IF(L<休假*0.7,休假*0.7,DRAWNULL),COLORGREEN,DOTLINE,LINETHICK1;STICKLINE(CROSS(A1X,0),C,O,2,0),COLOR00FFFF;STICKLINE(CROSS(0,A1X),C,O,2,0),COLOR606000;STICKLINE(CROSS(A1X,0)ORCROSS(0,A1X),REF(EMA(C,14),1),REF(EMA(C,14),1)*0.998,3,0),COLOR3C3C3 C;STICKLINE(ISLASTBAR,REF(EMA(C,14),1),REF(EMA(C,14),1)*0.998,3,0),COL OR00FFFF;A11:DRAWLINE(HIGH>=HHV(HIGH,5),HIGH,LOW<=LLV(LOW,5),LOW,0),CO LORA2A200;B1:DRAWLINE(LOW<=LLV(LOW,5),LOW,HIGH>=HHV(HIGH,5),HIGH,0),COL OR0000FF;A2:DRAWLINE(HIGH>=HHV(HIGH,13),HIGH,LOW<=LLV(LOW,13),LOW,0),C OLORA2A200;B2:DRAWLINE(LOW<=LLV(LOW,13),LOW,HIGH>=HHV(HIGH,13),HIGH,0),C OLOR0000FF;A3:DRAWLINE(HIGH>=HHV(HIGH,34),HIGH,LOW<=LLV(LOW,34),LOW,0),C OLORA2A200;B3:DRAWLINE(LOW<=LLV(LOW,34),LOW,HIGH>=HHV(HIGH,34),HIGH,0),C OLOR0000FF;A4:DRAWLINE(HIGH>=HHV(HIGH,55),HIGH,LOW<=LLV(LOW,55),LOW,0),C OLORA2A200;B4:DRAWLINE(LOW<=LLV(LOW,55),LOW,HIGH>=HHV(HIGH,55),HIGH,0),C OLOR0000FF;{MTM:=C-REF(C,1);}ZLGJ:=100*EMA(EMA(MTM,N1),N1)/EMA(EMA(ABS(MTM),N1),N1);买1:=IF(LLV(ZLGJ,2)=LLV(ZLGJ,7) AND COUNT(ZLGJ<0,2) ANDCROSS(ZLGJ,MA(ZLGJ,2)),1,0);卖1:=IF(HHV(ZLGJ,2)=HHV(ZLGJ,7) AND COUNT(ZLGJ>50,2) AND CROSS(MA(ZLGJ,2),ZLGJ),1,0);DRAWICON(FILTER(买1=1,5),LOW*0.96,34),COLORRED;STICKLINE(FILTER(买1=1,5),C,O,1,0),COLORRED;DRAWICON(FILTER(卖1=1,1),H*1.03,35),COLOR646400;STICKLINE(FILTER(卖1=1,1),C,O,1,0),COLOR646400;{RSV:=(C-LLV(L,9))/(HHV(H,9)-LLV(L,9))*100;K:=SMA(RSV,3,1);D:=SMA(K,3,1);J:=3*K-2*D;}BDGD:=HHV(J,2)=HHV(J,8) AND J>80;注意:=IF(CROSS(REF(J-0.01,1),J) AND REF(BDGD,1),1,0);DRAWTEXT(注意AND 卖1<1,HIGH*1.01,'★'),COLORFFFF00,LINETHICK3; STICKLINE(注意AND 卖1<1,O,CLOSE,1,0),COLOR646400,LINETHICK2;时间窗口01:=FILTER(IF(HHVBARS(HIGH,5),0,H),5),COLORFFFF00; DRAWTEXT(时间窗口01,HIGH*0.99,'5');时间窗口02:=FILTER(IF(LLVBARS(LOW,5),0,L),5),COLOR00FFFF; DRAWTEXT(时间窗口02,LOW*0.99,'5');时间窗口1:=FILTER(IF(HHVBARS(HIGH,13),0,1),13),COLOR00FF00; DRAWTEXT(时间窗口1,HIGH*0.99,'13');时间窗口2:=FILTER(IF(LLVBARS(LOW,13),0,1),13),COLOR0000FF; DRAWTEXT(时间窗口2,LOW*0.99,'13');时间窗口3:=FILTER(IF(HHVBARS(HIGH,34),0,2),34),COLOR55FF55; DRAWTEXT(时间窗口3,HIGH*0.99,'34');时间窗口4:=FILTER(IF(LLVBARS(LOW,34),0,2),34),COLOR5555FF; DRAWTEXT(时间窗口4,LOW*0.99,'34');时间窗口5:=FILTER(IF(HHVBARS(HIGH,55),0,30),55),COLOR99FF99; DRAWTEXT(时间窗口5,HIGH*0.99,'55');时间窗口6:=FILTER(IF(LLVBARS(LOW,55),0,30),55),COLORDD00FF; DRAWTEXT(时间窗口6,LOW*0.99,'55');时间窗口7:=FILTER(IF(HHVBARS(HIGH,89),0,40),89),COLORDDFFDD; DRAWTEXT(时间窗口7,HIGH*0.99,'89');时间窗口8:=FILTER(IF(LLVBARS(LOW,89),0,40),89),COLOR0055FF; DRAWTEXT(时间窗口8,LOW*0.99,'89');时间窗口9:=FILTER(IF(HHVBARS(HIGH,144),0,50),144),COLORDDFF00; DRAWTEXT(时间窗口9,HIGH*0.99,'144');时间窗口10:=FILTER(IF(LLVBARS(LOW,144),0,50),144),COLOR9955FF; DRAWTEXT(时间窗口10,LOW*0.99,'144');时间窗口11:=FILTER(IF(HHVBARS(HIGH,233),0,60),233),COLORDDFFFF; DRAWTEXT(时间窗口11,HIGH*0.99,'233');时间窗口12:=FILTER(IF(LLVBARS(LOW,233),0,60),233),COLORFF55FF; DRAWTEXT(时间窗口12,LOW*0.99,'233');ARE4:=MA(C,20); ARE5:=(C>MA(C,5)); ARE6:=(MA(C,5)>MA(C,10));ARE7:=(C>MA(C,10));ARE8:=(MA(C,5)>MA(C,20)); ARE9:=(C>MA(C,20)); ARE10:=REF(ARE4,1); ARE11:=(ARE4>ARE10);AVX:=(((((IF(ARE5,10,(0-10))+IF(ARE6,10,(0-10)))+IF(ARE7,10,(0-10)))+IF( ARE8,10,(0-10)))+IF(ARE9,10,(0-10)))+IF(ARE11,10,(0-10)));DSLX:=(C/INDEXC); DSLX1:=MA(DSLX,5); DSLX2:=MA(DSLX,10);VRE1:=MA(V,5); VRE2:=MA(V,10);阻力位:=IF((C>200),(C*1.01),(C*1.07)); 阻力位1:=IF((C<10),(C*1.05),阻力位);止损位:=IF((C>200),(C*0.99),(C*0.93)); 止损位1:=IF((C<10),(C*0.95),止损位);TJTS1:=ISLASTBAR AND C<500; TJTS2:=ISLASTBAR AND C>500;KDAT:=REFDATE(HHV(H,45)/1.01,DATE);{解盘位置}解盘1:=CONST(IF(TJTS1 AND ((CROSS(AVX,1) AND (VRE1 >= VRE2)) AND (DSLX >= DSLX1)) ,1,0));解盘2:=CONST(IF(TJTS1 AND ((CROSS(AVX,1) AND (VRE1 < VRE2)) AND (DSLX >= DSLX1)) ,1,0));解盘3:=CONST(IF(TJTS1 AND ((CROSS(AVX,1) AND (VRE1 > VRE2)) AND (DSLX < DSLX1)) ,1,0));解盘4:=CONST(IF(TJTS1 AND ((CROSS(AVX,1) AND (VRE1 <= VRE2)) AND (DSLX < DSLX1)) ,1,0));解盘5:=CONST(IF(TJTS1 AND ((CROSS(1,AVX) AND (VRE1 >= VRE2)) AND (DSLX >= DSLX1)) ,1,0));解盘6:=CONST(IF(TJTS1 AND ((CROSS(1,AVX) AND (VRE1 < VRE2)) AND (DSLX >= DSLX1)) ,1,0));解盘7:=CONST(IF(TJTS1 AND ((CROSS(1,AVX) AND (VRE1 >= VRE2)) AND (DSLX < DSLX1)) ,1,0));解盘8:=CONST(IF(TJTS1 AND ((CROSS(1,AVX) AND (VRE1 < VRE2)) AND (DSLX < DSLX1)) ,1,0));解盘9:=CONST(IF(TJTS1 AND ((((AVX >= 1) AND (REF(AVX,1) > 0)) AND (VRE1 >= VRE2)) AND (DSLX >= DSLX1)) ,1,0));解盘10:=CONST(IF(TJTS1 AND ((((AVX >= 1) AND (REF(AVX,1) > 0)) AND (VRE1 < VRE2)) AND (DSLX >= DSLX1)) ,1,0));解盘11:=CONST(IF(TJTS1 AND ((((AVX >= 1) AND (REF(AVX,1) > 0)) AND (VRE1 >= VRE2)) AND (DSLX < DSLX1)) ,1,0));解盘12:=CONST(IF(TJTS1 AND ((((AVX >= 1) AND (REF(AVX,1) > 0)) AND (VRE1 < VRE2)) AND (DSLX < DSLX1)) ,1,0));解盘13:=CONST(IF(TJTS1 AND ((((AVX < 1) AND (REF(AVX,1) < 0)) AND (VRE1 >= VRE2)) AND (DSLX >= DSLX1)) ,1,0));解盘14:=CONST(IF(TJTS1 AND ((((AVX < 1) AND (REF(AVX,1) < 0)) AND (VRE1 < VRE2)) AND (DSLX >= DSLX1)) ,1,0));解盘15:=CONST(IF(TJTS1 AND ((((AVX < 1) AND (REF(AVX,1) < 0)) AND (VRE1 >= VRE2)) AND (DSLX < DSLX1)) ,1,0));解盘16:=CONST(IF(TJTS1 AND ((((AVX < 1) AND (REF(AVX,1) < 0)) AND (VRE1 < VRE2)) AND (DSLX < DSLX1)) ,1,0));解盘17:=CONST(IF(TJTS2 AND (CROSS(AVX,1) AND (VRE1 >= VRE2)) ,1,0)); 解盘18:=CONST(IF(TJTS2 AND (CROSS(AVX,1) AND (VRE1 >= VRE2)) ,1,0)); 解盘19:=CONST(IF(TJTS2 AND (CROSS(AVX,1) AND (VRE1 < VRE2)) ,1,0)); 解盘20:=CONST(IF(TJTS2 AND (CROSS(AVX,1) AND (VRE1 < VRE2)) ,1,0)); 解盘21:=CONST(IF(TJTS2 AND (CROSS(1,AVX) AND (VRE1 >= VRE2)) ,1,0)); 解盘22:=CONST(IF(TJTS2 AND (CROSS(1,AVX) AND (VRE1 < VRE2)) ,1,0)); 解盘23:=CONST(IF(TJTS2 AND (((AVX >= 1) AND (REF(AVX,1) > 0)) AND (VRE1 >= VRE2)) ,1,0));解盘24:=CONST(IF(TJTS2 AND (((AVX >= 1) AND (REF(AVX,1) > 0)) AND (VRE1 < VRE2)) ,1,0));解盘25:=CONST(IF(TJTS2 AND (((AVX < 1) AND (REF(AVX,1) < 0)) AND(VRE1 >= VRE2)) ,1,0));解盘26:=CONST(IF(TJTS2 AND (((AVX < 1) AND (REF(AVX,1) < 0)) AND (VRE1 < VRE2)) ,1,0));解盘文字1:=IF(解盘1=1,'该股的量能理想,有明显走强迹象,可以考虑中线进场参与,仓位在2/3左右',IF(解盘2=1,'该股虽然走势趋强,但量能还显不足,可以考虑短线进场,仓位在1/2左右',IF(解盘3=1,'该股量价配合良好,但相对其它股票并没有明显走强,可以考虑短线进场,仓位1/2左右',IF(解盘4=1,'该股形态尚可,但量能不足,股票也未完全走强,可以短线参与,仓位1/3左右',IF(解盘5=1,'该股形态变坏,但走势相对其它股票尚可,重仓者减持大半,清仓者可以观望',IF(解盘6=1,'该股随大盘一起下跌,程明显缩量走势,考虑到大盘风险,减持或清仓',IF(解盘7=1,'该股放量下跌,走势明显偏弱,离场观望',IF(解盘8=1,'该股缩量下跌,走势偏弱,离场观望',IF(解盘9=1,'该股形态良好,强势明显,量能充足,可以继续持有',IF(解盘10=1,'该股上行趋势不变,强势依然,但量能开始转弱,注意风险',IF(解盘11=1,'该股仍然具备上涨潜力,但股性偏弱,可考虑减仓',IF(解盘12=1,'该股走势趋弱,量能不足,减持大部分筹码',IF(解盘13=1,'该股形态不佳,注意成交量的变化,但目前不适合参与',IF(解盘14=1,'该股趋势不明,股价偏弱,注意量能变化,目前不宜参与',IF(解盘15=1,'该股有走强迹象,但量能不足,趋势不明,不适合操作',IF(解盘17=1,'大盘量能理想,有明显走强迹象,可以考虑中线进场参与,仓位在2/3左右',IF(解盘19=1,'大盘虽然走势趋强,但量能还显不足,如果前期经过一轮下跌', IF(解盘21=1,'大盘形态走坏,重仓者可以减去大部分仓位',IF(解盘22=1,'大盘缩量调整,注意风险,短线清仓观望',IF(解盘23=1,'大盘走势良好,量能理想,可以继续持有强势股',IF(解盘24=1,'大盘形态良好,但量能稍显不足,随时准备减仓',IF(解盘25=1,'大盘趋势不明,注意成交量变化,目前不适宜进场',IF(解盘26=1,'大盘趋势向下,量能萎缩,不适合进场',DRAWNULL)))))))))))))))))))))));解盘文字2:=IF(解盘16=1,'该股走势太弱,没有参与价值',IF(解盘18=1,' 如前期经过一轮下跌,此时为最佳买点,但如果前期有过一段涨幅则介入需谨慎', IF(解盘20=1,' 可以考虑短线进场,仓位在1/2左右,一旦量能放大可以加仓买入',DRAWNULL)));DRAWTEXT(CURRBARSCOUNT=60{位置} AND (解盘1=1 OR 解盘2=1 OR 解盘3=1 OR 解盘4=1 OR 解盘5=1 OR 解盘6=1 OR 解盘7=1 OR解盘8=1 OR 解盘9=1 OR 解盘10=1 OR 解盘11=1 OR 解盘12=1 OR 解盘13=1 OR 解盘14=1 OR 解盘15=1 OR 解盘17=1 OR解盘19=1 OR 解盘21=1 OR 解盘22=1 OR 解盘23=1 OR 解盘24=1 OR 解盘25=1 OR 解盘26=1),(KDAT*0.99),解盘文字1),COLOR00FFFF;DRAWTEXT(CURRBARSCOUNT=60{位置} AND (解盘16=1 OR 解盘18=1 OR 解盘20=1),IF(解盘18=1 OR 解盘20=1,KDAT*0.98,KDAT*0.96),解盘文字2),COLOR00FFFF;{A1:=REF(HIGH,3)=HHV(HIGH,2*3+1);B1:=FILTER(A1,3);}C1:=BACKSET(B1,3+1);D1:=FILTER(C1,3);{高点}}{A2:=REF(LOW,3)=LLV(LOW,2*3+1);B2:=FILTER(A2,3);}C2:=BACKSET(B2,3+1);D2:=FILTER(C2,3);{低点}E1:=(REF(LLV(LOW,2*3),1)+REF(HHV(HIGH,2*3),1))/2;E2:=(HIGH+LOW)/2;{高低点出现在同一K线上时可作取舍}H1:=(D1 AND NOT(D2 AND E1>=E2)) OR ISLASTBAR ORBARSCOUNT(CLOSE)=1;H2:=D1 AND NOT(D2 AND E1>=E2);L1:=D2 AND NOT(D1 AND E1=E2);{X1:=REF(BARSLAST(H1),1)+1; }F1:=BACKSET(H1 AND COUNT(L1,X1)>0,LLVBARS(IF(L1,LOW,10000),X1)); G1:=F1>REF(F1,1);I1:=BACKSET(G1,2);LD:=I1>REF(I1,1);{过滤后低点}L2:=LD OR ISLASTBAR OR BARSCOUNT(CLOSE)=1;X2:=REF(BARSLAST(L2),1)+1;F2:=BACKSET(L2 AND COUNT(H2,X2)>0,HHVBARS(IF(H2,HIGH,0),X2));G2:=F2>REF(F2,1);I2:=BACKSET(G2,2);HD:=I2>REF(I2,1);{过滤后高点}J1:=BACKSET(ISLASTBAR,MIN(BARSLAST(HD),BARSLAST(LD))+1);J2:=J1>REF(J1,1);{A3:=H;B3:=REF(H,REF(BARSLAST(HD),1)+1)>REF(H,REF(BARSLAST(HD),1)+2+REF (BARSLAST(HD),REF(BARSLAST(HD),1)+2));}D3:=A3 AND B3 AND HD;E3:=BACKSET(D3,REF(BARSLAST(HD),1)+2);HH:=E3>REF(E3,1);{找出全部长期高点}{A4:=L>REF(L,REF(BARSLAST(LD),1)+1);B4:=REF(L,REF(BARSLAST(LD),1)+1);}D4:=A4 AND B4 AND LD;E4:=BACKSET(D4,REF(BARSLAST(LD),1)+2); LL:=E4>REF(E4,1);{找出全部长期低点}DRAWICON(HH,H*1.01,8);DRAWICON(LL,L*0.999,7);H3:=HH OR ISLASTBAR OR BARSCOUNT(C)=1; {后面进行过滤,方法同前。
通达信指标公式源码量价趋势
通达信指标公式源码量价趋势
量价趋势指标公式的源码如下:
变量定义:
-VAR1:价格的变化值,即当前价格减去前一天的价格
-VAR2:价格的变化幅度,即VAR1除以前一天的价格
-VAR3:量价趋势指标的计算结果
公式源码:
```
REF(CLOSE,1)=P
VAR1=P-REF(CLOSE,1)
VAR2=VAR1/REF(CLOSE,1)
VAR3=SMA(VAR2,3,1)
```
代码解释:
-REF(CLOSE,1)表示前一天的收盘价,用P表示
-VAR1表示价格的变化值
-VAR2表示价格的变化幅度,即VAR1除以前一天的价格
-VAR3表示量价趋势指标的计算结果,即VAR2的3日简单移动平均
量价趋势指标可以通过观察其数值变化来判断市场的趋势。
当量价趋势指标上升时,表示当前价格的变化幅度较大,市场处于上涨趋势;当量价趋势指标下降时,表示当前价格的变化幅度较小,市场处于下跌趋势。
通过对量价趋势指标的分析,可以帮助投资者更好地把握市场的动向,作出相应的交易决策。
通达信趋势通道源码指标
通达信趋势通道源码指标通达信趋势通道源码指标是指在通达信软件中使用的一种趋势指标,可以通过计算最高价和最低价的移动平均线来确定股价的趋势方向和范围。
以下是通达信趋势通道源码指标的示例代码:```引用库文件:#include "stdafx.h"#include "trend.h"#include <math.h>函数实现:/***************************************************** *******************//* 计算指定周期的趋势通道 */ /***************************************************** *******************/BOOL CalcTrendLine(Line &l,float arr[], int bPos, int ePos,int n,float fGAP, BOOL bUseMax){float fHIGH,fLOW,fHigh,fLow;BOOL bOpen = FALSE; //开仓for(int i=n-1; i< ePos; i++){fHIGH = arr[i-n];fLOW = arr[i-n];for(int j=i-n+1; j<=i; j++){fHigh = arr[j];fLow = arr[j];if(fHigh>fHIGH)fHIGH = fHigh;if(fLow<fLOW)fLOW = fLow;}if(bOpen){if(bUseMax)fLow = __max(fLow, (1+fGAP)*l.flPRC[i-1]);elsefHigh = __min(fHigh, (1-fGAP)*l.flPRC[i-1]);}else{fLow = (1+fGAP)*fLOW;fHigh = (1-fGAP)*fHIGH;if(fHigh<arr[i]){bOpen = TRUE;}else if(fLow>arr[i])bOpen = FALSE;}int nIndex = i - bPos;if(nIndex>=0){l.flHigh[nIndex] = fHigh;l.flLow[nIndex] = fLow;}}l.nNum = ePos - bPos;return TRUE;}发布。
通达信指标公式源码 超赢天下 不用太操心赚钱的买卖趋势指标
看长作短。
日K变蓝色卖出,K线上面提示卖字的要减仓,所有信号以准备收盘为准,买入看买字卖出看60分钟变蓝色卖出,然后60分钟变回黄色,K线还是黄色就继续买入JJ:=(CLOSE+HIGH+LOW)/3;A:=EMA(JJ,10);B:=REF(A,1);STICKLINE(A>B,A,B,5,0),COLORYELLOW;STICKLINE(A<B,A,B,5,0),COLORBLUE;M1:EMA(CLOSE,3);M2:EMA(CLOSE,8);M3:EMA(M2,13);M4:EMA(M2,55);VAR1:=EMA(M3,55);M5:EMA(M4,81), COLORRED,LINETHICK2;VAR2:=(REF(HIGH,1)+REF(LOW,1))/2;VAR3:=MA(CLOSE,21)+2*STD(CLOSE,21);DRAWICON(CROSS(VAR2,VAR3),HIGH*1.035,2);DRAWTEXT(CROSS(VAR2,VAR3),HIGH*1.02,'卖出'), COLORGREEN;VAR4:=REF(CLOSE,1);VAR5:=SMA(MAX(CLOSE-VAR4,0),7,1)/SMA(ABS(CLOSE-VAR4),7,1)*100; VAR6:=CROSS(79,VAR5);VAR7:=FILTER(VAR6,4);DRAWICON(VAR7,HIGH*1.035,2);DRAWTEXT(VAR7,HIGH*1.02,'卖出'), COLORGREEN;A7:=(2*C+H+L)/4;VAR10:=LLV(LOW,34);VAR11:=HHV(HIGH,34);SK:=EMA((A7-VAR1)/(VAR2-VAR1)*100,7);SD:=EMA(0.667*REF(SK,1)+0.333*SK,5);DRAWTEXT(IF(COUNT(CLOSE<REF(CLOSE,1),8)/8>6/10 ANDVOL>=1.5*MA(VOL,5) ANDCOUNT(SK>=SD,3) AND REF(LOW,1)=LLV(LOW,120),1,0),LOW,'●买进') ,COLORRED;DRAWTEXT(IF(COUNT(CLOSE<REF(CLOSE,1),13)/13>6/10 ANDCOUNT(SK>SD,6) AND REF(LOW,5)=LLV(LOW,120) ANDREF(CLOSE>=OPEN,4) ANDREF(CLOSE>OPEN,3) AND REF(CLOSE>OPEN,2) AND REF(OPEN>CLOSE,1) ANDOPEN>REF(CLOSE,1),1,0),LOW,'●买进'), COLORRED;D:=MA(CLOSE,80)-MA(CLOSE,10)/3;DRAWTEXT(IF(CLOSE<D AND VOL/240>MA(VOL,5)/240 ANDCLOSE>REF(CLOSE,1)*1.08AND CLOSE<MA(CLOSE,13)*1.3,1,0),LOW,'●抄底'),COLORRED; DRAWTEXT_FIX(1=1,0,0,0,'日K变蓝色卖出,K线上面提示卖字的要减仓,所有信号以准备收盘为准买入看买字'),COLORGREEN,LINETHICK4; DRAWTEXT_FIX(CURRBARSCOUNT=1,0,0.050,0,'卖出看60分钟变蓝色卖出,然后60分钟变回黄色,K线还是黄色就继续买入'),COLORGREEN,LINETHICK4;。
通达信指标公式源码顶底趋势主图画线指标
顶底趋势主图画线指标N:=3;A1:=REF(H,N)=HHV(H,2*N+1);B1:=FILTER(A1,N);C1:=BACKSET(B1,N+1);D1:=FILTER(C1,N);{高点}A2:=REF(L,N)=LLV(L,2*N+1);B2:=FILTER(A2,N);C2:=BACKSET(B2,N+1);D2:=FILTER(C2,N);{低点}E1:=(REF(LLV(L,2*N),1)+REF(HHV(H,2*N),1))/2;E2:=(H+L)/2;{高低点出现在同一K线上时可作取舍}H1:=(D1 AND NOT(D2 AND E1>=E2)) OR ISLASTBAR OR BARSCOUNT(C)=1; L1:=(D2 AND NOT(D1 AND E1<E2));H2:=D1 AND NOT(D2 AND E1>=E2);X1:=REF(BARSLAST(H1),1)+1;F1:=BACKSET(H1 AND COUNT(L1,X1)>0,LLVBARS(IF(L1,L,10000),X1));G1:=F1>REF(F1,1);I1:=BACKSET(G1,2);LD:=I1>REF(I1,1),LINETHICK0;{过滤后低点}L2:=LD OR ISLASTBAR OR BARSCOUNT(C)=1;X2:=REF(BARSLAST(L2),1)+1;F2:=BACKSET(L2 AND COUNT(H2,X2)>0,HHVBARS(IF(H2,H,0),X2));G2:=F2>REF(F2,1);I2:=BACKSET(G2,2);HD:=I2>REF(I2,1),LINETHICK0;{过滤后高点}R1:=BACKSET(ISLASTBAR,BARSLAST(HD)+1);S1:=R1>REF(R1,1);{前一高}T1:=BACKSET(ISLASTBAR,BARSLAST(LD)+1);U1:=T1>REF(T1,1);{前一低}R2:=BACKSET(S1,REF(BARSLAST(HD),1)+2);S2:=R2>REF(R2,1);{前二高}T2:=BACKSET(U1,REF(BARSLAST(LD),1)+2);U2:=T2>REF(T2,1);{前二低}T3:=BACKSET(U2,REF(BARSLAST(LD),1)+2);U3:=T3>REF(T3,1);{前三低}T4:=BACKSET(U3,REF(BARSLAST(LD),1)+2);U4:=T4>REF(T4,1);{前四低}R3:=BACKSET(S2,REF(BARSLAST(HD),1)+2);S3:=R3>REF(R3,1);{前三高}R4:=BACKSET(S3,REF(BARSLAST(HD),1)+2);S4:=R4>REF(R4,1);{前四高}★压力1:DRAWLINE(S2,H,S1,H,1),COLORMAGENTA,LINETHICK1; ★支撑1:DRAWLINE(U2,L,U1,L,1),COLOR8FBC8F,LINETHICK1;★压力2:DRAWLINE(S3,H,S2,H,1),COLORFF8000;★支撑2:DRAWLINE(U3,L,U2,L,1),COLOR99CC32;★压力3:DRAWLINE(S4,H,S3,H,1),COLOR0000FF;★支撑3:DRAWLINE(U4,L,U3,L,1),COLOR00FF7F; DRAWICON(S2,H*1.01,10);DRAWICON(S3,H*1.01,10);DRAWNUMBER(S2,H*1.02,H),COLORCFB53B; DRAWNUMBER(S1,H*1.02,H),COLORCFB53B; DRAWNUMBER(S3,H*1.02,H),COLORCFB53B;DRAWICON(U1,L*0.99,11);DRAWICON(U2,L*0.99,11);DRAWICON(U3,L*0.99,11);DRAWICON(U4,L*0.99,11);DRAWNUMBER(U1,L*0.98,L),COLORCYAN;DRAWNUMBER(U2,L*0.98,L),COLORCYAN;DRAWNUMBER(U3,L*0.98,L),COLORCYAN;DRAWNUMBER(U4,L*0.98,L),COLORCYAN;。
完美趋势主图指标 通达信指标公式源码
通达信完美趋势主图指标经典指标_完美趋势,本人在用,用到未来函数,看趋势一流,不喜欢未来函数的可以不用,这里说一下未来函数可是好东东呀!{完美趋势P 5 50 30 N 1 100 8}HV1:=REF(H,P)=HHV(H,2*P+1);HV2:=FILTER(HV1,P);HV3:=BACKSET(HV2,P+1);HV4:=FILTER(HV3,P);R11:=BACKSET(ISLASTBAR,BARSLAST(HV4)+1);S11:=R11>REF(R11,1);BOH:DRAWLINE(HV4,H,S11,H,1),COLORBLUE;AA2:=REF(L,P)=LLV(L,2*P+1);BB2:=FILTER(AA2,P);CC2:=BACKSET(BB2,P+1);DD2:=FILTER(CC2,P);T11:=BACKSET(ISLASTBAR,BARSLAST(DD2)+1);U11:=T11>REF(T11,1);BOL:DRAWLINE(DD2,L,U11,L,1),COLORRED;BOV:=L<=BOL AND C>BOL;DRAWICON(BOV,L,1);M:=INTPART(3*N/5);AAA:=REF(H,M)=HHV(H,2*M+1);QYY:=BACKSET(AAA,M+1);CCC:=FILTER(QYY,M) AND H=HHV(H,M+1);DDDD:=BARSLAST(CCC),NODRAW;GDTSS:=IF(CCC,CURRBARSCOUNT,0);DINGBUTSS:=IF(DDDD,REF(GDTSS,DDDD),GDTSS);GDCS11:=CONST(DINGBUTSS);DINGBUTS11:=REF(DINGBUTSS,DDDD+1);GDCS22:=CONST(DINGBUTS11);AA11:=REF(L,M)=LLV(L,2*M+1);QY11:=BACKSET(AA11,M+1);CC11:=FILTER(QY11,M) AND L=LLV(L,M+1);DD11:=BARSLAST(CC11);DDTSS:=IF(CC11,CURRBARSCOUNT,0);DDTS11:=IF(DD11,REF(DDTSS,DD11),DDTSS);DDCS11:=CONST(DDTS11);DDTS22:=REF(DDTS11,DD11+1);DDCS22:=CONST(DDTS22);线1:DRAWLINE(CURRBARSCOUNT=GDCS22,H,CURRBARSCOUNT=GDCS11,H,1),COLORFF AA99,LINETHICK1;线2:DRAWLINE(CURRBARSCOUNT=DDCS22,L,CURRBARSCOUNT=DDCS11,L,1) COLOR9966FF,LINETHICK1;{}预报:H>=线1 AND REF(H<线1,1),NODRAW; 预警:L<=线2 AND REF(L>线2 ,1),NODRAW;STICKLINE(预报,O,C,3,0),COLOR00FFFF; STICKLINE(预警,O,C,3,0),COLORFF0033;。
趋势跟踪通达信指标公式源码
DRAWGBK(C>0, RGB(0,0,00),RGB(0,0,0),0,'竹',0);DRAWNUMBER(ISLASTBAR ,C,C),COLORMAGENTA;SJTJ:=DATE<1590301;AA:=ABS((2*CLOSE+HIGH+LOW)/4-MA(CLOSE,30))/MA(CLOSE,30);长期趋势线:=DMA((2*CLOSE+LOW+HIGH)/4,AA);CC:=(CLOSE/长期趋势线);MA1:=MA(CC*(2*CLOSE+HIGH+LOW)/4,3);MAAA:=((MA1-长期趋势线)/长期趋势线)/3;TMP:=MA1-MAAA*MA1;长期趋势上升:IF(TMP>长期趋势线,长期趋势线,DRAWNULL),LINETHICK4,COLORRED;IF(TMP>长期趋势线,长期趋势线,DRAWNULL),COLORYELLOW,POINTDOT,LINETHICK4;长期趋势下降:IF(TMP<=长期趋势线,长期趋势线,DRAWNULL),LINETHICK4,COLORGREEN; IF(TMP<=长期趋势线,长期趋势线,DRAWNULL),COLORBLUE,POINTDOT,LINETHICK4; HZS:=CROSS(TMP,长期趋势线);LZS:=CROSS(长期趋势线,TMP);DRAWICON(HZS,长期趋势线-0.1,23);DRAWICON(LZS,长期趋势线+0.1,24);{DRAWICON(TMP<=长期趋势线AND NOT(LZS),长期趋势线-0.1,14)}; {DRAWICON(TMP>长期趋势线AND NOT(HZS),长期趋势线+0.1,13)};MAH:=(H*18+REF(H,1)*17+REF(H,2)*16+REF(H,3)*15+REF(H,4)*14+REF(H,5)*13+RE F(H,6)*12+REF(H,7)*11+REF(H,8)*10+REF(H,9)*9+REF(H,10)*8+REF(H,11)*7+REF(H, 12)*6+REF(H,13)*5+REF(H,14)*4+REF(H,15)*3+REF(H,16)*2+REF(H,17)*1)/171; MAL:=(L*18+REF(L,1)*17+REF(L,2)*16+REF(L,3)*15+REF(L,4)*14+REF(L,5)*13+REF( L,6)*12+REF(L,7)*11+REF(L,8)*10+REF(L,9)*9+REF(L,10)*8+REF(L,11)*7+REF(L,12)* 6+REF(L,13)*5+REF(L,14)*4+REF(L,15)*3+REF(L,16)*2+REF(L,17)*1)/171;MA5:=MA(CLOSE,5);MA10:=MA(CLOSE,10);MA20:=MA(CLOSE,20);MA60:=MA(CLOSE,60);DK:= SJTJ AND( CLOSE>=MAH OR (C>MA5 AND C>MA10 AND C>MA20 AND C>MA60)); KK:= SJTJ AND( MAL>CLOSE OR (C<MA5 AND C<MA10 AND C<MA20 AND C<MA60)); DK1:=BARSLAST(DK);KK1:=BARSLAST(KK);DK2:=BARSLAST(CROSS(KK1,DK1));KK2:=BARSLAST(CROSS(DK1,KK1));HS:=DK2<KK2;LS:=KK2<DK2;W2:=OPEN-CLOSE;HT:=IF(OPEN>CLOSE,OPEN,CLOSE);LT:=IF(OPEN<CLOSE,OPEN,CLOSE);STICKLINE(W2>0 AND HS,OPEN,CLOSE,2,0),COLORRED;STICKLINE(W2>0 AND HS,OPEN,H,0.0,0),COLORRED;STICKLINE(W2>0 AND HS,C,L,0.0,0),COLORRED;STICKLINE(W2<=0 AND HS,OPEN,CLOSE,2,1),COLORRED;STICKLINE(W2<=0 AND HS,O,L,0.0,0),COLORRED;STICKLINE(W2<=0 AND HS,C,H,0.0,0),COLORRED;STICKLINE(W2>0 AND LS,OPEN,CLOSE,2,0),COLORGREEN;STICKLINE(W2>0 AND LS,OPEN,H,0.0,0),COLORGREEN;STICKLINE(W2>0 AND LS,C,L,0.0,0),COLORGREEN;STICKLINE(W2<=0 AND LS,OPEN,CLOSE,2,1),COLORGREEN;STICKLINE(W2<=0 AND LS,C,H,0.0,0),COLORGREEN;STICKLINE(W2<=0 AND LS,O,L,0.0,0),COLORGREEN;DRAWICON(HS=1 AND REF(LS,1),LOW*0.995,34),COLORYELLOW;DRAWICON(LS=1 AND REF(HS,1),H*1.005,35),COLORYELLOW;DRAWNUMBER(ISLASTBAR AND LS,MAH,MAH),COLORYELLOW;DRAWNUMBER(ISLASTBAR AND HS,MAL,MAL),COLORYELLOW;趋势线:=(MAH+MAL)/2 COLORGREEN,,LINETHICK2;中级趋势上升:IF(HS,趋势线,DRAWNULL),LINETHICK2,COLORRED;中级趋势下降:IF(LS,趋势线,DRAWNULL),LINETHICK2,COLORGREEN;DRAWICON(HS,趋势线*0.995,1);DRAWICON(LS,趋势线*1.005,2);最新价:IF(SJTJ, C,DRAWNULL),LINETHICK0,COLORYELLOW; DRAWTEXT_FIX(C>0,0.004,1,0,EXTERNSTR(0,1)),COLORBLUE,LINETHICK2;。
量能趋势通达信指标公式源码
RV:=(CLOSE-LLV(LOW,27))/(HHV(HIGH,27)-LLV(LOW,27))*100;RG:=(CLOSE-LLV(LOW,5))/(HHV(HIGH,5)-LLV(LOW,5))*100;J0:=(HIGH+LOW)/2;QJ:=EMA(J0,3);J1:=IF(CLOSE>QJ,VOL,0);J2:=IF(CLOSE<QJ,VOL,0);量能:IF(CAPITAL<1,MA(VOL,74),MA(SUM(J1-J2,22),3)),COLOR00DDDD,NODRAW; 趋势:IF(CAPITAL<1,EMA(量能,360),EMA(量能,21)),COLOR008800,NODRAW; VAR3:=(量能-趋势);VAR44:=SMA(RV,3,1);VAR55:=SMA(VAR44,3,1);STICKLINE(VAR3>0,20,10,5,1),COLOR0000FF;STICKLINE(VAR3<0,100,90,10,1),COLOR00FF00;DRAWICON(CROSS(VAR44,VAR55) AND VAR55<30,2,1);DRAWICON(CROSS(VAR55,VAR44) AND VAR55>30,97,2);DRAWBAND(VAR55,RGB(0,22,224),VAR44,RGB(255,50,50));遵:IF(VAR55>=VAR44,VAR55,DRAWNULL),COLORRED;守:IF(VAR44>=VAR55,VAR44,DRAWNULL),COLORFF9900;纪:IF(VAR55>=VAR44,VAR44,DRAWNULL),COLOR00FFFF;律:IF(VAR44>=VAR55,VAR55,DRAWNULL),COLOR00FF00;KK:=EMA(SMA(RG,3,1),2),LINETHICK0;DD:=SMA(KK,3,1),LINETHICK0;DRAWBAND(KK,RGB(155,50,50),DD,RGB(0,100,50));持:IF(KK>=DD,KK,DRAWNULL),COLORRED;观:IF(DD>=KK,DD,DRAWNULL),COLORFF9900;股:IF(KK>=DD,DD,DRAWNULL),COLOR00FFFF;望:IF(DD>=KK,KK,DRAWNULL),COLOR00FF00;DRAWICON(CROSS(KK,DD),KK,23);DRAWTEXT(CROSS(VAR44,VAR55) AND CROSS(KK,DD),10,'共振'),COLOR00FFFF;共振点:=(CROSS(VAR44,VAR55) AND CROSS(KK,DD));STICKLINE(共振点>0,0,30,2,0),COLOR008888;STICKLINE(共振点>0,0,30,1.5,0),COLOR00AAAA;STICKLINE(共振点>0,0,30,0.8,0),COLOR00DDDD;STICKLINE(共振点>0,0,30,0.3,0),COLOR00FFFF;VAR1:=1;VAR2:=((((2*CLOSE)+HIGH)+LOW) / 4);低金叉进:20,COLORFF00FF,LINETHICK2;高死叉出:90,COLORBLUE,LINETHICK2;VAR4:=LLV(LOW,5);VAR5:=HHV(HIGH,4);C1:=(EMA((((VAR2-VAR4)/(VAR5-VAR4))*100),4)*VAR1),COLORFF00FF,LINETHICK2; C2:=(EMA(((0.667*REF(C1,1))+(0.333*C1)),2)*VAR1),COLORFFFFFF,LINETHICK2; 条件:=CROSS(C1,C2) AND C1<40;条件0:=CROSS(C2,C1) AND C1>90;TJ1:=CROSS(C1,C2);TJ2:=CROSS(C2,C1);TJ3:=CROSS(C1,C2) AND REF(C1,1)<20;TJ4:=CROSS(C2,C1) AND REF(C1,1)>80;DRAWTEXT(FILTER((REF(条件,1) AND (REF(LOW,1)>LOW OR TJ2))OR (REF(条件,2) AND (REF(LOW,2)>LLV(LOW,3) OR TJ2))OR (REF(条件,3) AND (REF(LOW,3)>LLV(LOW,4) OR TJ2)),4),70,'止'),COLORRED; {DRAWTEXT(FILTER((REF(条件,1) AND (REF(LOW,1)>LOW OR TJ2))OR (REF(条件,2) AND (REF(LOW,2)>LLV(LOW,3) OR TJ2))OR (REF(条件,3) AND (REF(LOW,3)>LLV(LOW,4) OR TJ2)),4),60,'跌'),COLORRED;} DRAWTEXT(FILTER((REF(条件,1) AND (REF(LOW,1)>LOW OR TJ2)) OR(REF(条件,2) AND (REF(LOW,2)>LLV(LOW,3) OR TJ2))OR (REF(条件,3) AND (REF(LOW,3)>LLV(LOW,4) OR TJ2)),4),65,'买'),COLORRED; DRAWTEXT(条件,20,'买'),COLORRED;STICKLINE(条件,0,20,2,0),COLORRED;DRAWTEXT(条件0,85,'卖'),COLORBLUE;DRAWTEXT(CROSS(C1,75),70,'险区'),COLORGREEN;DRAWTEXT(TJ3,65,'安'),COLORRED;DRAWTEXT(TJ3,60,'买'),COLORRED;DRAWTEXT(TJ4,85,'逃顶'),COLORBLUE;STICKLINE(TJ4,100,80,2,0),COLORGREEN;VAR200:=(CLOSE-LLV(LOW,20))/(HHV(HIGH,20)-LLV(LOW,20))*100; VAR300:=SMA(SMA(VAR200,3,1),3,1)/28.57;VAR400:=EMA(VAR300,5);操盘:=3*VAR300-2*VAR400;A1:=CROSS(操盘,VAR300) AND VAR300<2.1 AND C>O; STICKLINE(A1,20,0,4,0),COLOR770077;STICKLINE(A1,20,0,3,0),COLOR990099;STICKLINE(A1,20,0,2,0),COLORBB00BB;STICKLINE(A1,20,0,1,0),COLORDD00DD;STICKLINE(A1,20,0,0.3,0),COLORFF00FF;DRAWTEXT(A1,30,'财'),COLORFF00FF;★遵守纪律★:100,COLORRED,NODRAW;★交易之魂★:100,COLORRED,NODRAW;。
通达信指标公式源码 通达信趋势(副图源码)精品中的精品
X1:=(C+L+H)/1.5;X2:=EMA(X1,3);X3:=EMA(X2,2.5);DRAWICON(CROSS(X2,X3),L*0.98,9),COLORRED;STICKLINE(X2>=X3,LOW,HIGH,0,1),COLORRED;STICKLINE(X2>=X3,CLOSE,OPEN,3.2,2),COLORRED;STICKLINE(X2<X3,LOW,HIGH,0,1),COLOR00FF00;STICKLINE(X2<X3,CLOSE,OPEN,3.2,2),COLOR00FF00;STICKLINE(CROSS(X3,X2),OPEN,CLOSE,3.2,0),COLOR00FF00;STICKLINE(CROSS(X2,X3),OPEN,CLOSE,3.2,0),COLORRED;STICKLINE((CLOSE>OPEN) AND (X2<X3),CLOSE,OPEN,3.2,2)COLOR00FF00; STICKLINE((CLOSE>OPEN) AND (X2>=X3),CLOSE,OPEN,3.2,2)COLORRED; STICKLINE((CLOSE<OPEN) AND (X2<X3),CLOSE,OPEN,3.2,0)COLOR00FF00; STICKLINE((CLOSE<OPEN) AND (X2>=X3),CLOSE,OPEN,3.2,0)COLORRED;VAR1F:=(CLOSE-LLV(LOW,27))/(HHV(HIGH,27 )-LLV(LOW,27))*100;VAR20:=REVERSE(VAR1F);VAR21:=SMA(VAR1F,3,1);移动平均: SMA(VAR21,3,1), COLORRED;参考线: SMA(移动平均,3,1),COLORCYAN ;走势线:SMA(移动平均,2,1),COLORWHITE;关注: IF(CROSS(移动平均,参考线) AND 移动平均<30,33,0), COLORCYAN,LINETHICK2;风险: IF(CROSS(参考线,移动平均) AND 参考线>75,68,100) , COLORGREEN,LINETHICK2; DRAWTEXT(CROSS(移动平均,参考线) AND 移动平均<20,33,'☆--底位金叉') , COLORWHITE;A1:IF(CROSS(移动平均,参考线) AND 移动平均<70 AND 移动平均>40,移动平均*1.1,0),STICK,LINETHICK2,COLORRED;DRAWTEXT(A1,移动平均*1.1,'再次起飞'),LINETHICK2,COLORYELLOW;。
通达信指标公式源码 主力趋势 中线主图
{开始---主力趋势指标}MTM:=C-REF(C,1);主力做多:=100*EMA(EMA(MTM,9),9)/EMA(EMA(ABS(MTM),9),9),COLORWHITE; 多空趋势线:=MA(主力做多,5),COLORYELLOW;能量:=(主力做多-0)*1,COLORBLACK;持仓:=能量, COLORSTICK;{结束}VAR1:=(100 - ((90 * (HHV(HIGH,14) - CLOSE)) / (HHV(HIGH,14) -LLV(LOW,14))));VAR2:=(100 - ((90 * (HHV(HIGH,14) - CLOSE)) / (HHV(HIGH,14) -LLV(LOW,14))));VAR3:=(100 - MA(((100 * (HHV(HIGH,6) - CLOSE)) / (HHV(HIGH,6) - LLV(LOW,6))),34));DIR1:=ABS(CLOSE-REF(CLOSE,5));VIR1:=SUM(ABS(CLOSE-REF(CLOSE,1)),5);ER1:=DIR1/VIR1;CS1:=ER1*(0.8-2/8)+2/8;CQ1:=CS1*CS1;基线:EMA(DMA(CLOSE,CQ1),2) ,COLORWHITE;DIR2:=ABS(CLOSE-REF(CLOSE,10));VIR2:=SUM(ABS(CLOSE-REF(CLOSE,1)),10);ER2:=DIR2/VIR2;CS2:=ER2*(0.8-2/24)+2/24;CQ2:=CS2*CS2;观望:EMA(DMA(CLOSE,CQ2),2),COLORGREEN,LINETHICK2;高抛低吸:IF(观望/REF(观望,1)>0.997,观望,DRAWNULL),COLORYELLOW,LINETHICK2;持股:IF(观望/REF(观望,1)>1.001,观望,DRAWNULL),COLORRED,LINETHICK2; STICKLINE((VAR2 < MA(VAR3,6)) AND 主力做多>0,CLOSE,OPEN,3,1),COLOR008000;STICKLINE((VAR2 > MA(VAR3,6)) AND 主力做多>0,OPEN,CLOSE,3,1),COLORRED;STICKLINE(((OPEN > CLOSE) AND (VAR2 > MA(VAR3,6)) AND 主力做多>0),(OPEN * 0.998),(CLOSE * 1.0001),2.3,0),COLOR008000; STICKLINE(((OPEN < CLOSE) AND (VAR2 < MA(VAR3,6)) AND 主力做多>0),(CLOSE * 0.998),(OPEN * 1.002),2.3,0),COLORRED;STICKLINE(((OPEN > CLOSE) AND (VAR2 < MA(VAR3,6)) AND 主力做多>0),CLOSE,OPEN,2.3,0),COLORCYAN;{主图赋值结束}PT:=REF(H,1)-REF(L,1);CDP:=(REF(H,1)+REF(L,1)+REF(C,1)*2)/4;AH:=CDP+PT;AL:=CDP-PT;NH:=CDP*2-REF(L,1);NL:=CDP*2-REF(H,1);强:=IF(AH>REF(C,1)*1.1 ,REF(C,1)*1.1,AH),COLORMAGENTA;阻:=IF(NH>强,(强-CDP)*0.618+CDP ,NH),COLORCYAN;M:=IF(AL<REF(C,1)/1.1,REF(C,1)/1.1,AL);撑:=IF(NL<M,CDP-(CDP-M)*0.618 ,NL),COLORRED;底:=IF(AL<REF(C,1)/1.1,REF(C,1)/1.1 ,AL),COLORGREEN;{开始---主散分布图指标}机构持仓:=EMA(100*(CLOSE-LLV(LOW,34))/(HHV(HIGH,34)-LLV(LOW,34)),3),COLO RFF00FF;指数趋势:=EMA(1250*(INDEXC-LLV(INDEXL,34))/HHV(INDEXH,34)-LLV(INDEXL,34) ,3),COLORYELLOW,NODRAW;主力:=WINNER(C)*100,COLORRED;散户:= (WINNER(C*1.1)-WINNER(C*0.9))*100,COLORGREEN;强势:=(机构持仓+主力+散户)/2,COLORFF6699;强弱分界:=80,COLOR00FFFF;{结束}{开始----资金动向指标}PJJ:=DMA((H + L + C * 2) / 4,0.9);JJ:=REF(EMA(PJJ,3),1);QJJ:=VOL / ((H - L) * 2 - ABS(C - O));XVL:=IF(C > O,QJJ * (H - L),IF(C < O,QJJ * (H - O + (C - L)),VOL / 2)) +IF(C > O,0 - QJJ * (H - C + (O - L)),IF(C < O,0 - QJJ * (H - L),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;GJJ:=EMA(攻击流量,8);LLJX:=EMA(攻击流量,3);流量:=LLJX,COLORC875B7,NODRAW;流量基线:=GJJ,COLOR00BBBB;ZJLL:=REF(LLJX,1);QZJJ:=(((LLJX - ZJLL) / ZJLL) * 100);流量幅%:=IF(((LLJX > 0) AND (ZJLL < 0)),ABS(QZJJ),IF((((LLJX < 0) AND (ZJLL < 0)) AND (LLJX < ZJLL)),(0 - QZJJ),QZJJ))COLORWHITE,NODRAW;大单:=HSL / 1000,COLOR9B37FF,NODRAW;周流量:=SUM(LLJX,5),COLORFFBFDF,NODRAW;BB:=REF(周流量,1);ZQZJJ:=(周流量-BB)/BB*100;周幅%:=IF(周流量>0 AND BB<0,ABS(ZQZJJ),IF(周流量<0 AND BB<0 AND 周流量<BB,-ZQZJJ,ZQZJJ))COLORWHITE,NODRAW;{结束}{反转}VARZ1:=SUM(MAX(MAX(HIGH-LOW,ABS(HIGH-REF(CLOSE,1))),ABS(LOW-RE F(CLOSE,1))),25);VARZ2:=HIGH-REF(HIGH,1);VARZ3:=REF(LOW,1)-LOW;VARZ4:=SUM(IF(VARZ2>0 AND VARZ2>VARZ3,VARZ2,0),25);VARZ5:=SUM(IF(VARZ3>0 AND VARZ3>VARZ2,VARZ3,0),25);VARZ6:=VARZ4*100/VARZ1;VARZ7:=VARZ5*100/VARZ1;VARZ8:=MA(ABS(VARZ7-VARZ6)/(VARZ7+VARZ6)*100,15);VARZ9:=(VARZ8+REF(VARZ8,15))/2;A:=(VARZ7>VARZ6 AND VARZ7>25 AND VARZ6<25);B:=ZIG(3,50/5)*100,COLORWHITE;G:=MA(B,2),COLORYELLOW;D:=CROSS(B,G)*1000,COLORRED;W:=CROSS(G,B)*1000,COLORBLUE;E:=REF(INDEXC,1);F:=SMA(MAX(INDEXC-E,0),3,1)/SMA(ABS(INDEXC-E),3,1);VARZ10:=F AND F<8;VARZ11:=(CLOSE-LLV(LOW,9))/(HHV(HIGH,9)-LLV(LOW,9))*100;VARZ12:=SMA(VARZ11,3,1);VARZ13:=SMA(VARZ12,3,1);VARZ14:=VARZ13 AND VARZ13<20;MM:=A AND D AND VARZ10 AND VARZ14 ;XXX:=DRAWTEXT(W=1000,B*1.05,'卖' ),COLOR00FF00;XXY:=DRAWTEXT(D=1000,B*1.05,'买'),COLORRED;底1:=STICKLINE(D=1000 AND B*1.05,0,20,2,0),COLORRED;顶1:=STICKLINE(W=1000 AND B*1.05,0,20,2,0),COLORGREEN;{反转}日线:=(MA(CLOSE,3)+MA(CLOSE,5)+MA(CLOSE,10)+MA(CLOSE,20))/4;平均线:=MA(日线,2);{DRAWICON(CROSS(日线,平均线),平均线,1);DRAWICON(CROSS(平均线,日线),平均线,2);}{综合选股输出}顶部:=DRAWTEXT( 顶1 ,(HIGH+(HIGH*0.10)),'顶')COLORGREEN;底部:=DRAWTEXT( 底1 ,(LOW - (LOW*0.10)),'底')COLORRED;VAR11:=(2*CLOSE+HIGH+LOW)/4;VAR22:=EXPMA(EXPMA(EXPMA(VAR11,5),5),5);J:= (VAR22-REF(VAR22,1))/REF(VAR22,1)*100, COLORSTICK;多空:= MA(J,3);多头:= MA(J,1);{STICKLINE( UPNDAY(J,1)AND J>0,J ,0,1,0)COLORRED;STICKLINE( UPNDAY(J,1)AND J>0,J ,0,0.8,0)COLORLIRED;}买进:DRAWICON(CROSS(主力做多,0) ,(LOW - (LOW*0.06)),3);卖出:DRAWICON(CROSS(0,主力做多),(HIGH+ (HIGH*0.06)),4);风险:DRAWICON( DOWNNDAY(机构持仓,1) AND (CROSS(多空趋势线,主力做多) AND 主力做多>0) OR( 顶1 AND 主力做多>0),(HIGH+ (HIGH*0.06)),6);。