原碼:
Mode:=1; {採用:0.歷史首根,1.交易日首根}
MN:=0;
if datatype=1 then MN:=45; //1分
if datatype=2 then MN:=9; //5分
if MN=0 then exit; {其他週期跳離}
if mode=0 then MSt:=MOD(barpos-1,MN)=0;
if mode=1 then MSt:=MOD(barslast(tradedate<>ref(tradedate,1)),MN)=0;
Med:=refx(MSt,1) or barpos=datacount;
Msp:=BARSLAST(MSt)+1;
MH:HHV(H,Msp) LINETHICK0 colormagenta;
MH:=SETVAL(Med,MH,-BARSLAST(MSt),MH);
ML:LLV(L,Msp) LINETHICK0 colormagenta;
ML:=SETVAL(Med,ML,-BARSLAST(MSt),ML);
MF:=(MH+ML)/2 LINETHICK0;
PKM:=Msp>1;
PARTLINE(PKM,MH) colorred,LINETHICK2;
PARTLINE(PKM,ML) colorcyan,LINETHICK2;
PARTLINE(PKM,MF) coloryellow,LINETHICK2;