[PEL] 复制代码 TH:=THOLDCOUNT('');
max_str:='';//记录浮盈最大的品种代码
FY:=0;
temp:=0;
FOR I=1 TO TH do
BEGIN
HLABEL:= THOLDINDEXLABEL(I,'');
NEW_CLOSE:=DYNAINFO2(7,HLABEL);
DTFY:=(NEW_CLOSE-TAVGENTERPRICEEX2('' ,HLABEL , 0))*DYNAINFO2(209,HLABEL)*TBUYHOLDINGEX('',HLABEL,2);
KTFY:=(TAVGENTERPRICEEX2('' ,HLABEL , 1)-NEW_CLOSE)*DYNAINFO2(209,HLABEL)*TSELLHOLDINGEX('',HLABEL,2);
FY:=DTFY+KTFY;
MSGOUT(ISLASTBAR,HLABEL&'浮盈: '&numtostr(FY,2) & ' 多头浮盈: '&numtostr(DTFY,2)&' 空头浮盈: ' &numtostr(KTFY,2));
if FY>temp then
begin
max_str:=HLABEL;
temp:=FY;
end
end
MSGOUT(ISLASTBAR,max_str); |