等级: 免费版
- 注册:
- 2021-9-28
- 曾用名:
|

楼主 |
发表于 2022-2-23 14:27
|
显示全部楼层
kd: gap1>ref(gap2,1) and c>ref(c,len2) ;
kk: gap1>ref(gap2,1) and c<ref(c,len2) ;
pd:holding>0 and (exit_long or kk);
pk:holding<0 and (exit_short or kd);
if holding <> 0 and (exit_nextday=0,1,date > entry_date) then
begin
sell(pd,HOLDING,market);
sellshort(pk,abs(holding),market);
entry_date:= 0;
//mp_status:= 0;
end;
if kd and direction>=0 or kk and direction<=0 then
begin
if fund <= 100 then //only 1 part or lots% case, don't need to be divided into NDAY_hold part
lots:= intpart(fund);
else // fund > 100 => calc the amount of stock
lots:= max(1,intpart(fund / (open*MULTIPLIER*fund_double) ) );
if fund < 5 or fund > 100 then
begin
buy(kd,lots,market);
buyshort(kk,lots,market);
end;
else
begin
buy(kd,lots%,market);
buyshort(kk,lots%,market);
end;
//mp_status:= holding;
entry_date:= date;
end;
|
|