等级: 专业版
- 注册:
- 2021-5-20
- 曾用名:
- a103165
|
楼主 |
发表于 2021-9-15 01:39
|
显示全部楼层
再请教,以下代码一样存在上述问题,应该如何改写?谢谢
HC:=THOLDCOUNT(ZH1);
盈笔1:=0; 亏笔1:=0; 盈利额1:=0; 亏损额1:=0;
FOR I=1 TO HC do
BEGIN
HLABEL:= THOLDINDEXLABEL(I,ZH1);
IF TBUYHOLDINGEX(ZH1,HLABEL,1)>0 THEN BEGIN
if TAVGENTERPRICEEX2(ZH1,HLABEL,0)< DYNAINFO2(7,HLABEL) then begin 盈笔1:=盈笔1+1; 盈利额1:=盈利额1+(DYNAINFO2(7,HLABEL)-TAVGENTERPRICEEX2(ZH1,HLABEL,0))*TBUYHOLDINGEX(ZH1,HLABEL,1)*DYNAINFO2(209,HLABEL); end
END
IF TSELLHOLDINGEX(ZH1,HLABEL,1)>0 THEN BEGIN
if TAVGENTERPRICEEX2(ZH1,HLABEL,1)> DYNAINFO2(7,HLABEL) then begin 盈笔1:=盈笔1+1; 盈利额1:=盈利额1+(TAVGENTERPRICEEX2(ZH1,HLABEL,1)-DYNAINFO2(7,HLABEL))*TSELLHOLDINGEX(ZH1,HLABEL,1)*DYNAINFO2(209,HLABEL); end
END
//**
IF TBUYHOLDINGEX(ZH1,HLABEL,1)>0 THEN BEGIN
if TAVGENTERPRICEEX2(ZH1,HLABEL,0)> DYNAINFO2(7,HLABEL) then begin 亏笔1:=亏笔1+1; 亏损额1:=亏损额1+(TAVGENTERPRICEEX2(ZH1,HLABEL,0)-DYNAINFO2(7,HLABEL))*TBUYHOLDINGEX(ZH1,HLABEL,1)*DYNAINFO2(209,HLABEL); end
END
IF TSELLHOLDINGEX(ZH1,HLABEL,1)>0 THEN BEGIN
if TAVGENTERPRICEEX2(ZH1,HLABEL,1)< DYNAINFO2(7,HLABEL) then begin 亏笔1:=亏笔1+1; 亏损额1:=亏损额1+(DYNAINFO2(7,HLABEL)-TAVGENTERPRICEEX2(ZH1,HLABEL,1))*TSELLHOLDINGEX(ZH1,HLABEL,1)*DYNAINFO2(209,HLABEL); end
END
END
|
|