无标题1.gif (43.29 KB)
//N(100,0,9999),M(100,0,9999); t:=barslast(cross(barpos,datacount-N+1))+1; 高点移动平均线:ma(h,t),colorGREEN,linethick2; setlbound(高点移动平均线,datacount-N+1),linethick0; s:=barslast(cross(barpos,datacount-M+1))+1; 低点移动平均线:ma(L,S),coloryellow,linethick2; setlbound(低点移动平均线,datacount-M+1),linethick0; 图片上的参数是我根据S南航手动调整的,不见得适用于其他的股票,因为每个股票的高低点天数都不相同,请你根据自己关心的股票的高低点手动调整 还有这个公式先暂时做个尝鲜吧,等谁能做出来可以随画面变动来显示高低点的自动连线的时候或者是更好的再换吧,反正我是懒得仿写指标了,分析基家大智慧2的原码在这个帖子联接http://www.chcj.net/thread-653328-2-1.html的28楼 ![]() ![]()
[大智慧L2] 可以实现“点石成金”的指标
点石成金源码: bc:=barslast(SYSPARAM(1)=barpos)+1; 点石成金H:=IF(close>100,SUM(h*VOL,bc)/SUM(VOL,bc),sum(AMOUNT,bc)/sum(v,bc)/100*SUM(H,bc)/SUM(C,BC)),colorred,LINETHICK2; 点石成金L:=IF(close>100,SUM(l*VOL,bc)/SUM(VOL,bc),sum(AMOUNT,bc)/sum(v,bc)/100*SUM(L,bc)/SUM(C,BC)),colorblue,LINETHICK2; 点石成金:if(ref(h,bc-1)>ref(h,bc) and ref(h,bc-1)>ref(h,bc-2) ,点石成金h,点石成金l),colorred,LINETHICK2; (大智慧用这句代替第一句试试: bc:=BARSLAST(DISPSTATUS=1)+1; ) 下面是加了波神凯线的原码: INPUT:最近天(35,1,360),k(1,1,2); N:=IF(SYSPARAM(1)=DATACOUNT,最近天,0); HH:=hhv(H,n); LL:=llv(l,n); VN:=n; {LAST1:=DATACOUNT;} IF VN>DATACOUNT THEN VN:=DATACOUNT+1; FOR I=DATACOUNT DOWNTO DATACOUNT-VN+1 DO BEGIN HH[I]:=HH[DATACOUNT]; LL[I]:=LL[DATACOUNT]; END; KKH:=BARSLAST(HIGH=HH); KKL:=BARSLAST(LOW=LL); N低日:=STRTONUM(NUMTOSTR(REF(BARPOS,KKL),0)),LINETHICK; N高日:=STRTONUM(NUMTOSTR(REF(BARPOS,KKH),0)),LINETHICK; 多空:=IF(N低日>N高日,2,1); DATE1:=IF(多空=1,N低日,N高日);{} hh0:=if(REF(HIGH,BARSLAST(DATE1=BARPOS)+k-1)>REF(HIGH,BARSLAST(DATE1=BARPOS)),REF(HIGH,BARSLAST(DATE1=BARPOS)+k-1),REF(HIGH,BARSLAST(DATE1=BARPOS))); hhh00:=REF(HIGH,BARSLAST(DATE1=BARPOS)); ll0:=REF(LOW,BARSLAST(DATE1=BARPOS)); H1:=STRTONUM(NUMTOSTR(Hh0,3)),POINTDOT; Hhh0:=STRTONUM(NUMTOSTR(Hhh00,3)),POINTDOT; L1:=STRTONUM(NUMTOSTR(Ll0,3)),POINTDOT; hh00:=REF(HIGH,BARSLAST(DATE1=BARPOS)); ll00:=if(REF(LOW,BARSLAST(DATE1=BARPOS)+k-1)<REF(LOW,BARSLAST(DATE1=BARPOS)),REF(LOW,BARSLAST(DATE1=BARPOS)+k-1),REF(LOW,BARSLAST(DATE1=BARPOS))); H11:=STRTONUM(NUMTOSTR(Hh00,3)),POINTDOT; L11:=STRTONUM(NUMTOSTR(Ll00,3)),POINTDOT; NN:=SYSPARAM(1); if NN<1 or NN>datacount then exit; x1:=SYSPARAM(1)=BARPOS; tz1:=if(ref(h,k-1)>h,ref(h,k-1),h); tm1:=h; tz2:=l; zt1:=tz1[NN]; zm1:=tm1[NN]; zt2:=tz2[NN]; z1:=IF(SYSPARAM(1)=DATACOUNT,H1,zt1); tm:=IF(SYSPARAM(1)=DATACOUNT,hhh0,zm1); Z2:=IF(SYSPARAM(1)=DATACOUNT,L1,ZT2); tz11:=h; tz22:=if(ref(l,k-1)<l,ref(l,k-1),l); zt11:=tz11[NN]; zt22:=tz22[NN]; Z11:=IF(SYSPARAM(1)=DATACOUNT,h11,ZT11); Z22:=IF(SYSPARAM(1)=DATACOUNT,L11,ZT22); PARTLINE(SYSPARAM(1)=DATACOUNT,tm),,POINTDOT,linethick0,color999999; PARTLINE(SYSPARAM(1)=DATACOUNT,z2),,POINTDOT,linethick0,color999999; xxx1:=x1 and l1<=REF(LOW,BARSLAST(DATE1=BARPOS)+1); xxxx1:=x1 and l<=ref(l,1) and l<ref(l,2) and l<refx(l,1); xx1:=if(SYSPARAM(1)=DATACOUNT,xxx1,xxxx1); xxx2:=x1 and h11>=REF(HIGH,BARSLAST(DATE1=BARPOS)+1); xxxx2:=X1 and h>=ref(h,1) and h>=ref(h,2) and h>refx(h,1); xx2:=if(SYSPARAM(1)=DATACOUNT,xxx2,xxxx2); DRAWTEXT(xx1 ,z1+(z1-z2)*1.0,'--⑴----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------'),colorFF00FF,pxup15; DRAWTEXT(xx1 ,z1+(z1-z2)*1.4,'--⑵----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------'),colorFF00FF,pxup15; DRAWTEXT(xx1 ,z1+(z1-z2)*2.1,'--⑶----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------'),colorff9963,pxup15; DRAWTEXT(xx1 ,z1+(z1-z2)*2.7,'--⑷----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------'),colorFF00FF,pxup15; DRAWTEXT(xx1 ,z1+(z1-z2)*3.1,'--⑸----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------'),colorFF00FF,pxup15; DRAWTEXT(xx1 ,z1+(z1-z2)*3.7,'--⑹----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------'),colorff9963,pxup15; DRAWTEXT(xx1 ,z1+(z1-z2)*4.4,'--⑺----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------'),colorFF00FF,pxup15; DRAWTEXT(xx1 ,z1+(z1-z2)*5.0,'--⑻----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------'),colorFF00FF,pxup15; DRAWTEXT(xx1 ,z1+(z1-z2)*0.5,'--◇-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------'),colorFF9963,pxup15; DRAWTEXT(xx1 ,z1+(z1-z2)*5.8,'--◇-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------'),colorff9963,pxup15; DRAWTEXT(xx2 ,z22-(z11-z22)*1.0,'--⑴-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------'),colorFF00FF,pxup15; DRAWTEXT(xx2 ,z22-(z11-z22)*1.4,'--⑵----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------'),colorFF00FF,pxup15; DRAWTEXT(xx2 ,z22-(z11-z22)*2.1,'--⑶---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------'),colorff9963,pxup15; DRAWTEXT(xx2 ,z22-(z11-z22)*2.7,'--⑷---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------'),colorFF00FF,pxup15; DRAWTEXT(xx2 ,z22-(z11-z22)*3.1,'--⑸---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------'),colorFF00FF,pxup15; DRAWTEXT(xx2 ,z22-(z11-z22)*3.7,'--⑹---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------'),colorff9963,pxup15; DRAWTEXT(xx2 ,z22-(z11-z22)*4.4,'--⑺---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------'),colorFF00ff,pxup15; DRAWTEXT(xx2 ,z22-(z11-z22)*5.0,'--⑻---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------'),colorFF00FF,pxup15; DRAWTEXT(xx2 ,z22-(z11-z22)*0.5,'--◇----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------'),colorFF9963,pxup15; DRAWTEXT(xx2 ,z22-(z11-z22)*5.8,'--◇----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------'),colorFF9963,pxup15; DRAWTEXT(SYSPARAM(2)=BARPOS,H1,'上升八线:㈠'+NUMTOSTR(z1+(z1-z2)*1,2)+' ㈡'+NUMTOSTR(z1+(z1-z2)*1.4,2)+' ㈢'+NUMTOSTR(z1+(z1-z2)*2.1,2)+' ㈣'+NUMTOSTR(z1+(z1-z2)*2.7,2)+' ㈤'+NUMTOSTR(z1+(z1-z2)*3.1,2)+' ㈥'+NUMTOSTR(z1+(z1-z2)*3.7,2)+' ㈦'+NUMTOSTR(z1+(z1-z2)*4.4,2)+' ㈧'+NUMTOSTR(z1+(z1-z2)*5,2)),COLORFFAAAA,ALIGN4; DRAWTEXT(SYSPARAM(2)=BARPOS,L1,'下降八线:㈠'+NUMTOSTR(z22-(z11-z22)*1,2)+' ㈡'+NUMTOSTR(z22-(z11-z22)*1.4,2)+' ㈢'+NUMTOSTR(z22-(z11-z22)*2.1,2)+' ㈣'+NUMTOSTR(z22-(z11-z22)*2.7,2)+' ㈤'+NUMTOSTR(z22-(z11-z22)*3.1,2)+' ㈥'+NUMTOSTR(z22-(z11-z22)*3.7,2)+' ㈦'+NUMTOSTR(z22-(z11-z22)*4.4,2)+' ㈧'+NUMTOSTR(z22-(z11-z22)*5,2)),COLORFFAAAA,ALIGN5; cbl1:=if(ref(h,2)>ref(h,3),ref(h,2),ref(h,3)); cbl3:=if(ref(l,2)<ref(l,3),ref(h,2),cbl1); cbl2:=if(ref(h,3)>=ref(h,2),ref(h,2),ref(h,3)); CBL4:=IF(H<REF(H,2 OR L<REF(L,2)),REF(H,2),CBL2); cb5:=if(h>=ref(h,1) AND L>REF(L,1 ),cbl4,cbl3); cbl6:=if(h>ref(h,1) and ref(h,1)>ref(h,2) and l<ref(h,2) and o>c,h,cb5); cbl7:=if(l<ref(l,1) and ref(l,1)<ref(l,2) and ref(l,2)<ref(l,3) and c>o and (ref(l,1)-l)/l>0.015,l,cbl6); cbl:if(ref(l,1)<ref(l,2) and ref(l,2)<ref(l,3) and ref(l,3)<ref(l,4) and ref(c,1)>ref(o,1),ref(L,2),cbl7),,COLORff9963,LINETHICK0; STICKLINE((BARPOS = (SYSPARAM(1) - 0)and cbl<c),cbl,cbl,240,0),Color0084ff,POINTDOT; STICKLINE((BARPOS = (SYSPARAM(1) - 0)and cbl>=c),cbl,cbl,240,0),colorff9963,POINTDOT; bc:=barslast(SYSPARAM(1)=barpos)+1; 点石成金H:=IF(close>100,SUM(h*VOL,bc)/SUM(VOL,bc),sum(AMOUNT,bc)/sum(v,bc)/100*SUM(H,bc)/SUM(C,BC)),colorred,LINETHICK2; 点石成金L:=IF(close>100,SUM(l*VOL,bc)/SUM(VOL,bc),sum(AMOUNT,bc)/sum(v,bc)/100*SUM(L,bc)/SUM(C,BC)),colorblue,LINETHICK2; 点石成金:if(ref(h,bc-1)>ref(h,bc) and ref(h,bc-1)>ref(h,bc-2) ,点石成金h,点石成金l),colorred,LINETHICK2; 大智慧的 1 bc:=BARSLAST(DISPSTATUS=1)+1; 点石成金H:=IF(close>100,SUM(h*VOL,bc)/SUM(VOL,bc),sum(AMOUNT,bc)/sum(v,bc)/100*SUM(H,bc)/SUM(C,BC)); 点石成金L:=IF(close>100,SUM(l*VOL,bc)/SUM(VOL,bc),sum(AMOUNT,bc)/sum(v,bc)/100*SUM(L,bc)/SUM(C,BC)); 点石成金:if(ref(h,bc-1)>ref(h,bc) and ref(h,bc-1)>ref(h,bc-2) ,点石成金h,点石成金l),colorred,LINETHICK2; 2 bc:=BARSLAST(DISPSTATUS=1)+1; 点石成金H:IF(close>100,SUM(h*VOL,bc)/SUM(VOL,bc),sum(AMOUNT,bc)/sum(v,bc)/100*SUM(H,bc)/SUM(C,BC)),colorred,LINETHICK2; 点石成金L:IF(close>100,SUM(l*VOL,bc)/SUM(VOL,bc),sum(AMOUNT,bc)/sum(v,bc)/100*SUM(L,bc)/SUM(C,BC)),colorblue,LINETHICK2; 点石成金:if(ref(h,bc-1)>ref(h,bc) and ref(h,bc-1)>ref(h,bc-2) ,点石成金h,点石成金l),colorred,LINETHICK2; 发个可自动定位高底点的点石成金(带自动回归通道) 先建个引用公式:XH-Z ***这个引用公式不少人的飞狐里有,但我这个改了一下,可用于小周期,原版的那个小周期不行。 N=20 zzz:=IF(DATATYPE<4,ZIG(4,2.5),ZIG(4,5)); zz:=IF(DATATYPE<5,zzz,ZIG(4,10)); z:=IF(DATATYPE<6,zz,ZIG(4,20));; f:=z-ref(z,1); d:=FILTER(refx(f>0 and ref(f,1)<0,1)or BARPOS=1,2);{低点} wd:=barslast(d);{低点位置} g:=FILTER(refx(f<0 and ref(f,1)>0,1)or BARPOS=1,2);{高点} wg:=barslast(g);{高点位置} xwd:=if(sum(wd=0,2)>1,1,wd)linethick0;//低点位置确认 xwg:=if(sum(wg=0,2)>1,1,wg)linethick0;//高点位置确认 fd:=hhv(h,xwd)/ref(L,xwd)-1>n/100;//低点巩固系数 fg:=1-LLv(L,xwg)/ref(h,xwg)>n/100;//高点巩固系数 dqz:=BACKSET(ISLASTBAR and wd<wg and fd=0,xwd+1)=0;//低点过滤系数 gqz:=BACKSET(ISLASTBAR and wg<wd and fg=0,xwd+1)=0;//高点过滤系数 {以下输出信号} dd:dqz*d or BARPOS=1;{输出低点} gg:gqz*g or BARPOS=1;{输出高点} 再见主公式: dd:="xh-z.dd";//(n); gg:="xh-z.gg";//(n); gd:=FILTER(dd+gg,4); dg:=barslast(gd); p1:=SYSPARAM(1)-1; p:=if(0>=p1,SYSPARAM(1),p1); Sgd:=sum(gd,0); gdS:=Sgd[p]-Sgd+1; W1:=barssince(gdS=gdS[p]); if w1[p]>1 then begin Bx:=p=BARPOS; By:=forcast(c,W1[p]+1); Ax:=W1=0; Ay:=By[p]-refx(SLOPE(c,W1[p]+1),W1[p])*W1[p]; zx:LINEVALUE(Ax,Ay,Bx,By,0,0)COLORgreen,LINETHICK1; sh:=hhv(h-zx,w1+1); sL:=hhv(zx-L,w1+1); sx:LINEVALUE(Ax,Ay+sh[p],Bx,By+sh,0,0)COLOR008eff,LINETHICK1; xx:LINEVALUE(Ax,Ay-sL[p],Bx,By-sL,0,0)COLORff9963,LINETHICK1;end; STICKLINE(Ax or Bx,sx,xx,0.01,0)COLORff9963,POINTDOT; K:=(by[p]-ay[p-w1[p]])/W1[p]; 斜:k*100,LINETHICK0; 宽:abs((sx-xx)*cos(ATAN(k)*5.73)),LINETHICK0; 宽%:宽/zx[p]*100,LINETHICK0; bc:=w1+1; 点石成金H:=IF(close>100,SUM(h*VOL,bc)/SUM(VOL,bc),sum(AMOUNT,bc)/sum(v,bc)/100*SUM(H,bc)/SUM(C,BC)); 点石成金L:=IF(close>100,SUM(l*VOL,bc)/SUM(VOL,bc),sum(AMOUNT,bc)/sum(v,bc)/100*SUM(L,bc)/SUM(C,BC)); 点石成金:if(斜<=0 ,点石成金h,点石成金l),colorred,LINETHICK2; bc1:=barslast(SYSPARAM(1)=barpos)+1; 金H:=IF(close>100,SUM(h*VOL,bc1)/SUM(VOL,bc1),sum(AMOUNT,bc1)/sum(v,bc1)/100*SUM(H,bc1)/SUM(C,BC1)); 金L:=IF(close>100,SUM(l*VOL,bc1)/SUM(VOL,bc1),sum(AMOUNT,bc1)/sum(v,bc1)/100*SUM(L,bc1)/SUM(C,BC1)); 点石成金1:if(ref(h,bc1-1)>ref(h,bc1) and ref(h,bc1-1)>ref(h,bc1-2) ,金h,金l),colorblue,LINETHICK2; |
联系客服