你好,我想对日内交易模型做一个限定条件:第一笔交易盈利,允许开第二笔,即账户有盈利允许继续开仓,当某笔交易令账户亏损后当天不再开仓(单子离场后亏损,不算盘中的亏损)。一天最多进行5笔交易。请问如何实现
variable:n=0;
if 开仓条件 and holding=0 and n<5 then begin
buy......;
end
if 平仓语句 and holding>0 then
sell......;
if numprofit(1)>0 then
n:=n+1;
if numprofit(1)<=0 then
n:=5;
end
if time=closetime(0) then n:=0;
variable:n=0;
a1:=ref(asset,todaybar);
if 开仓条件 and holding=0 and n<5 then begin
buy......;
end
if 平仓语句 and holding>0 then
sell......;
if asset>a1 then
n:=n+1;
if asset<=a1 then
n:=5;
end