以文本方式查看主题

-  金字塔客服中心 - 专业程序化交易软件提供商  (http://weistock.com/bbs/index.asp)
--  公式模型编写问题提交  (http://weistock.com/bbs/list.asp?boardid=4)
----  以上证指数20日均线为准,突破就平空做多,跌破就平多做空  (http://weistock.com/bbs/dispbbs.asp?boardid=4&id=51382)

--  作者:just1
--  发布时间:2013/4/24 16:54:25
--  以上证指数20日均线为准,突破就平空做多,跌破就平多做空
以上证指数20日均线为准,突破就平空做多,跌破就平多做空,怎么设置自动交易呢请教下

--  作者:jinzhe
--  发布时间:2013/4/24 17:02:24
--  

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

if  cross(c,ma20) then begin

sellshort(holding<0,0,thisclose);

buy(holding=0,1,thisclose);

end

 

if cross(ma20,c) then begin

sell(holding>0,0,thisclose);

buyshort(holding=0,1,thisclose);

end