后台交易吗?
在代码里面加上
oo:topenprofit;
nn:tnumprofit(1);
然后用stkindi引用OO和NN
后台里面的topenprofit和tnumprofit都是指当前预警的数值,账户的数值你要用账户函数去获取
你开3个预警这3个预警的topenprofit和tnumprofit是独立的
if time=closetime(0) then extgbdataset('ss',TACCOUNT(30));
if time<>closetime(0) then extgbdataset('ss',TACCOUNT(30));
tt:extgbdata('ss');
tt的值就是当天整体账户的平仓盈亏
GLOBALVARIABLE:tt=0,nn=0;
if 平多条件 and 持仓判断 then begin
tsell(1,0,mkt);
if time<>tt then begin
tt:=time;
nn:=nn+tnumprofit(1);
end
end
if 平空条件 and 持仓判断 then begin
tsellshort(1,0,mkt);
if time<>tt then begin
tt:=time;
nn:=nn+tnumprofit(1);
end
end
if time=timeclose(0) then begin
tt:=0;
nn:=0;
end
nn就是一天的累加值