以下内容为程序代码:
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,而且标记趋势的变量,也不是按照最后的交易趋势来赋值。
这个变量不是可以改的?
找到原因了,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