Rss & SiteMap

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

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

标题:后台多策略的全局变量

1楼
leonxu 发表于:2012/12/6 9:46:01

请问,后台交易多策略时,我是用一个策略不同参数来控制不同周期交易形成多策略,里面的全局变量,是只影响一个策略的,还是多策略之间会共用,因为我用全局变量来控制开平仓必须先交易完成后再顺序下单。程序如下

 

if Z>0 and tenterbars(1)>0 then begin

tsell(sellcond and tbuyholding(1)>0,tbuyholding(1),mkt);
if tholding2=0 then extgbdataset('orderdone',0);
tbuyshort (buyshortcond and extgbdata('orderdone')=0 and tholding2=0,1,mkt);
extgbdataset('orderdone',1);


tsellshort(sellshortcond and tsellholding(1)>0,tsellholding(1),mkt);
if tholding2=0 then extgbdataset('orderdone',0);
tbuy(buycond and extgbdata('orderdone')=0 and tholding2=0,1,mkt);
extgbdataset('orderdone',0);

 

即多个策略里的orderdone是联通共用的,还是只对自己策略的

2楼
jinzhe 发表于:2012/12/6 9:47:15
全局变量,只要软件内有用到ORDERDONE的都是这个
3楼
leonxu 发表于:2012/12/6 11:37:43

我是指比如这个程序,我做的策略是A(1,3),后面又做了一个策略A(1,5),这两个策略是一样的程序,只是参数不一样,那里面的orderdone是为各自策略服务,还是共通的,即A(1,3)产生的orderdone值对A(1,5)也产生作用

4楼
jinzhe 发表于:2012/12/6 13:09:49

这种全局变量是软件内通用的,

5楼
leonxu 发表于:2012/12/6 13:24:20
即A(1,3)产生的orderdone值对A(1,5)也产生作用?
6楼
jinzhe 发表于:2012/12/6 13:37:14

这种全局变量不分策略的,是共通的

7楼
leonxu 发表于:2012/12/6 13:54:53

好的,谢谢

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


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