以下是通达信自然日和交易日对称天数玄机公式
通达信自然日和交易日对称天数玄机公式
N:=1131204;
TJ0:=DATE=N;
TJ0T:=BARSLAST(TJ0);
SJ:=MOD(TJ0T,4);
SJT:=BARSLAST(SJ);
TJ0A:=IF(SJT=1,DATE,0);
TJ01:=DATETODAY(N);
TJ02:=DATETODAY(TJ0A)-TJ01;
A1:=BARSCOUNT(C);
A2:=CONST(REF(N,A1));
A3:=DATETODAY(A2);
A4:=DATETODAY(DATE);
TJT:=BARSLAST(DATE=N);
A2T:=BACKSET(DATE=N,BARSCOUNT(C));
ZL:=A3-A4;
ZT:=A2T*BARSCOUNT(C)-1;
ZTT:=CONST(REF(A1,TJT))-A1-CONST(ZT)-1;
TJA:=MOD(ZTT,4);
TJAT:=BARSLAST(TJA);
DRAWNUMBER(SJT=1,L,TJ02)COLORYELLOW;
DRAWNUMBER(SJT=1,H*1.02,TJ0T);
DRAWNUMBER(ZTT>0 AND TJAT=1,H*1.02,ZTT);
DRAWNUMBER(ZTT>0 AND TJAT=1,L,ZL)COLORYELLOW;