以文本方式查看主题

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

--  作者:a290380438
--  发布时间:2012/10/22 13:59:56
--  编程求助!

 价在60线上平空开多价在60线下平多开空损20%


--  作者:jinzhe
--  发布时间:2012/10/22 14:04:01
--  

ma60:=ma(c,60);

if c>ma60 then begin

sellshort(holding<0,0,market);

buy(holding=0,1,market);

end

 

if c<ma60 then begin

sell(holding>0,0,market);

buyshort(holding=0,1,market);

end

 

if (c-enterprice)/enterprice>=20% and holding<0 then sellshort(holding<0,0,market);

 

if (enterprice-c)/c>=20% and holding>0 then sell(holding>0,0,market);

 

仅供参考,不负责盈亏

请您根据自己交易经验,进行修改后再实际应用


--  作者:a290380438
--  发布时间:2012/10/26 3:26:27
--  求助

:

 

60线

 

 

 

:

ma60:=ma(c,60);

if c>ma60 then begin

sellshort(holding<0,0,market);

buy(holding=0,1,market);

end

 

if c<ma60 then begin

sell(holding>0,0,market);

buyshort(holding=0,1,market);

end

 

if (c-enterprice)/enterprice>=20% and holding<0 then sellshort(holding<0,0,market);

 

if (enterprice-c)/c>=20% and holding>0 then sell(holding>0,0,market);

 


--  作者:RogarZ
--  发布时间:2012/10/26 8:41:19
--  

input:n(60,1,300,10);

 

ma60:=ma(c,N);

if c>ma60 then begin

sellshort(holding<0,0,market);

buy(holding=0,1,market);

end

 

if c<ma60 then begin

sell(holding>0,0,market);

buyshort(holding=0,1,market);

end

 

if (c-enterprice)/enterprice>=0.2 and holding<0 then sellshort(holding<0,0,market);

 

if (enterprice-c)/c>=0.2 and holding>0 then sell(holding>0,0,market);