以文本方式查看主题 - 金字塔客服中心 - 专业程序化交易软件提供商 (http://www.weistock.com/bbs/index.asp) -- 金字塔软件问题提交 (http://www.weistock.com/bbs/list.asp?boardid=2) ---- ext全局变量的疑惑!觉得很大的bug (http://www.weistock.com/bbs/dispbbs.asp?boardid=2&id=96041) |
-- 作者:liveup -- 发布时间:2016/4/10 16:09:23 -- ext全局变量的疑惑!觉得很大的bug 以下内容为程序代码: 1 ma1:ma(close,10); 2 bt:=ref(ma1,1)>ref(ma1,2); 3 dt:=ref(ma1,1)<ref(ma1,2); 4 if bt and holding=0 then BEGIN 5 buy(1,1,limitr,open); 6 EXTGBDATAset(\'tt\',date); 7 EXTGBSTRINGSET(\'趋势\',\'向上\'); 8 end 9 10 if dt and holding>0 then begin 11 EXTGBDATASET(\'tt\',date); 12 EXTGBSTRINGSET(\'趋势\',\'向下\'); 13 sell(1,1,limitr,open); 14 15 end 上面是一个测试ext全局变量的策略。我的理解应该是ext变量会在触发交易的时候重新赋值,但结果发现不是。tt是最新的date,而且标记趋势的变量,也不是按照最后的交易趋势来赋值。 这个变量不是可以改的?
|
-- 作者:liveup -- 发布时间:2016/4/10 16:32:57 -- 找到原因了,http://www.weistock.com/bbs/dispbbs.asp?BoardID=4&ID=88101&skin=0 我主要是想实现这个思路:http://www.weistock.com/bbs/dispbbs.asp?boardid=4&id=96042&page=1&star=1
|