RENKO 砖形图 通达信源码
https://p26.toutiaoimg.com/large/pgc-image/335e38025650478da1f1c30de5161bae通达信指标:
BOXV:=ATR.ATR(14);
RA:=TDXDLL1(1,O,C,BOXV);
RB:TDXDLL1(2,O,C,BOXV);
R1:IF(RARB,RA,DRAWNULL),COLORBLUE,LINETHICK3;
DLL 源码:
procedure TestPlugin1(DataLen: Integer; pfOUT: ArraySingle; pfINa: ArraySingle;
pfINb: ArraySingle; pfINc: ArraySingle); cdecl;
var
i, n: Integer;
prev, refprev, boxv: double;
up, dn: boolean;
begin
up := false;
dn := false;
prev := pfINa;
i := 0;
repeat
boxv := pfINc;
refprev := prev;
if (not dn) and (pfINb > prev) then
begin
up := true;
n := trunc((pfINb - prev) / boxv);
prev := prev + boxv * n;
end;
if dn and (pfINb > prev) then
begin
n := trunc((pfINb - prev) / boxv);
if n > 1 then
begin
up := true;
dn := false;
prev := prev + boxv * n;
end
else
prev := prev;
end;
if (not up) and (pfINb < prev) then
begin
dn := true;
n := trunc((prev - pfINb) / boxv);
prev := prev - boxv * n;
end;
if up and (pfINb < prev) then
begin
n := trunc((prev - pfINb) / boxv);
if n > 1 then
begin
dn := true;
up := false;
prev := prev - boxv * n;
end
else
prev := prev;
end;
if prev < refprev then
pfOUT := prev + pfINc
else if prev > refprev then
pfOUT := prev - pfINc
else
pfOUT := pfOUT;
i := i + 1;
until i = DataLen;
end;
https://p6.toutiaoimg.com/large/pgc-image/3c15fbad3bc84430aad4e850cde51529
https://p6.toutiaoimg.com/large/pgc-image/ba856d30e97745268f0ba19651c64aae
页:
[1]