以文本方式查看主题

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

--  作者:h2004h
--  发布时间:2013/7/26 20:08:11
--  20均线模型请教
我想用沪深300指数的20日均线来操作,20日线上开多,线下开空,不知如何编写?
--  作者:jinzhe
--  发布时间:2013/7/29 9:06:23
--  

ma20:=stkindi(\'sh000300\',\'ma.ma3\',0,datatype);

if cross(c,ma20)  then begin

sellshort(holding<0,0,market);

buy(holding=0,1,market);

end

 

if cross(ma20,c) then begin

sell(holding>0,0,market);

buyshort(holding=0,1,market);

end