本指标只有画线用到了未来函数,主图副图倍量、选股都没有未来函数,如果不喜欢飘过
主图源码:
DRAWTEXT(HIGH>=REF(CLOSE,1)*1.095,HIGH,’涨停’),COLOR00FFFF;
STICKLINE(V/REF(V,1)>2,OPEN,CLOSE,1,0),COLOR00FFFF;
DRAWTEXT(REF(CLOSE,1)>=LOW*1.095,LOW,’跌停’),COLOR80FFFF;
G:=MA(C,5);D:=MA(C,10);
HH:=REF(H,5)=HHV(H,11);
LL:=REF(L,5)=LLV(L,11);
FG01:=BACKSET(HH,6)>BACKSET(HH,5);
FD01:=BACKSET(LL,6)>BACKSET(LL,5);
FG02:=IF(BARSLAST(FG01)=BARSLAST(FD01) AND G>D,FG01,
IF(BARSLAST(FD01)>BARSLAST(FG01),FG01,0));
FD02:=IF(BARSLAST(FG01)=BARSLAST(FD01) AND D>G,FD01,
IF(BARSLAST(FG01)>BARSLAST(FD01),FD01,0));
FG0:=FG02 AND H=HHV(H,BARSLAST(FD02));
FD0:=FD02 AND L=LLV(L,BARSLAST(FG02));
GP:IF(FG0,H,DRAWNULL),CIRCLEDOT,COLORCYAN;
DP:IF(FD0,L,DRAWNULL),CIRCLEDOT,COLORCYAN;
GQ:=L>REF(H,1) AND DAY!=REF(DAY,1);
DQ:=H<REF(L,1) AND DAY!=REF(DAY,1);
GQL:=REF(L,BARSLAST(GQ));
DQH:=REF(H,BARSLAST(DQ));
FGH:=REF(H,BARSLAST(FG0));
FGL:=REF(L,BARSLAST(FG0));
FGH1:=REF(H,BARSLAST(FG0)+1);
FGL1:=REF(L,BARSLAST(FG0)+1);
FGH2:=REF(H,BARSLAST(FG0)+2);
FGL2:=REF(L,BARSLAST(FG0)+2);
FDH:=REF(H,BARSLAST(FD0));
FDL:=REF(L,BARSLAST(FD0));
FDH1:=REF(H,BARSLAST(FD0)+1);
FDL1:=REF(L,BARSLAST(FD0)+1);
FDH2:=REF(H,BARSLAST(FD0)+2);
FDL2:=REF(L,BARSLAST(FD0)+2);
FGZH:=IF(FGL<=FGL1,FGH2,FGH1);
FGZL:=IF(FGH1<FGL,FGL,IF(FGL<=FGL1,FGL2,FGL1));
FDZH:=IF(FDL1>FDH,FDH,IF(FDH>=FDH1,FDH2,FDH1));
FDZL:=IF(FDH>=FDH1,FDL2,FDL1);
FG1:=FGH>FDZH AND FG0;
FD1:=FDL<FGZL AND FD0;
FG:=FG1 AND FGH>FDH AND FGL>FDL AND FGL1>FDL;
FD:=FD1 AND FDL<FGL AND FDH<FGH AND FDH1<FGH;
BH0:=(H<=REF(H,1) AND L>=REF(L,1)) OR (H>=REF(H,1) AND L<=REF(L,1));
BHG:=COUNT(BH0,BARSLAST(FD0));
BHD:=COUNT(BH0,BARSLAST(FG0));
BGQ:=COUNT(GQ,BARSLAST(FD0));
BDQ:=COUNT(DQ,BARSLAST(FG0));
BK0:=IF(BHG>0,BHG+2,IF(BHD,BHD+2,3));
BK:=IF(BGQ,BK0-BGQ,IF(BDQ,BK0-BDQ,BK0));
G1X:=(FG AND BARSLAST(FD)>BK);
D1X:=(FD AND BARSLAST(FG)>BK);
G1:=(FG0 AND REF(H,BARSLAST(FG0))>=REF(H,BARSLAST(G1X)) AND BARSLAST(D1X)>BARSLAST(G1X))
OR (FG1 AND COUNT(GQ,BARSLAST(FD1))>0 AND REF(H,BARSLAST(FG1))>REF(H,BARSLAST(G1X)));
D1:=(FD0 AND REF(L,BARSLAST(FD0))<=REF(L,BARSLAST(D1X)) AND BARSLAST(G1X)>BARSLAST(D1X))
OR (FD1 AND COUNT(DQ,BARSLAST(FG1))>0 AND REF(L,BARSLAST(FD1))<REF(H,BARSLAST(D1X)));
G1H:=IF(BARSLAST(D1)>BARSLAST(G1),REF(H,BARSLAST(G1)),REF(H,BARSLAST(D1))),;
D1L:=IF(BARSLAST(G1)>BARSLAST(D1),REF(L,BARSLAST(D1)),REF(L,BARSLAST(G1)));
G2:=G1 AND H=HHV(G1H,BARSLAST(D1)+1) AND H>REF(H,1) AND BARSLAST(D1)>BARSLAST(G1);
D2:=D1 AND L=LLV(D1L,BARSLAST(G1)+1) AND L<REF(L,1) AND BARSLAST(G1)>BARSLAST(D1);
G3:=G2 OR (FG0 AND REF(H,BARSLAST(FG0))>REF(H,BARSLAST(G2)) AND BARSLAST(D2)>BARSLAST(G2));
D3:=D2 OR (FD0 AND REF(L,BARSLAST(FD0))<REF(L,BARSLAST(D2)) AND BARSLAST(G2)>BARSLAST(D2));
GPB:IF(G1X,H,DRAWNULL),CIRCLEDOT,COLORYELLOW;
DPB:IF(D1X,L,DRAWNULL),CIRCLEDOT,COLORYELLOW;
MMM:="MA.MA1"(5),NODRAW,COLORRED;
NN:=G3;UU:=D3;
L1:DRAWLINE(UU,L,NN, H,0),COLORYELLOW;
L2:DRAWLINE(NN,H,UU, L,0),COLORYELLOW;
DRAWNUMBER(UU,L*0.99,L);
DRAWNUMBER(NN,H*1.02,H);
DRAWLINE(UU,L,REF(UU,1),REF(L,1),1)COLORWHITE, LINETHICK2;
DRAWLINE(NN,H,REF(NN,1),REF(H,1),1)COLORWHITE, LINETHICK2;
LFM:CLOSE;
ADVLFM:LFM;
M1:=3;
M2:=6;
倍量数字画线
{m1 1 100 10
m2 1 100 20 }
VVOL:IF(CURRBARSCOUNT=1 AND PERIOD=5,VOL*240/FROMOPEN,DRAWNULL),NODRAW;
STICKLINE(CURRBARSCOUNT=1 AND PERIOD=5,VVOL,0,-1,-1),COLOR00C0C0;
VOLUME:VOL,VOLSTICK;
MAVOL1:MA(VOLUME,M1);
MAVOL2:MA(VOLUME,M2);
STICKLINE(V>REF(V,1)*2,REF(V,1),V,3,0),COLOR00FFFF;
STICKLINE(V*2<REF(V,1),0,V,3,0),COLORFF8000;
TOTAL:=IF(PERIOD=1,5,IF(PERIOD=2,15,IF(PERIOD=3,30,IF(PERIOD=4,60,IF(PERIOD=5,240,1)))));
MTIME:=MOD(FROMOPEN,TOTAL);
CTIME:=IF(MTIME<0.5,TOTAL,MTIME);
STICKLINE(CURRBARSCOUNT=1 && (SETCODE=0 || SETCODE=1),VVOL,0,-1,-1),COLOR00C0C0;
TJ1:=V>=REF(V,1) AND V<REF(V,1)*2;
TJ2:=V>=REF(V,1)*2 AND V<REF(V,1)*3;
TJ3:=V>=REF(V,1)*3 AND V<REF(V,1)*4;
TJ4:=V>=REF(V,1)*4 AND V<REF(V,1)*5;
TJ5:=V>=REF(V,1)*5 AND V<REF(V,1)*6;
TJ6:=V>=REF(V,1)*6 AND V<REF(V,1)*7;
STICKLINE(TJ1,V/2,V/2,2,0)COLORYELLOW;
STICKLINE(TJ2,V*2/3,V*2/3,2,0)COLORGREEN;
STICKLINE(TJ2,V/3,V/3,2,0)COLORGREEN;
STICKLINE(TJ3,V/4,V/4,2,0)COLORRED;
STICKLINE(TJ3,V/2,V/2,2,0)COLORRED;
STICKLINE(TJ3,V*3/4,V*3/4,2,0)COLORRED;
STICKLINE(TJ4,V/5,V/5,2,0)COLORBLUE;
STICKLINE(TJ4,V*2/5,V*2/5,2,0)COLORBLUE;
STICKLINE(TJ4,V*3/5,V*3/5,2,0)COLORBLUE;
STICKLINE(TJ4,V*4/5,V*4/5,2,0)COLORBLUE;
STICKLINE(TJ5,V/6,V/6,2,0)COLORLIMAGENTA;
STICKLINE(TJ5,V/3,V/3,2,0)COLORLIMAGENTA;
STICKLINE(TJ5,V/2,V/2,2,0)COLORLIMAGENTA;
STICKLINE(TJ5,V*2/3,V*2/3,2,0)COLORLIMAGENTA;
STICKLINE(TJ5,V*5/6,V*5/6,2,0)COLORLIMAGENTA;
DRAWTEXT(TJ1,V*1.03,’1′)COLORYELLOW;
DRAWTEXT(TJ2,V*1.03,’2′)COLORGREEN;
DRAWTEXT(TJ3,V*1.03,’3′)COLORRED;
DRAWTEXT(TJ4,V*1.01,’4′)COLORBLUE;
DRAWTEXT(TJ5,V*1.01,’5′)COLORLIMAGENTA;
V,VOLSTICK;
AAAAAAA:DRAWLINE(VOL>=HHV(VOL,35),VOL,VOL<=LLV(VOL,8) ,HHV(VOL,3),1);
BBBBBBB:DRAWLINE(VOL<=LLV(VOL,8),VOL,VOL>=HHV(VOL,35),HHV(VOL,3),0);
量:V,VOLSTICK;
起点1:=CONST(SUMBARS(V/REF(V,1)>=2,1));
起点2:=CONST(SUMBARS(V/REF(V,1)>=2,2));
起点3:=CONST(SUMBARS(V/REF(V,1)>=2,3));
起点4:=CONST(SUMBARS(V/REF(V,1)>=2,4));
起点5:=CONST(SUMBARS(V/REF(V,1)>=2,5));
线1:IF(起点1>=CURRBARSCOUNT,CONST(REF(V,起点1-1)),DRAWNULL),COLORLIGREEN;
线2:IF(起点2>=CURRBARSCOUNT,CONST(REF(V,起点2-1)),DRAWNULL),COLORLIGREEN;
线3:IF(起点3>=CURRBARSCOUNT,CONST(REF(V,起点3-1)),DRAWNULL),COLORLIGREEN;
线4:IF(起点4>=CURRBARSCOUNT,CONST(REF(V,起点4-1)),DRAWNULL),COLORLIGREEN;
线5:IF(起点5>=CURRBARSCOUNT,CONST(REF(V,起点5-1)),DRAWNULL),COLORLIGREEN;
DIF1:=EMA(DCLOSE,12)-EMA(DCLOSE,26);
DEA1:=EMA(DIF1,9);
MACD1:=(DIF1-DEA1)*2*60;
MACDA:IF(MACD1>REF(MACD1,1),MACD1,DRAWNULL),
STICK,COLORMAGENTA,LINETHICK1;
MACDB:IF(MACD1<REF(MACD1,1),MACD1,DRAWNULL),
STICK,COLORLICYAN,LINETHICK1;
A10:=BARSLAST(REF(CROSS(DIF1,DEA1),1));
底背:=REF(CLOSE,A10+1)>CLOSE AND DIF1>REF(DIF1,A10+1) AND CROSS(DIF1,DEA1);
DRAWLINE(A10=0,DEA1,底背,DEA1,0),COLORYELLOW,LINETHICK3;
DRAWTEXT(底背,-9,’*底背’),COLORRED;
JCCOUNT:=COUNT(CROSS(DIF1,DEA1),BARSLAST(DEA1>=0));
金叉:=CROSS(DIF1,DEA1) AND DEA1<0 AND COUNT(JCCOUNT=2,21)=1;
DRAWICON(金叉,DEA1*1.04,26) ;
DRAWTEXT(金叉,-2,’*金叉’),COLORYELLOW;
今日换手:VOL/CAPITAL*100,COLORYELLOW,NODRAW;
今日量【万手】:VOL/10000,COLORRED;
倍量选股公式:
AA:VOL>REF(V,1)*1.9;
评论(0)