以文本方式查看主题

-  金字塔客服中心 - 专业程序化交易软件提供商  (http://weistock.com/bbs/index.asp)
--  公式模型编写问题提交  (http://weistock.com/bbs/list.asp?boardid=4)
----  [求助]加仓单引用日线数据问题  (http://weistock.com/bbs/dispbbs.asp?boardid=4&id=147782)

--  作者:宁静致远1
--  发布时间:2017/2/15 12:59:47
--  [求助]加仓单引用日线数据问题
老师,请问您一下,下面这个代码用在加仓单上,想要实现5分钟收盘价大于昨天日线收盘价才加多仓,5分钟收盘价小于昨天日线收盘价才加空仓,螺纹钢夜盘引用日线数据却是无效的,不知道是什么原因?麻烦老师帮我看一下
cc:=callstock(stklabel,vtclose,2);
cd:=callstock(stklabel,vtclose,6,-1);
大于:=cc>cd;
小于:=cc<cd;
if   macd>0 and macd>ref(macd,1)    then buy(holding=0,ss,marketr);
if   cc>cd   and macd>0    and holding=ss and openprofit>0 and enterbars>=3  then buy(holding=ss,m,marketr);
if   macd<0  and holding>0 then sell(1,0,marketr);
if   macd<0 and macd<ref(macd,1)   then buyshort(holding=0,ss,marketr);
if   cc<cd   and macd<0      and holding=-ss and openprofit>0 and enterbars>=3  then buyshort(holding=-ss,m,marketr);
if   macd>0   and holding<0  then sellshort(1,0,marketr);

--  作者:宁静致远1
--  发布时间:2017/2/15 13:27:38
--  
因为用金字塔时间不习惯,我使用的是北京时间,跟这个有没有关系
--  作者:jinzhe
--  发布时间:2017/2/15 13:39:13
--  

"螺纹钢夜盘引用日线数据却是无效的"

麻烦解释一下这句话的具体含义


--  作者:宁静致远1
--  发布时间:2017/2/15 14:09:32
--  
改用金字塔时间后可以了,谢谢老师