A股小妖女 发表于 2023-11-7 08:25:00

通达信【九转趋势线】主图指标公式源码

<p data-first-child></p><p >九转趋势线指标公式:</p><p >AD1:=C>REF(C,4);</p><p class="ztext-empty-paragraph"><br/></p><p >NT:=BARSLASTCOUNT(AD1);</p><p class="ztext-empty-paragraph"><br/></p><p >TJ11:=NT=9;</p><p class="ztext-empty-paragraph"><br/></p><p >TJ13:=ISLASTBAR AND BETWEEN(NT,5,8);</p><p class="ztext-empty-paragraph"><br/></p><p >AY:=(BACKSET(TJ11>0,9) OR   BACKSET(TJ13>0,NT))*NT;</p><p class="ztext-empty-paragraph"><br/></p><p >DRAWTEXT(AY>0,H*1.02,VAR2STR(AY,0)),COLORFF00FF;</p><p class="ztext-empty-paragraph"><br/></p><p >DRAWTEXT(NT=9,H*1.02,'9'),COLORGREEN;</p><p class="ztext-empty-paragraph"><br/></p><p >B1:=C<REF(C,4);</p><p class="ztext-empty-paragraph"><br/></p><p >NT0:=BARSLASTCOUNT(B1);</p><p class="ztext-empty-paragraph"><br/></p><p >TJ21:=NT0=9 ;</p><p class="ztext-empty-paragraph"><br/></p><p >TJ23:=ISLASTBAR AND BETWEEN(NT0,5,8);</p><p class="ztext-empty-paragraph"><br/></p><p >AY1:=(BACKSET(TJ21>0,9)ORBACKSET(TJ23>0,NT0))*NT0;</p><p class="ztext-empty-paragraph"><br/></p><p >DRAWTEXT(AY1>0,L*0.98,VAR2STR(AY1,0)),COLORFF00FF;</p><p class="ztext-empty-paragraph"><br/></p><p >DRAWTEXT(NT0=9,L*0.98,'9'),COLORGREEN;</p><p class="ztext-empty-paragraph"><br/></p><p >TJ:= C/REF(C,1)<0.95;</p><p class="ztext-empty-paragraph"><br/></p><p >DRAWLINE(TJ,(O+C)/2,REF(TJ,1),REF((O+C)/2,1),1),COLORFF0000;</p><p class="ztext-empty-paragraph"><br/></p><p >生命线:EMA(EMA(C,10),10),COLORRED,LINETHICK3;</p><p class="ztext-empty-paragraph"><br/></p><p >B:=生命线>REF(生命线,1);</p><p class="ztext-empty-paragraph"><br/></p><p >IF(B-1,生命线,DRAWNULL)COLORBLUE,LINETHICK3;</p><p class="ztext-empty-paragraph"><br/></p><p >DRAWICON(CROSS(L,生命线),L*0.99,7);</p><p class="ztext-empty-paragraph"><br/></p><p >DRAWICON(CROSS(生命线,L),H*1.01,8);</p><p class="ztext-empty-paragraph"><br/></p><p >AB:=EMA(C,5) > EMA(C,20);</p><p class="ztext-empty-paragraph"><br/></p><p >BB:=EMA(C,5) < EMA(C,20);</p><p class="ztext-empty-paragraph"><br/></p><p >CA:= EMA(C,5) > EMA(C,10);</p><p class="ztext-empty-paragraph"><br/></p><p >CA1:=EMA(C,5) < EMA(C,10);</p><p class="ztext-empty-paragraph"><br/></p><p >DD:=CLOSE<OPEN;</p><p class="ztext-empty-paragraph"><br/></p><p >STICKLINE(AB,H,L,0.1,0),COLORRED;</p><p class="ztext-empty-paragraph"><br/></p><p >STICKLINE(AB,O,C,3,1),COLORRED;</p><p class="ztext-empty-paragraph"><br/></p><p >STICKLINE(AB AND DD,O,C,3,0),COLORRED;</p><p class="ztext-empty-paragraph"><br/></p><p >STICKLINE(BB,H,L,0.1,0),COLORGREEN;</p><p class="ztext-empty-paragraph"><br/></p><p >STICKLINE(BB,O,C,3,1),COLORGREEN;</p><p class="ztext-empty-paragraph"><br/></p><p >STICKLINE(BB AND DD,O,C,3,0),COLORGREEN;</p><p class="ztext-empty-paragraph"><br/></p><p >STICKLINE(BB AND CA,H,L,0.1,1),COLORWHITE;</p><p class="ztext-empty-paragraph"><br/></p><p >STICKLINE(BB AND CA,O,C,3,0.1),COLORWHITE;</p><p class="ztext-empty-paragraph"><br/></p><p >STICKLINE(BB AND CA AND DD,O,C,3,0),COLORWHITE;</p><p class="ztext-empty-paragraph"><br/></p><p >STICKLINE(AB AND CA1,H,L,0.1,0),COLORWHITE;</p><p class="ztext-empty-paragraph"><br/></p><p >STICKLINE(AB AND CA1,O,C,3,1),COLORWHITE;</p><p class="ztext-empty-paragraph"><br/></p><p >STICKLINE(AB AND CA1 AND DD,O,C,3,0),COLORWHITE;</p><p class="ztext-empty-paragraph"><br/></p><p >HIGHN:=10;LOWN:=10;HIGHDISPLAY:=0;LOWDISPLAY:=0;ZGDISPLAY:=0;MADISPLAY:=0;</p><p >AA:=REF(H,HIGHN)=HHV(H,2*HIGHN+1);</p><p class="ztext-empty-paragraph"><br/></p><p >QY:=BACKSET(AA,HIGHN+1);</p><p class="ztext-empty-paragraph"><br/></p><p >CC:=FILTER(QY,HIGHN) AND H=HHV(H,HIGHN+1);</p><p class="ztext-empty-paragraph"><br/></p><p >DRAWICON(CC,H*1.02,2);</p><p class="ztext-empty-paragraph"><br/></p><p >DDD:=BARSLAST(CC);</p><p class="ztext-empty-paragraph"><br/></p><p >GDTS:=IF(CC,CURRBARSCOUNT,0);</p><p class="ztext-empty-paragraph"><br/></p><p >DINGBU:=IF(DDD,REF(H,DDD),H);{顶部}</p><p class="ztext-empty-paragraph"><br/></p><p >DINGBUTS:=IF(DDD,REF(GDTS,DDD),GDTS);</p><p class="ztext-empty-paragraph"><br/></p><p >DINGBU1:=REF(DINGBU,DDD+1);</p><p class="ztext-empty-paragraph"><br/></p><p >GDCS1:=CONST(DINGBUTS);</p><p class="ztext-empty-paragraph"><br/></p><p >DINGBUTS1:=REF(DINGBUTS,DDD+1);</p><p class="ztext-empty-paragraph"><br/></p><p >GDCS2:=CONST(DINGBUTS1);</p><p class="ztext-empty-paragraph"><br/></p><p >DINGBU2:=REF(DINGBU1,DDD+1);</p><p class="ztext-empty-paragraph"><br/></p><p >MM:=IF(CURRBARSCOUNT>GDCS2,0,1);</p><p class="ztext-empty-paragraph"><br/></p><p >高点压力:DRAWLINE(CURRBARSCOUNT=GDCS2,H,CURRBARSCOUNT=GDCS1,H,1) COLORGREEN,LINETHICK;</p><p class="ztext-empty-paragraph"><br/></p><p >DRAWLINE(CURRBARSCOUNT=GDCS2,H,ISLASTBAR,REF(H,GDCS2-1),1),COLORGREEN,DOTLINE;</p><p class="ztext-empty-paragraph"><br/></p><p >DRAWLINE(CURRBARSCOUNT=GDCS1,H,ISLASTBAR,REF(H,GDCS1-1),1),COLORFF0000,DOTLINE;</p><p class="ztext-empty-paragraph"><br/></p><p >AA1:=REF(L,LOWN)=LLV(L,2*LOWN+1);</p><p class="ztext-empty-paragraph"><br/></p><p >QY1:=BACKSET(AA1,LOWN+1);</p><p class="ztext-empty-paragraph"><br/></p><p >CC1:=FILTER(QY1,LOWN) AND L=LLV(L,LOWN+1);</p><p class="ztext-empty-paragraph"><br/></p><p >DRAWICON(CC1,L*0.98,1);</p><p class="ztext-empty-paragraph"><br/></p><p >DD1:=BARSLAST(CC1);</p><p class="ztext-empty-paragraph"><br/></p><p >DDTS:=IF(CC1,CURRBARSCOUNT,0);</p><p class="ztext-empty-paragraph"><br/></p><p >YDB:=IF(DD1,REF(L,DD1),L);</p><p class="ztext-empty-paragraph"><br/></p><p >DDTS1:=IF(DD1,REF(DDTS,DD1),DDTS);</p><p class="ztext-empty-paragraph"><br/></p><p >DDCS1:=CONST(DDTS1);</p><p class="ztext-empty-paragraph"><br/></p><p >ZDB:=REF(YDB,DD1+1);</p><p class="ztext-empty-paragraph"><br/></p><p >DDTS2:=REF(DDTS1,DD1+1);</p><p class="ztext-empty-paragraph"><br/></p><p >DDCS2:=CONST(DDTS2);</p><p class="ztext-empty-paragraph"><br/></p><p >低点支撑:DRAWLINE(CURRBARSCOUNT=DDCS2,L,CURRBARSCOUNT=DDCS1,L,1) COLORFF00FF,LINETHICK;</p><p class="ztext-empty-paragraph"><br/></p><p >ZGSTAR:=(高点压力+低点支撑)/2;</p><p class="ztext-empty-paragraph"><br/></p><p >ZGEND:=CONST((高点压力+低点支撑)/2);</p><p class="ztext-empty-paragraph"><br/></p><p >STARDAY:=IF(DDCS2<GDCS2,DDCS2,GDCS2);</p><p class="ztext-empty-paragraph"><br/></p><p >中轨:DRAWLINE(CURRBARSCOUNT=STARDAY,ZGSTAR,ISLASTBAR,ZGEND,1),COLORFFFFFF,LINETHICK;</p><p class="ztext-empty-paragraph"><br/></p><p >DRAWLINE(CURRBARSCOUNT=DDCS1,L,ISLASTBAR,REF(L,DDCS1-1),1),COLOR0000FF,DOTLINE;</p><p class="ztext-empty-paragraph"><br/></p><p >DRAWLINE(CURRBARSCOUNT=DDCS2,L,ISLASTBAR,REF(L,DDCS2-1),1),COLORFF00FF,DOTLINE;</p><p class="ztext-empty-paragraph"><br/></p><p >涨停开板:=H>REF(C,1)*1.090 AND C<H; </p><p class="ztext-empty-paragraph"><br/></p><p >DRAWTEXT(涨停开板,HIGH*1.02,'炸板'),COLORGREEN;</p><p class="ztext-empty-paragraph"><br/></p><p >D2:=REF(C,1);</p><p class="ztext-empty-paragraph"><br/></p><p >跌停:=IF((D2-C)*100/D2>=(10-0.01*100/D2),1,0);</p><p class="ztext-empty-paragraph"><br/></p><p >STICKLINE(跌停,OPEN,CLOSE,2,0),COLORBLUE;</p><p class="ztext-empty-paragraph"><br/></p><p >STICKLINE(跌停,H,L,0,1),COLORBLUE;</p><p class="ztext-empty-paragraph"><br/></p><p >DRAWTEXT_FIX(1,0.01,0,0,'行业:'),COLOR0000FF;</p><p class="ztext-empty-paragraph"><br/></p><p >DRAWTEXT_FIX(1,0.04,0,0,HYBLOCK),COLORYELLOW;</p><p class="ztext-empty-paragraph"><br/></p><p >DRAWTEXT_FIX(1,0.01,0.06,0,'概念:'),COLOR0000FF;</p><p class="ztext-empty-paragraph"><br/></p><p >DRAWTEXT_FIX(1,0.04,0.06,0,GNBLOCK),COLORYELLOW;</p><p class="ztext-empty-paragraph"><br/></p><p >DRAWTEXT_FIX(1,0.01,0.12,0,'地区:'),COLOR0000FF;</p><p class="ztext-empty-paragraph"><br/></p><p >DRAWTEXT_FIX(1,0.04,0.12,0,DYBLOCK),COLORYELLOW;</p><p class="ztext-empty-paragraph"><br/></p><p >DRAWTEXT_FIX(1,0.01,0.18,0,'风格:'),COLOR0000FF;</p><p class="ztext-empty-paragraph"><br/></p><p >DRAWTEXT_FIX(1,0.04,0.18,0,FGBLOCK),COLORYELLOW;</p><p >DRAWTEXT_FIX(1,0.01,0.24,0,'指数:'),COLOR0000FF;</p><p class="ztext-empty-paragraph"><br/></p><p >DRAWTEXT_FIX(1,0.04,0.24,0,ZSBLOCK),COLORYELLOW;</p><p class="ztext-empty-paragraph"><br/></p><p >平均成本:=STRCAT(' 平均成本:',CON2STR(COST(50),2));</p><p class="ztext-empty-paragraph"><br/></p><p >主力成本:=STRCAT('   主力成本:',CON2STR(COST(4),2));</p><p class="ztext-empty-paragraph"><br/></p><p >重心:=STRCAT('   重心:',CON2STR((H+L+C)/3,2));</p><p class="ztext-empty-paragraph"><br/></p><p >套牢盘%:=STRCAT('【套牢概率】:',CON2STR((1-WINNER(C))*100,2));</p><p class="ztext-empty-paragraph"><br/></p><p >获利盘%:=STRCAT('【获利概率】:',CON2STR(100*WINNER(C),2));</p><p class="ztext-empty-paragraph"><br/></p><p >筹码分析:=STRCAT('【筹码分析】',STRCAT(STRCAT(STRCAT(STRCAT(平均成本,主力成本),重心),套牢盘%),获利盘%));</p><p class="ztext-empty-paragraph"><br/></p><p >DRAWTEXT_FIX(ISLASTBAR,0,1,0,筹码分析),COLOR0000FF;</p><p class="ztext-empty-paragraph"><br/></p><p >MA5:MA(C,5);</p><p >风险提示:本文所提到的观点仅代表个人的意见,所涉及标的不作推荐,据此买卖,风险自负。</p>

晓伟爱婉婷木 发表于 2024-1-13 08:14:43

找了很久了,多谢!
页: [1]
查看完整版本: 通达信【九转趋势线】主图指标公式源码