|
我水平有限,赢顺上面没有找到表达的方法。再送你一个通达信的升级版吧。
{参数N是3分5分或15分K线切换选项,N1是方框背景的参数,当N=N1时,K线和背景重叠。}
{十五分K背景}
M1:=FLOOR(N1/2);
RY11:=BARSCOUNT(CLOSE)-(N1-M1);
RY01:=FRACPART(RY11/N1);
RY21:=ROUND(RY01*N1);
PH1:=IF(RY01=0,REFX(HHV(H,N1),N1),REFX(HHV(H,N1),(RY21-M1)));
PL1:=IF(RY01=0,REFX(LLV(L,N1),N1),REFX(LLV(L,N1),(RY21-M1)));
X0:=IFF(N1=3,N1*(26/7),IF(N1=5,N1*(26/7),DRAWNULL));
X2:=IF(N1=15,(N1*(26/7)+4),X0);
STICKLINE(RY21=N1-1,PH1,PL1,X2,0),COLOR333333;
{画三分五分或十五分K线}
M2:=FLOOR(N/2);
M:=IF(N=3 OR N=5 OR N=15,M2,DRAWNULL);
RY1:=BARSCOUNT(CLOSE)-(N-M);
RY0:=FRACPART(RY1/N);
RY2:=ROUND(RY0*N);
PO:=IF(RY0=0,REF(O,1),REF(O,(RY2-M)));
PC:=IF(RY0=0,REFX(C,N),REFX(C,(RY2-M)));
PH:=IF(RY0=0,REFX(HHV(H,N),N),REFX(HHV(H,N),(RY2-M)));
PL:=IF(RY0=0,REFX(LLV(L,N),N),REFX(LLV(L,N),(RY2-M)));
X1:=IFF(N=3,N*(26/7),IF(N=5,N*(26/7),DRAWNULL));
X:=IF(N=15,(N*(26/7)+4),X1);
{画出阴阳大K线}
{STICKLINE(RY2=N-1 ,PH,PL,X,0),COLOR333333;}
STICKLINE(RY2=N-1 AND PC>PO,PC,PO,X,0),COLOR000055;
STICKLINE(RY2=N-1 AND PC<PO,PH,PL,X/5,0),COLOR551100;
STICKLINE(RY2=N-1 AND PC>PO,PH,PL,X/5,0),COLOR000055;
STICKLINE(RY2=N-1 AND PC<PO,PO,PC,X,0),COLOR551100;
STICKLINE(RY2=N-1 AND PC=PO,PH,PL,X/5,0),COLORLIGRAY;
STICKLINE(RY2=N-1 AND PC=PO,(PC+(ATR/12)),(PC-(ATR/12)),X+1,0),COLORLIGRAY;
DRAWKLINE(H,O,L,C);
{在背景上画出高低点价位}
DRAWNUMBER(RY21=N1-1,(PH1+(EMA(ATR,100))/2),PH1);
DRAWNUMBER(RY21=N1-1,(PL1-(EMA(ATR,100))/2),PL1),DRAWABOVE;
|
|