思路:将前高低点区间作对角斜线分割!
以观后期股价运行!
{【睿方图】 - 理想论坛 壹瓣杺埖 }
{请设置参数:HDAY 1 999 15 寻找区间高点
LDAY 1 999 15 寻找区间低点
PE 1 8 1 移动网格
KE 0 99 0 移动K线 }
CURR:=CURRBARSCOUNT;
TCH:=CONST(FINDHIGH(H,0,HDAY*10,1));
GTT:=CONST(BARSLAST(TCH=H))+1;
SX跌H:=CONST(IF(GTT=1,H,REF(H,GTT-1)));
BCL:=CONST(FINDLOW(L,0,LDAY*10,1));
DTT:=CONST(BARSLAST(BCL=L))+1;
SX涨L:=CONST(IF(DTT=1,L,REF(L,DTT-1)));
IM68:=((SX跌H-SX涨L)/6-(SX跌H-SX涨L)/8);
GH跌X:=SX跌H+(SX跌H-SX涨L)/8; DL涨X:=SX涨L-(SX跌H-SX涨L)/8;
STICKLINE(1=1,H,L,9,0)COLOR000000;
GTHT:=IF(DTT>GTT,DTT,GTT); R:=ABS(GTT-DTT);
DRAWBAND(IF(CURR<=GTHT+R/8,GH跌X,DRAWNULL),RGB(80,124,124),DL涨X,RGB(80,124,124));
DRAWBAND(IF(CURR<=GTHT+R/8,SX跌H,DRAWNULL),RGB(8,168,168),SX跌H,RGB(8,168,168));
DRAWBAND(IF(CURR<=GTHT+R/8,SX涨L,DRAWNULL),RGB(8,168,168),SX涨L,RGB(8,168,168));
DRAWBAND(IF(CURR<=GTHT+R/8,SX跌H-(SX跌H-SX涨L)/8,DRAWNULL),RGB(80,124,24),SX涨L+(SX跌H-SX涨L)/8,RGB(80,124,24));
DRAWBAND(IF(CURR<=GTHT+R/8,SX跌H-(SX跌H-SX涨L)/4,DRAWNULL),RGB(0,124,154),SX涨L+(SX跌H-SX涨L)/4,RGB(0,124,154));
DRAWBAND(IF(CURR<=GTHT+R/8,SX跌H-(SX跌H-SX涨L)*3/8,DRAWNULL),RGB(80,124,24),SX涨L+(SX跌H-SX涨L)*3/8,RGB(80,124,24));
DRAWBAND(IF(CURR<=GTHT+R/8,(SX跌H+SX涨L)/2,DRAWNULL),RGB(8,168,168),(SX跌H+SX涨L)/2,RGB(8,168,168));
DRAWTEXT(CURR=GTHT,SX涨L-IM68,' 壹瓣杺埖 '),COLOR8899AA;
SX涨:=(CURR=KE+DTT)-1;
SX跌:=(CURR=KE+GTT)-1;
SX涨跌:=DRAWLINE(SX涨=0,SX涨L,SX跌=0,SX跌H,0);
SX跌涨:=DRAWLINE(SX涨=0,SX跌H,SX跌=0,SX涨L,0);
S涨跌X:=DRAWLINE(SX跌=0,SX跌H,SX涨=0,SX涨L,0);
S跌涨X:=DRAWLINE(SX跌=0,SX涨L,SX涨=0,SX跌H,0);
SX涨跌X:=IF(DTT>GTT,SX涨跌,S涨跌X);
SX跌涨X:=IF(DTT>GTT,SX跌涨,S跌涨X);
PEDAY:=IF(PE=1,0,IF(PE=2,R/2,IF(PE=3,R,IF(PE=4,R+R/2,IF(PE=5,2*R,IF(PE=6,2*R+R/2,IF(PE=7,3*R,3*R+R/2)))))));
SLXH:IF(BETWEEN(CURR,KE+DTT-PEDAY,KE+GTT-PEDAY),(SX跌H+SX涨L)/2,DRAWNULL),COLOR8E0000,LINETHICK3;
H跌X:IF(BETWEEN(CURR,KE+DTT-PEDAY,KE+GTT-PEDAY),SX跌H,DRAWNULL),COLOR8E0000,LINETHICK3;
L涨X:IF(BETWEEN(CURR,KE+DTT-PEDAY,KE+GTT-PEDAY),SX涨L,DRAWNULL),COLOR8E0000,LINETHICK3;
STICKLINE(REF(SX涨=0,PEDAY) OR REF(SX跌=0,PEDAY) OR REF(CURR=KE+ROUND((GTT+DTT)/2),PEDAY),SX跌H,SX涨L,0.1,0),COLOR8E0000;
X涨点:=IF(SX涨>SX跌,SX涨,SX跌);
X跌点:=IF(SX涨>SX跌,SX涨,SX跌);
睿分1:REF(DRAWLINE(X跌点=0,SX跌H,CURR=KE+ROUND((GTT+DTT)/2),SX涨L,0),PEDAY),COLOR00FFFF;
睿分2:REF(DRAWLINE(X跌点=0,(SX跌H+SX涨L)/2,CURR=KE+ROUND((GTT+DTT)/2),SX涨L,0),PEDAY),COLORFF0000,LINETHICK2;
睿分3:REF(DRAWLINE(X跌点=0,SX涨L,CURR=KE+ROUND((GTT+DTT)/2),SX跌H,0),PEDAY),COLOR00FFFF;
睿分4:REF(DRAWLINE(X跌点=0,SX跌H,X涨点=0,(SX跌H+SX涨L)/2,0),PEDAY),COLOR00FFFF;
睿分5:REF(DRAWLINE(X跌点=0,SX涨L,X涨点=0,(SX跌H+SX涨L)/2,0),PEDAY),COLOR00FFFF;
睿分6:REF(DRAWLINE(X跌点=0,(SX跌H+SX涨L)/2,CURR=KE+ROUND((GTT+DTT)/2),SX跌H,0),PEDAY),COLORFF0000,LINETHICK2;
睿分7:REF(DRAWLINE(X跌点=0,(SX跌H+SX涨L)/2,X涨点=0,SX跌H,0),PEDAY),COLOR00FFFF;
睿分8:REF(DRAWLINE(X跌点=0,(SX跌H+SX涨L)/2,X涨点=0,SX涨L,0),PEDAY),COLOR00FFFF;
睿分9:REF(DRAWLINE(CURR=KE+ROUND((GTT+DTT)/2),SX涨L,X涨点=0,(SX跌H+SX涨L)/2,0),PEDAY),COLORFF0000,LINETHICK2;
睿分10:REF(DRAWLINE(CURR=KE+ROUND((GTT+DTT)/2),SX跌H,X涨点=0,(SX跌H+SX涨L)/2,0),PEDAY),COLORFF0000,LINETHICK2;
睿分11:REF(DRAWLINE(CURR=KE+ROUND((GTT+DTT)/2),SX跌H,X涨点=0,SX涨L,0),PEDAY),COLOR00FFFF;
睿分12:REF(DRAWLINE(CURR=KE+ROUND((GTT+DTT)/2),SX涨L,X涨点=0,SX跌H,0),PEDAY),COLOR00FFFF;
睿分13:REF(SX涨跌X,PEDAY),COLOR8E00E8;
睿分14:REF(SX跌涨X,PEDAY),COLOR8E00E8;
IF(BETWEEN(CURR,KE+DTT,KE+GTT),SX跌H,DRAWNULL),COLOR8E0000,LINETHICK3;
IF(BETWEEN(CURR,KE+DTT,KE+GTT),SX涨L,DRAWNULL),COLOR8E0000,LINETHICK3;
STICKLINE(SX涨=0 OR SX跌=0,SX跌H,SX涨L,0.1,0),COLOR8E0000;
DRAWTEXT(CURR=KE+ROUND((GTT+DTT)/2)+5,SX跌H*0.98,'历史区间'),COLOR8800AA;
DRAWKLINE(IF(CURR>KE,REFX(H,KE),DRAWNULL),IF(CURR>KE,REFX(O,KE),DRAWNULL),
IF(CURR>KE,REFX(L,KE),DRAWNULL),IF(CURR>KE,REFX(C,KE),DRAWNULL));
|