If BarPos = 1 Then
Begin
//SETPYTHONVAL('day_ahead',0,dayahead); python 文件类型 控制参数 在python端程序传不过去
hold_v[NDAY]:= 0;
hold_d[NDAY]:= 0;
//MSGOUT(1,NUMTOSTR(NDAY,0) );
//MSGOUT(1,numtostr(topN,0) );
End;
//VARIABLE day_cn:= 0;
if date <> ref(date,1)THEN
begin
a:=date+19000000;
SETPYTHONVAL('date',0,a);
FIREPYHANDLEBAR; //触发Python中的Handle_bar方法
i:= 1;
condition_in:= 0;
while i<=topN and condition_in = 0 DO
BEGIN
strv:= 's'+numtostr(i,0);
top_stock: getpythonval(strv),linethick0;
if stklabel = top_stock THEN
begin
condition_in:= 1;
end;
i:= i + 1;
//MSGOUT(date+19000000>=20210910,top_stock);
//temp: numtostr(hold_v[0],2);
//MSGOUT(date+19000000>=20210910,temp);
END;
//temp: numtostr(hold_v[0],2);
//MSGOUT(date+19000000>=20210910,temp);
j:= 1;
WHILE hold_v[j] > 0 and j <= NDAY DO // adding one new day for all the remaining
BEGIN
hold_d[j]: hold_d[j] + 1; // shift one day for remaining hold_v stock
j:= j + 1;
//i:= hold_v[j];
//MSGOUT(date+19000000>=20210910,numtostr(i,0));
END;
if j < NDAY THEN // less than NDAY and set zero after the end part
BEGIN
hold_v[j]:= 0;
hold_d[j]:= 0;
END;
end;
hold_d[1]: 1313;
temp_v:hold_d[1];
temp_str:= NUMTOSTR((temp_v,0));
//MSGOUT(date<>ref(date,1),temp_str);