A是买开卖平条件
B是卖开卖平条件
请专家们看看下面的下单控制(抄别的公式)是不是对的,是不是单反了或有什么明显错误。最好翻译一下
longcond:=A;
shortcond:=B
if holding=0 then begin
if longcond then
buy(1,1,limitr,open);
end
if holding=0 then begin
if shortcond then
buyshort(1,1,limitr,open);
end
if holding>0 then begin
if shortcond then begin
sell(1,holding,limitr,open);
buyshort(1,1,limitr,open);
end
if time=150000 then
sell(1,holding,limitr,open);
end
if holding<0 then begin
if longcond then begin
sellshort(1,holding,limitr,open);
buy(1,1,limitr,open);
end
if time=150000 then
sellshort(1,holding,limitr,open);
end
收益:asset,noaxis,colorred;
次数:totaltrade,linethick0;
胜率:percentwin,linethick0;
连亏:maxseqloss,linethick0;
连赢:maxseqwin,linethick0;
请专家能解释一下上面的语句
longcond:=A;//做多条件
shortcond:=B;//做空条件
if holding=0 then begin
if longcond then
buy(1,1,limitr,open);
end//当无持仓时满足多头条件开多
if holding=0 then begin
if shortcond then
buyshort(1,1,limitr,open);
end//当无持仓时满足空头条件开空
if holding>0 then begin
if shortcond then begin
sell(1,holding,limitr,open);
buyshort(1,1,limitr,open);
end //当有多仓时满足空头条件平多开空
if time=150000 then
sell(1,holding,limitr,open);
end//收盘时平掉多仓,这里改为time>=145500比较好
if holding<0 then begin
if longcond then begin
sellshort(1,holding,limitr,open);
buy(1,1,limitr,open);
end//当有空仓时满足多头条件平空开多
if time=150000 then
sellshort(1,holding,limitr,open);
end//收盘前平仓,同样修改下时间比较好
收益:asset,noaxis,colorred;
次数:totaltrade,linethick0;
胜率:percentwin,linethick0;
连亏:maxseqloss,linethick0;
连赢:maxseqwin,linethick0;
// 各种参数
谢谢老师