灾后自救之六画圆弧2(通达信 源码 主图 贴图)
{圆弧主图2}
A:=CURRBARSCOUNT;
HA:=IF(BETWEEN(DATE,1150601,1150630),H,-999);
T:=HHVBARS(HA,0);
TT:=BARSLAST(L=LLV(L,T+1));
T1:=BARSLAST(A=CONST(TT)+1);
T2:=BARSLAST(A=CONST(T)+1);
GT:=CONST(T2)+1;
DT:=CONST(T1)+1;
AA:=DRAWLINE(A=GT,L,A=DT,L,0);
DRAWBAND(AA,RGB(69,139,0),AA,RGB(69,139,0));
HH:=CONST(REF(L,BARSLAST(A=DT+1)));
LL:=CONST(REF(L,BARSLAST(A=GT+1)));
JJ:=HH-LL;
TJ:=ABS(GT-DT);
PT:=TJ/2+MIN(GT,DT);
PJ:=(HH+LL)/2;
LJ:=HH*LL;
BT:=2*LJ/TJ;
BJ:=LJ/JJ;
TJA:=IF(A<PT,PT-A,A-PT)*BT;
TJB:=IF(TJA<LJ,SQRT(LJ*LJ-TJA*TJA),0)/BJ;
XH:IF(DT<GT,PJ+TJB,PJ-TJB),COLORMAGENTA;
SH:IF(DT<GT,PJ-TJB,PJ+TJB),COLORMAGENTA;
GT1:=CONST(T1)+1;
DT1:=CONST(BARSLAST(A=1)+1);
AA1:=DRAWLINE(A=GT1,L,A=DT1,L,0);
DRAWBAND(AA1,RGB(255,215,0),AA1,RGB(255,215,0));
HH1:=CONST(REF(L,BARSLAST(A=DT1+1)));
LL1:=CONST(REF(L,BARSLAST(A=GT1+1)));
JJ1:=HH1-LL1;
TJ1:=ABS(GT1-DT1);
PT1:=TJ1/2+MIN(GT1,DT1);
PJ1:=(HH1+LL1)/2;
LJ1:=HH1*LL1;
BT1:=2*LJ1/TJ1;
BJ1:=LJ1/JJ1;
TJA1:=IF(A<PT1,PT1-A,A-PT1)*BT1;
TJB1:=IF(TJA1<LJ1,SQRT(LJ1*LJ1-TJA1*TJA1),0)/BJ1;
XH1:IF(DT1<GT1,PJ1+TJB1,PJ1-TJB1),COLORYELLOW;
SH1:IF(DT1<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