Rss & SiteMap

金字塔客服中心 - 专业程序化交易软件提供商 http://www.weistock.com/bbs/

专业程序化软件提供商
共6 条记录, 每页显示 10 条, 页签: [1]
[浏览完整版]

标题:系统开平仓问题

1楼
系统使用者 发表于:2017/2/16 1:49:01
要求将一个负责开多的系统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楼
系统使用者 发表于:2017/2/16 1:54:30
这样编写出现单独开多系统测试+单独的开空系统测试,加起来的收益。 与2个系统组合一起后的测试收益不一样。不知道为什么?

3楼
jinzhe 发表于:2017/2/16 9:08:54

分开那么多空互相不会干扰,结合起来那就不一样了,有多不开空,有空不开多,肯定不一样的

4楼
系统使用者 发表于:2017/2/16 10:47:11
这样编写没有问题吧。
5楼
系统使用者 发表于:2017/2/16 10:54:30
若有仓位或者无仓位,都可以开多或者开空。
上面的开空,开多这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 

6楼
jinzhe 发表于:2017/2/16 11:01:19

你想弄一起还和以前一样那是不行的

多空在一起是不能共存,要么是多要么是空,这是图表交易的特性

共6 条记录, 每页显示 10 条, 页签: [1]


Powered By Dvbbs Version 8.3.0
Processed in 0.01563 s, 3 queries.