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