以文本方式查看主题

-  金字塔客服中心 - 专业程序化交易软件提供商  (http://weistock.com/bbs/index.asp)
--  公式模型编写问题提交  (http://weistock.com/bbs/list.asp?boardid=4)
----  博弈大师代码改写  (http://weistock.com/bbs/dispbbs.asp?boardid=4&id=81537)

--  作者:waimm2020
--  发布时间:2015/7/22 16:58:36
--  博弈大师代码改写

在博弈大师里面有种算法:HAOPEN:(REF(HAOPEN,1)+REF(HACLOSE,1))/2;

在金字塔里面该如何改写,请老师帮忙解惑。


--  作者:jinzhe
--  发布时间:2015/7/22 17:03:00
--  

if barpos=1 then haopen:=1;

if barpos=2 then haopen:=2;

r1:=ref(haopen,1);

r2:=ref(haopen,2);

if barpos>2 then haopen:=(r1+r2)/2;