横空出世源码 input:N(400,1,5000),加仓(200,1,5000); DRAWGBK(CLOSE,COLORRGB(90,90,90),COLORRGB(30,30,60),1); A1:=SUMBARS(VOL,CAPITAL*3);{300%换手平均成本线.成交量短期可以造假, 但是对于长期来说成交量是造不了假的,所以以换手300%为周期, 一般来说反映的是比较真实的成本} CMA1:=IF(CAPITAL>0,SUM(AMOUNT,A1)/SUM(VOL,A1)/100,EMA(CLOSE,360)); A2:=SUMBARS(VOL,CAPITAL); CMA2:=IF(CAPITAL>0,SUM(AMOUNT,A2)/SUM(VOL,A2)/100,EMA(CLOSE,120));{100%换手平均成本线} A3:=SUMBARS(VOL,CAPITAL*0.4);{40%换手平均成本线} CMA3:=IF(CAPITAL>0,SUM(AMOUNT,A3)/SUM(VOL,A3)/100,EMA(CLOSE,48)); FILLRGN(CMA1,HHV(CMA1,21),LLV(CMA1,21)),ColorF1F1F1;{长期成本} FILLRGN(CMA2,HHV(CMA2,21),LLV(CMA2,21)),Color990066;{中期成本} FILLRGN(CMA3,HHV(CMA3,13),LLV(CMA3,13)),Color006699;{短期成本}HH:=HHV(CLOSE,N); LL:=LLV(CLOSE,N); HH1:=BARSLAST((HH > REF(HH,1))); LL1:=BARSLAST((LL < REF(LL,1))); PARTLINE((HH1 < LL1),LL),LINETHICK2,colorGREEN; PARTLINE((HH1 > LL1),HH),LINETHICK2,colorRED;DRAWICON(CROSS(HH1,LL1),HH,11); DRAWICON(CROSS(LL1,HH1),LL,10); DRAWTEXT(CROSS(HH1,LL1),(CLOSE * 1.03),'平多开空'),colorFFFFFF; DRAWTEXT(CROSS(LL1,HH1),(CLOSE * 0.98),'平空开多'),colorFFFFFF; DRAWTEXT(FILTER(((HH1 < REF(HH1,1)) AND (HH1 < LL1)),加仓),LOW,'△加多'),colorFF00FF; DRAWTEXT(FILTER(((LL1 < REF(LL1,1)) AND (HH1 > LL1)),加仓),HIGH,'▽加空'),colorFF00; 主线:=(ma(close,6)+ma(close,12)+ma(close,24)+ma(close,36))/4,linethick2,colorff00ff; 股价重心:=dma(amount/vol/100,vol/capital),colorgreen,linethick2; ma14:=ema(close,14); ma34:=ema(close,26); ma54:=ema(close,54); ma90:=ema(close,90); ma120:ema(close,120),linedashdot,color669900; 年线:ema(c,250),coloryellow,linethick2; {中短波} hz:=ema(close,13); 短波:EMA(HZ,1),COLOR00DD00,LINETHICK1; 中波:EMA(HZ,26),COLORRED,LINETHICK1; 均线148天:=EMA(C,148),POINTDOT,LINETHICK1,COLORGREEN; 成本:=SUM(AMOUNT,0)/SUM(VOL,0)/100,COLORYELLOW ,LINETHICK2 ; HZ2:EMA(HZ,8),COLORGREEN,LINETHICK2; HZ4:EMA(HZ,39),COLORFF00FF,LINETHICK2; A1:STICKLINE(HZ2<HZ4,短波,HZ4,0.1,0),COLORgray; A2:STICKLINE(短波>HZ2,短波,HZ2,0.1,0),COLORGREEN; A3:STICKLINE(中波>HZ4,中波,HZ4,0.1,0),COLORFF00FF; {慢速kdj} rsv:=(close-llv(low,60))/(hhv(high,60)-llv(low,60))*100; fastk:=sma(rsv,12,1); k:=sma(fastk,9,1),coloryellow; d:=sma(k,3,1),linethick2,colorblue; j:=3*k-2*d,linethick1,colorgreen; {中波} var11:=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); var22:=100-var11; 中势线:=(-1)*(ema(var22,1)-50)+42,coloryellow,linethick2; tz:=(close-llv(low,331))/(hhv(high,331)-llv(low,331))*100; 强势线:=sma(tz,5,1),linethick2,colorred; 大盘线:=70*(hhv(high,39)-close)/(hhv(high,39)-llv(low,39)),linethick1,color009900; {量选} aa:=vol/sum(vol,13); bb:=dma(c,aa); cc:=vol/sum(vol,34); dd:=dma(c,cc); {背离} var00:=winner(close); var1:=forcast(var00,10); var2:=ma(var1,3); var3:=ma(var2,12); var4:=ma(var3,16); var5:=ma(var4,31); var6:=ma(var5,55); var7:=var5; var8:=var4>var2*1.11 and var3>var2*1.095; a:=var4/var2; b:=var3/var2; var9:=var2>var1*0.95; td:=var2/var1; var1h:=indexc; var2h:=ma(var1h,6); var3h:=ma(var1h,24); var4h:=ma(var1h,32); var5h:=ma(var1h,62); var6h:=ma(var1h,105); var7h:=var5h; var8h:=var4h>var2h*1.11 and var3h>var2h*1.095; var9h:=var2h>var1h*0.95; pt:=(if(h=l and c=o and l=c and c>0 and ref(h,1)=ref(l,1) and ref(c,1)=ref(o,1) and ref(h,1)=ref(c,1) and ref(c,1)>0,0,1))>0; g:=(var7h and var8h and var9h and close/cost(8)<=0.7985 and (count(c=l,4)<3 or c>ref(c,1)))and pt or var7 and var8 and var9 and close/cost(5)<=0.8 and ((var1>open or var1>ref(open,1) or ref(var1,1))); 背离:=var2<ref(var2,1) and a>ref(a,1); 买入信号1:=var1>a and var2>b; 买入信号2:=b>a and 1>b and a<1 and h=hhv(h,21); buy:=count(背离,20)>1 and 买入信号2=1 and c>o or cross(bb,dd); {drawicon(cross(短波,hz2),中波,1); drawtext(cross(主线,ma90) and 大盘线<36 and j>k and 强势线>ref(强势线,1) and 中势线>ref(中势线,1) and 短波-ref(短波,1)>0.088 and hz4-ref(hz4,1)>0.028 or cross(主线,ma120) and 大盘线<36 and j>k and 强势线>ref(强势线,1) and 中势线>ref(中势线,1) and 短波-ref(短波,1)>0.088 and hz4-ref(hz4,1)>0.028 or cross(ma120,均线148天) and 大盘线<36 and j>k and 强势线>ref(强势线,1) and 中势线>ref(中势线,1) and 短波-ref(短波,1)>0.088 and hz4-ref(hz4,1)>0.028 or cross(中势线,33) and 短波>hz2 and o>ref(o,1) and c>ref(c,1) and j>d and j<65 and 大盘线<36 and 强势线>36 and 主线>ref(主线,1) and 强势线>ref(强势线,1) and 中势线>ref(中势线,1) and 中势线<70 and c>o and ma34>ref(ma34,1) and 短波-ref(短波,1)>0.088 and hz4-ref(hz4,1)>0.028 or cross(短波,hz2) and 大盘线<36 and 短波>中波 and 中波>hz4 and 短波-ref(短波,1)>0.088 and hz4-ref(hz4,1)>0.028 or j>k and 大盘线<36 and 短波>hz2 and cross(强势线,36) or cross(短波,hz2) and cross(强势线,36) or cross(j,k) and cross(强势线,33) or cross(短波,hz2) and cross(强势线,54) or cross(j,k) and 大盘线<36 and j<65 and c>o and 短波-ref(短波,1)>0.088 or cross(j,k) and 短波>hz2 and j<68 and 短波>ref(短波,1) and hz2>ref(hz2,1) and 中势线>ref(中势线,1) and 短波-ref(短波,1)>0.088 or cross(j,k) and 大盘线<36 and j<68 and 短波-ref(短波,1)>0.088 or cross(j,k) and cross(短波,hz2) and 大盘线<36 or cross(短波,hz2) and 大盘线<36 and j>k and j<68 and 强势线>ref(强势线,1) and 中势线>ref(中势线,1) and 短波-ref(短波,1)>0.088 or cross(短波,hz2) and 中波>ma120 and 中波>均线148天 and hz2>ma120 and ma120>均线148天 and 短波-ref(短波,1)>0.088 or cross(j,k) and 强势线>54 and 强势线>ref(强势线,1) and j<68 or count(背离,20)>1 and 短波>hz2 and o>ref(o,1) and c>ref(c,1) and j>d and j<65 and 买入信号2=1 and 主线>ref(主线,1) and 中势线>ref(中势线,1) and 中势线<70 and c>o or cross(bb,dd) and j<74 and ma34>ref(ma34,1) and 短波-ref(短波,1)>0.088 or 大盘线<36 and j>d and j<65 and c>o and 短波>ref(短波,1) and cross(hz2,中波) and 短波-ref(短波,1)>0.088 and o>ref(c,1) or c>o and 短波>ref(短波,1) and j>d and j<65 and 大盘线<36 and cross(中势线,33) and 中势线-ref(中势线,1)>0.23 and 短波-ref(短波,1)>0.088 and o>ref(c,1) and 强势线>12 or 短波>hz2 and 中波>hz4 and 大盘线<36 and cross(j,k) and j<65 and 短波-ref(短波,1)>0.088 or 短波>hz2 and 大盘线<36 and cross(j,k) and j<65 and 短波-ref(短波,1)>0.088 or cross(j,k) and cross(短波,hz2) and 大盘线<36 and j<56 or 短波>hz2 and 中波>hz4 and 大盘线<36 and j>d and j<65 and cross(hz4,年线) and 短波-ref(短波,1)>0.088 or 短波>hz2 and hz2>hz4 and 大盘线<36 and j>d and j<65 and j<65 and cross(强势线,46) and 短波-ref(短波,1)>0.088 or 短波>hz2 and 大盘线<36 and j>d and j<65 and cross(中势线,36) and 短波-ref(短波,1)>0.088 ,hz2-0.18,'!追'),colorwhite;{好} drawtext(cross(短波,hz2) and c>o and j>k and j>d and 大盘线<36 and c>hz4,l*1.09,'●'),coloryellow; drawtext(cross(短波,hz2) and c>o and j>k and j>d and 大盘线<36 and c>hz4,l*1.12,'做趋势'), coloryellow; DRAWTEXT(cross(短波,hz2),C,'♂'); DRAWTEXT(cross ( 中波,hz4),C,'♂'); DRAWTEXT(cross ( 中波,ma120),C,'♂'); DRAWTEXT(cross (hz4,ma120),C,'♂');} 多空:=OPEN; STICKLINE(CLOSE>多空,HIGH,LOW,0.5,0),colorFF; STICKLINE(CLOSE>多空 AND CLOSE>OPEN,OPEN,CLOSE,8,0),color102088; STICKLINE(CLOSE>多空 AND CLOSE>OPEN,OPEN,CLOSE,7,0),color102099; STICKLINE(CLOSE>多空 AND CLOSE>OPEN,OPEN,CLOSE,6,0),color1020AA; STICKLINE(CLOSE>多空 AND CLOSE>OPEN,OPEN,CLOSE,5,0),color1020BB; STICKLINE(CLOSE>多空 AND CLOSE>OPEN,OPEN,CLOSE,4,0),color1020CC; STICKLINE(CLOSE>多空 AND CLOSE>OPEN,OPEN,CLOSE,3,0),color1020DD; STICKLINE(CLOSE>多空 AND CLOSE>OPEN,OPEN,CLOSE,2,0),color1020EE; STICKLINE(CLOSE>多空 AND CLOSE>OPEN,OPEN,CLOSE,1,0),color1020FF; STICKLINE(CLOSE>多空 AND CLOSE<OPEN,OPEN,OPEN,8,0),color102088; STICKLINE(CLOSE>多空 AND CLOSE<OPEN,OPEN,OPEN,7,0),color102099; STICKLINE(CLOSE>多空 AND CLOSE<OPEN,OPEN,OPEN,6,0),color1020AA; STICKLINE(CLOSE>多空 AND CLOSE<OPEN,OPEN,OPEN,5,0),color1020BB; STICKLINE(CLOSE>多空 AND CLOSE<OPEN,OPEN,OPEN,4,0),color1020CC; STICKLINE(CLOSE>多空 AND CLOSE<OPEN,OPEN,OPEN,3,0),color1020DD; STICKLINE(CLOSE>多空 AND CLOSE<OPEN,OPEN,OPEN,2,0),color1020EE; STICKLINE(CLOSE>多空 AND CLOSE<OPEN,OPEN,OPEN,1,0),color1020FF; STICKLINE(CLOSE<多空,HIGH,LOW,0.5,0),colorFF8800; STICKLINE(CLOSE<多空 AND CLOSE<OPEN,OPEN,CLOSE,8,0),colorFF7700; STICKLINE(CLOSE<多空 AND CLOSE<OPEN,OPEN,CLOSE,7,0),colorFF8800; STICKLINE(CLOSE<多空 AND CLOSE<OPEN,OPEN,CLOSE,6,0),colorFF9900; STICKLINE(CLOSE<多空 AND CLOSE<OPEN,OPEN,CLOSE,5,0),colorFFAA00; STICKLINE(CLOSE<多空 AND CLOSE<OPEN,OPEN,CLOSE,4,0),colorFFBB00; STICKLINE(CLOSE<多空 AND CLOSE<OPEN,OPEN,CLOSE,3,0),colorFFCC00; STICKLINE(CLOSE<多空 AND CLOSE<OPEN,OPEN,CLOSE,2,0),colorFFDD00; STICKLINE(CLOSE<多空 AND CLOSE<OPEN,OPEN,CLOSE,1,0),colorFFEE00; STICKLINE(CLOSE<多空 AND CLOSE>OPEN,OPEN,OPEN,8,0),colorFF7700; STICKLINE(CLOSE<多空 AND CLOSE>OPEN,OPEN,OPEN,7,0),colorFF8800; STICKLINE(CLOSE<多空 AND CLOSE>OPEN,OPEN,OPEN,6,0),colorFF9900; STICKLINE(CLOSE<多空 AND CLOSE>OPEN,OPEN,OPEN,5,0),colorFFAA00; STICKLINE(CLOSE<多空 AND CLOSE>OPEN,OPEN,OPEN,4,0),colorFFBB00; STICKLINE(CLOSE<多空 AND CLOSE>OPEN,OPEN,OPEN,3,0),colorFFCC00; STICKLINE(CLOSE<多空 AND CLOSE>OPEN,OPEN,OPEN,2,0),colorFFDD00; STICKLINE(CLOSE<多空 AND CLOSE>OPEN,OPEN,OPEN,1,0),colorFFEE00; STICKLINE(CLOSE=多空,OPEN,CLOSE,8,0),colorFFFF00; STICKLINE(CLOSE=多空,HIGH,LOW,0.5,0),colorFFFF00; {点击看本软件截图: 58股票 公式网 http://www. 58gu. com 整理} |