以文本方式查看主题

-  金字塔客服中心 - 专业程序化交易软件提供商  (http://weistock.com/bbs/index.asp)
--  公式模型编写问题提交  (http://weistock.com/bbs/list.asp?boardid=4)
----  收盘价跌破20日均线后,遇到连续2根阳线买入开仓,怎么写?  (http://weistock.com/bbs/dispbbs.asp?boardid=4&id=167173)

--  作者:pyd
--  发布时间:2018/12/18 11:25:53
--  收盘价跌破20日均线后,遇到连续2根阳线买入开仓,怎么写?
请教,收盘价跌破20日均线后,遇到连续2根阳线买入开仓,怎么写?

--  作者:pyd
--  发布时间:2018/12/18 11:28:32
--  
ma20:ma(c,20);
xc:=cross(ma20,c);//收盘价跌破20日均线
kd:=ref(xc,2) and all(o<c,2);//遇到连续2根阳线,收盘价跌破20日均线
buy(kd and holding=0,1,marketr);

--  作者:305588088
--  发布时间:2018/12/18 12:56:06
--  
谢谢老师