1.图表里面百分比直接写进开仓语句即可,比如buy(1,10%,market);
2.需要用变量记录开仓日期,然后在对平仓日期做限定。
比如:
variable:dd=0;
if 开多条件 and 持仓判断 then begin
buy.....;
dd:=date;
end
if 平多条件 and 持仓判断 and date>dd then begin
sell.......;
end
if 开空条件 and 持仓判断 then begin
buyshort.....;
dd:=date;
end
if 平空条件 and 持仓判断 and date>dd then begin
sellshort.......;
end