你的意思是每上传或者下穿一次交易手数递增。是这样吗?按照我这样理解的话,样例代码实现如下:
a:=ma(c,10);
b:=ma(c,5);
jc:cross(c,a);//金叉买多
sc:cross(b,c);//死叉买空
ct:count(jc or sc,0);//统计金叉死叉次数来计算手数
ss:pow(2,ct-1);//手数
if jc then
begin
sellshort(holding<0,holding,market);
buy(holding=0,ss,market);
end
if sc then
begin
sell(holding>0,holding,market);
buyshort(holding=0,ss,market);
end