variable:n=0.3*asset/close/MULTIPLIER/0.15;//0.15=15%,是假设的保证金费率,需用户自行写入交易合约的保证金比率
if n<1 then n:=1;
if 下单条件 then begin
buy(holding=0,n,thisclose);
end
if holding>0 and 平仓条件 then begin
sell(1,0,thisclose);
if numprofit(1)>0 then begin
n:=n;
end
if numprofit(1<0) then begin
n:=n-m;
end
end