H1:=REF(HIGH,1);
L1:=REF(LOW,1);
D1:=HIGH>H1 AND LOW>=L1
AND CLOSE>REF(CLOSE,1);
D11:=HIGH>H1 AND LOW>=L1
AND CLOSE<=REF(CLOSE,1);
D2:=LOW<L1 AND HIGH<H1;
D3:=HIGH>H1 AND LOW<L1
AND CLOSE>REF(CLOSE,1);
D31:=HIGH>H1 AND LOW<L1
AND CLOSE<=REF(CLOSE,1);
D4:=HIGH<=H1 AND LOW>=L1;
FR1:SUM(IF(D1,HIGH,IF(D11,LOW,IF(D2,-HIGH,IF(D3,
HIGH,IF(D31,-HIGH,IF(D4,0,0)))))),0)/100,LINETHICK3,COLORGREEN;