Rss & SiteMap

金字塔客服中心 - 专业程序化交易软件提供商 http://www.weistock.com/bbs/

专业程序化软件提供商
共3 条记录, 每页显示 10 条, 页签: [1]
[浏览完整版]

标题:价格穿越均线模型求助

1楼
linghbin 发表于:2011/9/28 20:04:08

收盘价大于20天均线且收盘价大于开盘价,买开

收盘价小于20天均线,卖平

收盘价小于20天均线且收盘价小于开盘价,卖开

收盘价大于20天均线,买平

 

亏损大于50点,止损

 

 

 

请教达人,这个怎么编写?

2楼
jinzhe 发表于:2011/9/29 10:19:12

c1:c;
ma20:ma(c,20);


//收盘价大于20天均线且收盘价大于开盘价,买开
if cross(c,ma20) and c>o then begin
 sellshort(holding<0,0,thisclose);
 buy(holding=0,1,thisclose);
end

 

//收盘价小于20天均线,卖平
if cross(ma20,c) then sell(holding>0,0,thisclose);

 

//收盘价小于20天均线且收盘价小于开盘价,卖开
if cross(ma20,c) and c<o then begin
 sell(holding>0,0,thisclose);
 buyshort(holding=0,1,thisclose);
end

 

//收盘价大于20天均线,买平
if cross(c,ma20) then sellshort(holding<0,0,thisclose);


//亏损大于50点,止损
if c>enterprice+50*mindiff or c<enterprice-50*mindiff then begin
 sell(holding>0,0,thisclose);
 sellshort(holding<0,0,thisclose);
end
 

3楼
linghbin 发表于:2011/10/4 9:40:54

谢谢LS的兄弟

共3 条记录, 每页显示 10 条, 页签: [1]


Powered By Dvbbs Version 8.3.0
Processed in 0.07813 s, 2 queries.