或者有什么办法模拟一下吗?
比如我想在代码里获取本月的资金盈亏,这个可以用代码实现吗?
nn:=barslast(month<>ref(month,1));
ss:(asset-ref(asset,nn+1)/ref(asset,nn+1);
variable:n=0;
if month<>ref(month,1) then n:=0;
if 平多条件 and holding>0 then begin
sell.......;
n:=n+numprofit(1);
end
if 平空条件 and holding<0 then begin
sellshort.....;
n:=n+numprofit(1);
end
上个月总体平仓盈亏:ref(n,barslast(month<>ref(month,1))+1);