要求将一个负责开多的系统1,与另外一个负责做空的系统2组合一起,
要求系统的开多平多单子,不影响系统2的开空平空单子。2个系统互相不影响,独立执行各自的开平。
也就是说,开多的单子还没有平多出现,但系统2的开空单了,一样可以开空单,不影响以有的多单。
variable:bj=0;
if aspect=0 and holding<=0 and bj=0 then begin
bj:=1;
buy(1,SS,marketr);
end
if Saspect=1 and holding>=0 and bj=0 then begin
bj:=2;
buyshort(1,SS,marketr);
end
if aspect=1 and holding>0 and bj=1 then begin
sell(1,SS,marketr);
bj:=0;
end
if Saspect=0 and holding<0 and bj=2 then begin
sellshort(1,SS,marketr);
bj:=0;
end
[此贴子已经被作者于2017-2-16 1:50:16编辑过]
这样编写出现单独开多系统测试+单独的开空系统测试,加起来的收益。 与2个系统组合一起后的测试收益不一样。不知道为什么?
分开那么多空互相不会干扰,结合起来那就不一样了,有多不开空,有空不开多,肯定不一样的
若有仓位或者无仓位,都可以开多或者开空。
上面的开空,开多这holding要改一下?如何改?
if aspect=0 and holding<=0 and bj=0 then begin
bj:=1;
buy(1,SS,marketr);
end
if Saspect=1 and holding>=0 and bj=0 then begin
bj:=2;
buyshort(1,SS,marketr);
end
你想弄一起还和以前一样那是不行的
多空在一起是不能共存,要么是多要么是空,这是图表交易的特性