以文本方式查看主题

-  金字塔客服中心 - 专业程序化交易软件提供商  (http://weistock.com/bbs/index.asp)
--  公式模型编写问题提交  (http://weistock.com/bbs/list.asp?boardid=4)
----  跨周期调用均线指标问题  (http://weistock.com/bbs/dispbbs.asp?boardid=4&id=154316)

--  作者:skylands
--  发布时间:2017/5/28 15:44:05
--  跨周期调用均线指标问题
30分钟周期上跨周期调用日K图上的均线指标怎么写都不起作用,请帮我检查下例中的问题:
ma20:=ma(c,20);
ma60:=ma(c,60);
ma120:=ma(c,120);
20日均:=STKINDI(\'\',\'ma20\',0,6,-1);
60日均:=STKINDI(\'\',\'ma60\',0,6,-1);
120日均:=STKINDI(\'\',\'ma120\',0,6,-1);
日多排:=20日均>60日均 and 60日均>120日均;
日空排:=20日均<60日均 and 60日均<120日均;

//交易系统
sellshort(翻多信号 and holding<0,holding,thisclose);
buy(翻多信号 and not(日空排) and holding=0,SS,thisclose);
sell(翻空信号 and holding>0,holding,thisclose);   
buyshort(翻空信号 and not(日多排) and holding=0,SS,thisclose);
如此写,无法筛掉相应的排除信号。

//交易系统
buy(翻多信号 and 20日均>60日均,SS,thisclose);
buyshort(翻空信号 and 20日均<60日均,SS,thisclose);
即使简单这样写,也不行!

请指教问题出在哪里?

--  作者:wenarm
--  发布时间:2017/5/31 8:58:02
--  
20日均:=STKINDI(\'\',\'ma20\',0,6,-1);//看下函数说明。你要指明,ma20日的日线所在公式名称(不能自己引用自己)。
20日均:=STKINDI(\'\',\'引用的公式名称.ma20\',0,6,-1);//
 
 
60日均:=STKINDI(\'\',\'ma60\',0,6,-1);
120日均:=STKINDI(\'\',\'ma120\',0,6,-1);