江湖术士 发表于 2023-10-24 21:40:07

通达信——精选指标《woodieCCI》指标源码

<p data-first-child></p><p >指标源码:</p><blockquote >STICKLINE(C,320,-320,5,0),COLOR80A16F,NODRAW;<br/> M:=14;Q:=6;N:=20;<br/> MM:=IF(PERIOD=1,M,IF(PERIOD=2,M,IF(PERIOD=3,M,IF(PERIOD=4,M,IF(PERIOD=5,M,IF(PERIOD=6,Q,IF(PERIOD=7,Q,IF(PERIOD=8,Q,0))))))));<br/> AVG:=(HIGH+LOW+CLOSE)/3;<br/> CCI:=(AVG-MA(AVG,MM))/(0.015*AVEDEV(AVG,MM));<br/> DIF:CCI-REF(CCI,1),LINETHICK0,COLOR00FF00;<br/> 前差值:ABS(REF(CCI,1)-REF(CCI,2)),NODRAW;<br/> 差值20:IF(DIF>15 AND DIF<120,DIF,0),NODRAW,COLOR0000FF;<br/> PI:=ATAN(1)*4;<br/> PERIODS:=30;<br/> HIGHHIGH:=HHV(HIGH,PERIODS);<br/> LOWLOW:=LLV(LOW,PERIODS);<br/> RANGEV:=25/(HIGHHIGH-LOWLOW)*LOWLOW;<br/> EMA20:=EMA(CLOSE,20);<br/> X1_EMA20:=0;<br/> X2_EMA20:=1;<br/> Y1_EMA20:=0;<br/> Y2_EMA20:=(REF(EMA20,1)-EMA20)/AVG*RANGEV;<br/> C_EMA20:=SQRT((X2_EMA20-X1_EMA20)*(X2_EMA20-X1_EMA20)+(Y2_EMA20-Y1_EMA20)*(Y2_EMA20-Y1_EMA20));<br/> ANGLE_EMA20V:=ROUND(ABS(180*ACOS((X2_EMA20-X1_EMA20)/C_EMA20)/PI));<br/> ANGLE_EMA20:=IF(Y2_EMA20>0,-ANGLE_EMA20V,ANGLE_EMA20V);<br/> LSMA25:=FORCAST(CLOSE,25);<br/> X1_LSMA25:=0;<br/> X2_LSMA25:=1;<br/> Y1_LSMA25:=0;<br/> Y2_LSMA25:=(REF(LSMA25,1)-LSMA25)/AVG*RANGEV;<br/> C_LSMA25:=SQRT((X2_LSMA25-X1_LSMA25)*(X2_LSMA25-X1_LSMA25)+(Y2_LSMA25-Y1_LSMA25)*(Y2_LSMA25-Y1_LSMA25));<br/> ANGLE_LSMA25V:=ROUND(ABS(180*ACOS((X2_LSMA25-X1_LSMA25)/C_LSMA25)/PI));<br/> ANGLE_LSMA25:=IF(Y2_LSMA25>0,-ANGLE_LSMA25V,ANGLE_LSMA25V);<br/> ARRAY:=CCI;<br/> HIGHBARS:=BARSLAST(NOT(ARRAY>0));<br/> LOWBARS:=BARSLAST(NOT(ARRAY<0));<br/> UPCONDITION:=BARSLAST(HIGHBARS>=6 AND SUM(ARRAY>100,5)>0);<br/> DNCONDITION:=BARSLAST(LOWBARS>=6 AND SUM(ARRAY<-100,5)>0);<br/> UPTREND:=ARRAY>0 AND UPCONDITION<DNCONDITION;<br/> DNTREND:=ARRAY<0 AND UPCONDITION>DNCONDITION;<br/> TRTREND:=HIGHBARS>=5 AND NOT(UPTREND) OR LOWBARS>=5 AND NOT(DNTREND);<br/> STICKLINE(UPTREND,0,CCI,1,0),COLORFF0000;<br/> STICKLINE(DNTREND,0,CCI,1,0),COLOR0000FF;<br/> STICKLINE(TRTREND,0,CCI,1,0),COLOR00FFFF;<br/> STICKLINE(NOT(UPTREND OR DNTREND OR TRTREND),0,CCI,1,0),COLOR808080;<br/> WCCI:CCI,LINETHICK1,COLORWHITE;<br/> TCCI:(AVG-MA(AVG,N))/(0.015*AVEDEV(AVG,N)),COLOR7F00FF,LINETHICK2;<br/> STICKLINE(ANGLE_EMA20>=5,-301,-321,2,0),COLORD0E040;<br/> STICKLINE(ANGLE_EMA20<5 AND ANGLE_EMA20>=3.57,-301,-321,2,0),COLOR006400;<br/> STICKLINE(ANGLE_EMA20<3.57 AND ANGLE_EMA20>=2.14,-301,-321,2,0),COLOR98FB98;<br/> STICKLINE(ANGLE_EMA20<2.14 AND ANGLE_EMA20>=0.71,-301,-321,2,0),COLOR00FF00;<br/> STICKLINE(ANGLE_EMA20<0.71 AND ANGLE_EMA20>-0.71,-301,-321,2,0),COLOR00FFFF;<br/> STICKLINE(ANGLE_EMA20<=-0.71 AND ANGLE_EMA20>-2.14,-301,-321,2,0),COLORE0FFFF;<br/> STICKLINE(ANGLE_EMA20<=-2.14 AND ANGLE_EMA20>-3.57,-301,-321,2,0),COLOR00A5FF;<br/> STICKLINE(ANGLE_EMA20<=-3.57 AND ANGLE_EMA20>-5,-301,-321,2,0),COLOR0000FF;<br/> STICKLINE(ANGLE_EMA20<=-5,-301,-321,2,0),COLOR00008B;<br/> SW:=IF(ABS(ANGLE_EMA20)>=15 AND ABS(ANGLE_EMA20+ANGLE_LSMA25)>=50,IF(ANGLE_LSMA25>0,2,-2),IF(ABS(ANGLE_EMA20)>=0 AND (ANGLE_EMA20>=0 AND ANGLE_LSMA25>=0 OR ANGLE_EMA20<=0 AND ANGLE_LSMA25<=0) AND ABS(ANGLE_EMA20+ANGLE_LSMA25)>=5,IF(ANGLE_LSMA25>0,1,-1),0));<br/> STICKLINE(ABS(SW)=2,301,321,2,0),COLOR00FF00;<br/> STICKLINE(ABS(SW)=1,301,321,2,0),COLOR00FFFF;<br/> STICKLINE(ABS(SW)=0,301,321,2,0),COLOR0000FF;<br/> IF(CLOSE>LSMA25,0,DRAWNULL),LINETHICK3,COLOR00FF00;<br/> IF(CLOSE<LSMA25,0,DRAWNULL),LINETHICK3,COLOR0000FF;<br/> IF(CLOSE=LSMA25,0,DRAWNULL),LINETHICK3,COLOR00FFFF;<br/> DRAWICON(ABS(CCI)>=200,CCI,12);<br/> STICKLINE(C,200,200,1.5,0),COLORFFFF00;<br/> STICKLINE(C,-200,-200,1.5,0),COLORFFFF00;<br/> STICKLINE(C,100,100,1.5,0),COLORFFFF00;<br/> STICKLINE(C,-100,-100,1.5,0),COLORFFFF00;</blockquote><h2>欢迎大家自行尝试! 关于指标大家可以私信找我免费领取!</h2>

残留你的美你 发表于 2024-4-8 21:07:22

多多点赞好好学习
页: [1]
查看完整版本: 通达信——精选指标《woodieCCI》指标源码