咨詢內容:
自編指標不兼容,三分鐘不顯示指標,還有三分鐘五分鐘十五分鐘沒有昨結,指標抬頭顯示很多0000,是否可以去掉這些0000
{HH1:=REF(HHV(HIGH,15),1);
LL1:=REF(LLV(LOW,15),1);
開盤點:=CLOSE>OPEN AND OPEN<LL1 AND CROSS(CLOSE,LL1);
DRAWTEXT(CLOSE>OPEN AND OPEN<LL1,LOW,'多'),COLOR00FFFF;
DRAWTEXT(CLOSE<OPEN AND OPEN>HH1,HIGH,'空'),COLOR00FFFF;}
{開盤劃線}
{1分=32460,3分=32580,5分=32700,10分=33000,15分=33300,30分=34200,10.31分=37860,13.31分=48660}
T9:=TIME0;
{1K}
{累加計算當日總成交量}
TV:=IF(DATE<>REF(DATE,1),0,REF(TV,1))+V;
{累加計算當日總成交金額(價×量)}
TT:=IF(DATE<>REF(DATE,1),0,REF(TT,1))+(C+O+H+L)*0.25*V;
{當日均價}
分時均線AP:TT/TV,COLOR000000;
HH1:=REF(HHV(HIGH,225),1);{求上周期內最高值}
LL1:=REF(LLV(LOW,225),1);{求上周期內最低值}
DRAWSL(T9=32460 AND DATAPERIOD=1,HH1,0,225,0),COLOR0000FF;{昨最高價顯紅水平線}
DRAWSL(T9=32460 AND DATAPERIOD=1,LL1,0,225,0),COLOR40FF00;{昨最低價顯綠水平線}
DRAWSL(T9=32460 AND DATAPERIOD=1,OPEN,0,225,0),COLORFF8000;{1分鐘開盤顯黃水平線}
DRAWSL(T9=32460 AND DATAPERIOD=1,REF(分時均線AP,1),0,225,0),COLORFFFFFF;{上日結算價1分鐘顯白水平線}
DRAWTEXT(T9=32460 AND DATAPERIOD=1,HH1,'高 '),COLOR0000FF,ALIGN2;
DRAWTEXT(T9=32460 AND DATAPERIOD=1,LL1,'低 '),COLOR40FF00,ALIGN2;
DRAWTEXT(T9=32460 AND DATAPERIOD=1,OPEN,'開 '),COLORFF8000,ALIGN2;
DRAWTEXT(T9=32460 AND DATAPERIOD=1,REF(分時均線AP,1),'昨結 '),COLORFFFFFF,ALIGN2;
VERTLINE(T9=32460 AND DATAPERIOD=1),COLOR00FFFF;
STICKLINE(TIME0=32460 AND CLOSE>=OPEN AND DATAPERIOD=1,OPEN,CLOSE,4,0),COLORFF00FF; {開盤第1分陽線,則顯粉紅K線}
STICKLINE(TIME0=32460 AND CLOSE<=OPEN AND DATAPERIOD=1,OPEN,CLOSE,4,0),COLORGREEN; {開盤第1分,則顯綠K線}
STICKLINE(TIME0=32460 AND DATAPERIOD=1,CLOSE,HIGH,1,0),COLOR00FFFF; {上影線}
STICKLINE(TIME0=32460 AND DATAPERIOD=1,LOW,CLOSE,1,0),COLOR00FFFF; {下影線}
DRAWTEXT(CLOSE>OPEN AND OPEN<LL1 AND T9=32460 AND DATAPERIOD=1,LOW-4,'多'),COLOR00FFFF;{1分如陽線,則顯字"多"}
DRAWTEXT(CLOSE<OPEN AND OPEN>HH1 AND T9=32460 AND DATAPERIOD=1,HIGH+3,'空'),COLOR00FFFF;{陰線,則顯字"空"}
DRAWTEXT(T9=32460 AND DATAPERIOD=1 AND C>=HH1,HH1,'高'),COLOR00FFFF;
DRAWTEXT(T9=32460 AND DATAPERIOD=1 AND C<=LL1,LL1,'低'),COLOR00FFFF;
DRAWTEXT(T9=32460 AND DATAPERIOD=1 AND BETWEEN(C,HH1,LL1),C*1.0001,'高'),COLOR00FFFF;
DRAWTEXT(T9=32460 AND DATAPERIOD=1,REF(C,1),'昨收 '),COLORFF00FF,ALIGN2;
DRAWTEXT(T9=32460 AND DATAPERIOD=1 AND C>=HH1,REF(C,1),'昨收'),COLORFF00FF;
DRAWSL(T9=32460 AND DATAPERIOD=1,REF(C,1),0,225,0),COLORFF00FF;
{
P1:=BARSLAST(T9=32460 AND DATAPERIOD=1);
高:REF(HH1,P1),LINETHICK0,COLOR0000FF;
低:REF(LL1,P1),LINETHICK0,COLOR40FF00;
開:REF(OPEN,P1),LINETHICK0,COLORFF8000;
昨收:REF(REF(C,1),P1),COLORFF00FF,LINETHICK0;}
{5}
HH5:=REF(HHV(HIGH,45),1);{求上周期內最高值}
LL5:=REF(LLV(LOW,45),1);{求上周期內最低值}
DRAWSL(T9=32700 AND DATAPERIOD=2,HH5,0,45,0),COLOR0000FF;{昨最高價顯紅水平線}
DRAWSL(T9=32700 AND DATAPERIOD=2,LL5,0,45,0),COLOR40FF00;{昨最低價顯綠水平線}
DRAWSL(T9=32700 AND DATAPERIOD=2,OPEN,0,45,0),COLORFF8000;{5分鐘開盤顯黃水平線}
DRAWSL(T9=32700 AND DATAPERIOD=2,REF(C,1),0,45,0),COLORFF00FF;{昨收盤價顯粉紅水平線}
DRAWTEXT(T9=32700 AND DATAPERIOD=2,HH5,' '),COLOR0000FF,ALIGN2;
DRAWTEXT(T9=32700 AND DATAPERIOD=2,LL5,' '),COLOR40FF00,ALIGN2;
DRAWTEXT(T9=32700 AND DATAPERIOD=2,OPEN,' '),COLORFF8000,ALIGN2;
VERTLINE(T9=32700 AND DATAPERIOD=2),COLOR00FFFF;
DRAWTEXT(T9=32700 AND DATAPERIOD=2,REF(C,1),' '),COLORFF00FF,ALIGN2;
{15}
HH15:=REF(HHV(HIGH,15),1);{求上周期內最高值}
LL15:=REF(LLV(LOW,15),1);{求上周期內最低值}
DRAWSL(T9=33300 AND DATAPERIOD=3,HH15,0,15,0),COLOR0000FF;{昨最高價顯紅水平線}
DRAWSL(T9=33300 AND DATAPERIOD=3,LL15,0,15,0),COLOR40FF00;{昨最低價顯綠水平線}
DRAWSL(T9=33300 AND DATAPERIOD=3,OPEN,0,15,0),COLORFF8000;{15分鐘開盤顯黃水平線}
DRAWSL(T9=33300 AND DATAPERIOD=3,REF(C,1),0,15,0),COLORFF00FF;{昨收盤價顯粉紅水平線}
DRAWTEXT(T9=33300 AND DATAPERIOD=3,HH15,' '),COLOR0000FF,ALIGN2;
DRAWTEXT(T9=33300 AND DATAPERIOD=3,LL15,' '),COLOR40FF00,ALIGN2;
DRAWTEXT(T9=33300 AND DATAPERIOD=3,OPEN,' '),COLORFF8000,ALIGN2;
VERTLINE(T9=33300 AND DATAPERIOD=3),COLOR00FFFF;
DRAWTEXT(T9=33300 AND DATAPERIOD=3,REF(C,1),' '),COLORFF00FF,ALIGN2;
{3}
HH3:=REF(HHV(HIGH,75),1);{求上周期內最高值}
LL3:=REF(LLV(LOW,75),1);{求上周期內最低值}
DRAWSL(T9=32580 AND DATAPERIOD=11,HH3,0,75,0),COLOR0000FF;{昨最高價顯紅水平線}
DRAWSL(T9=32580 AND DATAPERIOD=11,LL3,0,75,0),COLOR40FF00;{昨最低價顯綠水平線}
DRAWSL(T9=32580 AND DATAPERIOD=11,OPEN,0,75,0),COLORFF8000;{3分鐘開盤顯黃水平線}
DRAWSL(T9=32580 AND DATAPERIOD=11,REF(C,1),0,75,0),COLORFF00FF;{昨收盤價顯粉紅水平線}
DRAWTEXT(T9=32580 AND DATAPERIOD=11,HH3,' '),COLOR0000FF,ALIGN2;
DRAWTEXT(T9=32580 AND DATAPERIOD=11,LL3,' '),COLOR40FF00,ALIGN2;
DRAWTEXT(T9=32580 AND DATAPERIOD=11,OPEN,' '),COLORFF8000,ALIGN2;
VERTLINE(T9=32580 AND DATAPERIOD=11),COLOR00FFFF;
DRAWTEXT(T9=32580 AND DATAPERIOD=11,REF(C,1),' '),COLORFF00FF,ALIGN2;
P1:=BARSLAST(T9=32460 AND DATAPERIOD=1);
P5:=BARSLAST(T9=32700 AND DATAPERIOD=2);
P15:=BARSLAST(T9=33300 AND DATAPERIOD=3);
P3:=BARSLAST(T9=32580 AND DATAPERIOD=11);
昨高:IF(DATAPERIOD=1,REF(HH1,P1),IF(DATAPERIOD=2,REF(HH5,P5),IF(DATAPERIOD=3,REF(HH15,P15),IF(DATAPERIOD=11,REF(HH3,P3),0)))),LINETHICK0,COLOR0000FF;
昨低:IF(DATAPERIOD=1,REF(LL1,P1),IF(DATAPERIOD=2,REF(LL5,P5),IF(DATAPERIOD=3,REF(LL15,P15),IF(DATAPERIOD=11,REF(LL3,P3),0)))),LINETHICK0,COLOR40FF00;
開:IF(DATAPERIOD=1,REF(OPEN,P1),IF(DATAPERIOD=2,REF(OPEN,P5),IF(DATAPERIOD=3,REF(OPEN,P15),IF(DATAPERIOD=11,REF(OPEN,P3),0)))),LINETHICK0,COLORFF8000;
昨收:IF(DATAPERIOD=1,REF(REF(C,1),P1),IF(DATAPERIOD=2,REF(REF(C,1),P5),IF(DATAPERIOD=3,REF(REF(C,1),P15),IF(DATAPERIOD=11,REF(REF(C,1),P3),0)))),COLORFF00FF,LINETHICK0;
昨結:REF(REF(分時均線AP,1),P1),COLORFFFFFF,LINETHICK0;
?
?來源:程序化99網( www.kzuj.com.cn )
博易技術人員:
T9:=TIME0;
TV:=IF(DATE<>REF(DATE,1),0,REF(TV,1))+V;
TT:=IF(DATE<>REF(DATE,1),0,REF(TT,1))+(C+O+H+L)*0.25*V;
分時均線AP:TT/TV,COLOR000000;
HH1:=REF(HHV(HIGH,225),1);{求上周期內最高值}
LL1:=REF(LLV(LOW,225),1);{求上周期內最低值}
DRAWSL(T9=32460 AND DATAPERIOD=1,HH1,0,225,0),COLOR0000FF;{昨最高價顯紅水平線}
DRAWSL(T9=32460 AND DATAPERIOD=1,LL1,0,225,0),COLOR40FF00;{昨最低價顯綠水平線}
DRAWSL(T9=32460 AND DATAPERIOD=1,OPEN,0,225,0),COLORFF8000;{1分鐘開盤顯黃水平線}
DRAWSL(T9=32460 AND DATAPERIOD=1,REF(分時均線AP,1),0,225,0),COLORFFFFFF;{上日結算價1分鐘顯白水平線}
DRAWTEXT(T9=32460 AND DATAPERIOD=1,HH1,'高 '),COLOR0000FF,ALIGN2;
DRAWTEXT(T9=32460 AND DATAPERIOD=1,LL1,'低 '),COLOR40FF00,ALIGN2;
DRAWTEXT(T9=32460 AND DATAPERIOD=1,OPEN,'開 '),COLORFF8000,ALIGN2;
DRAWTEXT(T9=32460 AND DATAPERIOD=1,REF(分時均線AP,1),'昨結 '),COLORFFFFFF,ALIGN2;
VERTLINE(T9=32460 AND DATAPERIOD=1),COLOR00FFFF;
STICKLINE(TIME0=32460 AND CLOSE>=OPEN AND DATAPERIOD=1,OPEN,CLOSE,4,0),COLORFF00FF; {開盤第1分陽線,則顯粉紅K線}
STICKLINE(TIME0=32460 AND CLOSE<=OPEN AND DATAPERIOD=1,OPEN,CLOSE,4,0),COLORGREEN; {開盤第1分,則顯綠K線}
STICKLINE(TIME0=32460 AND DATAPERIOD=1,CLOSE,HIGH,1,0),COLOR00FFFF; {上影線}
STICKLINE(TIME0=32460 AND DATAPERIOD=1,LOW,CLOSE,1,0),COLOR00FFFF; {下影線}
DRAWTEXT(CLOSE>OPEN AND OPEN<LL1 AND T9=32460 AND DATAPERIOD=1,LOW-4,'多'),COLOR00FFFF;{1分如陽線,則顯字"多"}
DRAWTEXT(CLOSE<OPEN AND OPEN>HH1 AND T9=32460 AND DATAPERIOD=1,HIGH+3,'空'),COLOR00FFFF;{陰線,則顯字"空"}
DRAWTEXT(T9=32460 AND DATAPERIOD=1 AND C>=HH1,HH1,'高'),COLOR00FFFF;
DRAWTEXT(T9=32460 AND DATAPERIOD=1 AND C<=LL1,LL1,'低'),COLOR00FFFF;
DRAWTEXT(T9=32460 AND DATAPERIOD=1 AND BETWEEN(C,HH1,LL1),C*1.0001,'高'),COLOR00FFFF;
DRAWTEXT(T9=32460 AND DATAPERIOD=1,REF(C,1),'昨收 '),COLORFF00FF,ALIGN2;
DRAWTEXT(T9=32460 AND DATAPERIOD=1 AND C>=HH1,REF(C,1),'昨收'),COLORFF00FF;
DRAWSL(T9=32460 AND DATAPERIOD=1,REF(C,1),0,225,0),COLORFF00FF;
{
P1:=BARSLAST(T9=32460 AND DATAPERIOD=1);
高:REF(HH1,P1),LINETHICK0,COLOR0000FF;
低:REF(LL1,P1),LINETHICK0,COLOR40FF00;
開:REF(OPEN,P1),LINETHICK0,COLORFF8000;
昨收:REF(REF(C,1),P1),COLORFF00FF,LINETHICK0;}
{5}
HH5:=REF(HHV(HIGH,45),1);{求上周期內最高值}
LL5:=REF(LLV(LOW,45),1);{求上周期內最低值}
DRAWSL(T9=32700 AND DATAPERIOD=2,HH5,0,45,0),COLOR0000FF;{昨最高價顯紅水平線}
DRAWSL(T9=32700 AND DATAPERIOD=2,LL5,0,45,0),COLOR40FF00;{昨最低價顯綠水平線}
DRAWSL(T9=32700 AND DATAPERIOD=2,OPEN,0,45,0),COLORFF8000;{5分鐘開盤顯黃水平線}
DRAWSL(T9=32700 AND DATAPERIOD=2,REF(C,1),0,45,0),COLORFF00FF;{昨收盤價顯粉紅水平線}
DRAWTEXT(T9=32700 AND DATAPERIOD=2,HH5,' '),COLOR0000FF,ALIGN2;
DRAWTEXT(T9=32700 AND DATAPERIOD=2,LL5,' '),COLOR40FF00,ALIGN2;
DRAWTEXT(T9=32700 AND DATAPERIOD=2,OPEN,' '),COLORFF8000,ALIGN2;
VERTLINE(T9=32700 AND DATAPERIOD=2),COLOR00FFFF;
DRAWTEXT(T9=32700 AND DATAPERIOD=2,REF(C,1),' '),COLORFF00FF,ALIGN2;
{15}
HH15:=REF(HHV(HIGH,15),1);{求上周期內最高值}
LL15:=REF(LLV(LOW,15),1);{求上周期內最低值}
DRAWSL(T9=33300 AND DATAPERIOD=3,HH15,0,15,0),COLOR0000FF;{昨最高價顯紅水平線}
DRAWSL(T9=33300 AND DATAPERIOD=3,LL15,0,15,0),COLOR40FF00;{昨最低價顯綠水平線}
DRAWSL(T9=33300 AND DATAPERIOD=3,OPEN,0,15,0),COLORFF8000;{15分鐘開盤顯黃水平線}
DRAWSL(T9=33300 AND DATAPERIOD=3,REF(C,1),0,15,0),COLORFF00FF;{昨收盤價顯粉紅水平線}
DRAWTEXT(T9=33300 AND DATAPERIOD=3,HH15,' '),COLOR0000FF,ALIGN2;
DRAWTEXT(T9=33300 AND DATAPERIOD=3,LL15,' '),COLOR40FF00,ALIGN2;
DRAWTEXT(T9=33300 AND DATAPERIOD=3,OPEN,' '),COLORFF8000,ALIGN2;
VERTLINE(T9=33300 AND DATAPERIOD=3),COLOR00FFFF;
DRAWTEXT(T9=33300 AND DATAPERIOD=3,REF(C,1),' '),COLORFF00FF,ALIGN2;
{3}
HH3:=REF(HHV(HIGH,75),1);{求上周期內最高值}
LL3:=REF(LLV(LOW,75),1);{求上周期內最低值}
DRAWSL(T9=32580 AND DATAPERIOD=13,HH3,0,75,0),COLOR0000FF;{昨最高價顯紅水平線}
DRAWSL(T9=32580 AND DATAPERIOD=13,LL3,0,75,0),COLOR40FF00;{昨最低價顯綠水平線}
DRAWSL(T9=32580 AND DATAPERIOD=13,OPEN,0,75,0),COLORFF8000;{3分鐘開盤顯黃水平線}
DRAWSL(T9=32580 AND DATAPERIOD=13,REF(C,1),0,75,0),COLORFF00FF;{昨收盤價顯粉紅水平線}
DRAWTEXT(T9=32580 AND DATAPERIOD=13,HH3,' '),COLOR0000FF,ALIGN2;
DRAWTEXT(T9=32580 AND DATAPERIOD=13,LL3,' '),COLOR40FF00,ALIGN2;
DRAWTEXT(T9=32580 AND DATAPERIOD=13,OPEN,' '),COLORFF8000,ALIGN2;
VERTLINE(T9=32580 AND DATAPERIOD=13),COLOR00FFFF;
DRAWTEXT(T9=32580 AND DATAPERIOD=13,REF(C,1),' '),COLORFF00FF,ALIGN2;
P1:=BARSLAST(T9=32460 AND DATAPERIOD=1);
P5:=BARSLAST(T9=32700 AND DATAPERIOD=2);
P15:=BARSLAST(T9=33300 AND DATAPERIOD=3);
P3:=BARSLAST(T9=32580 AND DATAPERIOD=11);
昨高:IF(DATAPERIOD=1,REF(HH1,P1),IF(DATAPERIOD=2,REF(HH5,P5),IF(DATAPERIOD=3,REF(HH15,P15),IF(DATAPERIOD=11,REF(HH3,P3),0)))),LINETHICK0,COLOR0000FF;
昨低:IF(DATAPERIOD=1,REF(LL1,P1),IF(DATAPERIOD=2,REF(LL5,P5),IF(DATAPERIOD=3,REF(LL15,P15),IF(DATAPERIOD=11,REF(LL3,P3),0)))),LINETHICK0,COLOR40FF00;
開:IF(DATAPERIOD=1,REF(OPEN,P1),IF(DATAPERIOD=2,REF(OPEN,P5),IF(DATAPERIOD=3,REF(OPEN,P15),IF(DATAPERIOD=11,REF(OPEN,P3),0)))),LINETHICK0,COLORFF8000;
昨收:IF(DATAPERIOD=1,REF(REF(C,1),P1),IF(DATAPERIOD=2,REF(REF(C,1),P5),IF(DATAPERIOD=3,REF(REF(C,1),P15),IF(DATAPERIOD=11,REF(REF(C,1),P3),0)))),COLORFF00FF,LINETHICK0;
昨結:REF(REF(分時均線AP,1),P1),COLORFFFFFF,LINETHICK0;
?
?
參數位顯示零是不滿足條件的畫線位。
謝謝老師,三分鐘五分鐘十五分鐘還是不顯示昨結,一分鐘顯示,另外指標抬頭上面有很多0000,這個0000沒意義是否可以去掉
來源 程序化久久網