九毛八公式指标
请老师帮忙把轨道指标 在中轨线下涨停 做个预警选股 谢谢 TC1:=IF(H=HHV(H,8*6),H,DRAWNULL); TC2:=CONST(BARSLAST(TC1=H))+1; UPPER:=CONST(IF(TC2=1,H,REF(H,TC2-1))); BC1:=IF(L=LLV(L,8*6),L,DRAWNULL); BC2:=CONST(BARSLAST(BC1=L))+1; LOWER:=CONST(IF(BC2=1,L,REF(L,BC2-1))); LP:=CURRBARSCOUNT<=BC2 AND L=LOWER;{低点定位} HP:=CURRBARSCOUNT<=TC2 AND H=UPPER;{高点定位} STICKLINE(IF(BC2>TC2,HP,LP),LOWER,UPPER,0,0),COLOR628962; STICKLINE(IF(BC2>TC2,LP,HP),LOWER,UPPER,0,0),COLOR628962; NOD:=(IF(TC2>BC2,TC2,BC2)-IF(TC2>BC2,BC2,TC2));{用时} LR1:=FORCAST(C,NOD+1); NP:IF(CURRBARSCOUNT<=MAX(BC2,TC2),CONST(IF(MIN(TC2,BC2)=1,LR1,REF(LR1,MIN(TC2,BC2)-1))),DRAWNULL),POINTDOT,COLOR93BDA8;{近点} LR2:=SLOPE(C,NOD+1); LR3:=CONST(IF(MIN(TC2,BC2)=1,LR2,REF(LR2,MIN(TC2,BC2)-1))); FP:NP-LR3*(NOD),POINTDOT,COLOR93BDA8;{远点} EQU:(NP+FP)/2,POINTDOT,COLOR93BDA8; AD:=ABS(NP-FP);{高差}; DBL:=BARSLAST(BC1!=DRAWNULL)+1; DBH:=BARSLAST(TC1!=DRAWNULL)+1; BSP:=IF(BC2>TC2,DBL,DBH)-1; LRL:=IF(NP>FP,FP+AD/NOD*BSP,FP-AD/NOD*BSP); AT1:=IF(BETWEEN(CURRBARSCOUNT,BC2,TC2) AND H>LRL,H,LRL); AT2:=HHV(AT1-LRL,MAX(BC2,TC2)); AT3:=CONST(BARSLAST(AT1-LRL=AT2)); AT4:=CONST(IF(AT3=0,H,REF(H,AT3))); AT5:=CONST(IF(AT3=0,AT1-LRL,REF(AT1-LRL,AT3))); ATL:=LRL+AT5; UT1:=IF(BETWEEN(CURRBARSCOUNT,BC2,TC2) AND L
公式模块:
tc1:=if(h=hhv(h,8*6),h,drawnull); tc2:=const(barslast(tc1=h))+1; upper:=const(if(tc2=1,h,ref(h,tc2-1))); bc1:=if(l=llv(l,8*6),l,drawnull); bc2:=const(barslast(bc1=l))+1; lower:=const(if(bc2=1,l,ref(l,bc2-1))); lp:=currbarscount<=bc2 and l=lower;{低点定位} hp:=currbarscount<=tc2 and h=upper;{高点定位} nod:=(if(tc2>bc2,tc2,bc2)-if(tc2>bc2,bc2,tc2));{用时} lr1:=forcast(c,nod+1); np:=if(currbarscount<=max(bc2,tc2),const(if(min(tc2,bc2)=1,lr1,ref(lr1,min(tc2,bc2)-1))),drawnull);{近点} lr2:=slope(c,nod+1); lr3:=const(if(min(tc2,bc2)=1,lr2,ref(lr2,min(tc2,bc2)-1))); fp:=np-lr3*(nod);{远点} equ:=(np+fp)/2; ad:=abs(np-fp);{高差}; dbl:=barslast(bc1!=drawnull)+1; dbh:=barslast(tc1!=drawnull)+1; bsp:=if(bc2>tc2,dbl,dbh)-1; lrl:=if(np>fp,fp+ad/nod*bsp,fp-ad/nod*bsp); at1:=if(between(currbarscount,bc2,tc2) and h>lrl,h,lrl); at2:=hhv(at1-lrl,max(bc2,tc2)); at3:=const(barslast(at1-lrl=at2)); at4:=const(if(at3=0,h,ref(h,at3))); at5:=const(if(at3=0,at1-lrl,ref(at1-lrl,at3))); atl:=lrl+at5; ut1:=if(between(currbarscount,bc2,tc2) and l<lrl,l,lrl); ut2:=hhv(lrl-ut1,max(bc2,tc2)); ut3:=const(barslast(lrl-ut1=ut2)); ut4:=const(if(ut3=0,h,ref(h,ut3))); ut5:=const(if(ut3=0,lrl-ut1,ref(lrl-ut1,ut3))); utl:=lrl-ut5; rh:=if(currbarscount>=min(bc2,tc2)-10,atl,const(ref(atl,min(bc2,tc2)-11)));{限制高} rl:=if(currbarscount>=min(bc2,tc2)-10,utl,const(ref(utl,min(bc2,tc2)-11)));{限制低} 中轨:=if(np>fp,if(lrl<=rh,lrl,drawnull),if(lrl>=rl,lrl,drawnull)); 中轨下涨停:ref(c,1)*1.1-c<0.01 and c<中轨;