Rss & SiteMap

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

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

标题:还请帮我编写一个策略,谢谢

1楼
ruiyan 发表于:2014/2/25 11:25:44

开仓条件:如果15天的移动平均线大于30天均线,并且30天均线大于45天平均线,即开仓

平仓条件:

1、如果价格上涨,涨幅达到开仓价格的7%时,平仓一半(在K线上标注“减仓”)

2、当涨幅达到10%时平仓另一半(在K线上标注“平仓”)

3、如果价格下跌,当价格跌到开仓价的7%时平仓

 

2楼
jinzhe 发表于:2014/2/25 11:30:09

ma15:ma(c,15);

ma30:ma(c,30);

ma45:ma(c,45);

 

input:n(2,1,100,1);

 

if ma15>ma30 and ma30>ma45 then buy(holding=0,n,market);

 

if (h-enterprice)/enterprice>=0.07 and (h-enterprice)/enterprice<0.10 then 减仓:sell(1,holding/2,market);

if (h-enterprice)/enterprice>=0.10 then 平仓:sell(1,holding/2,market);

if (enterprice-l)/enterprice<0.07 then sell(1,0,market);

3楼
ruiyan 发表于:2014/2/25 11:30:56
十分感谢,效率好高!
共3 条记录, 每页显示 10 条, 页签: [1]


Powered By Dvbbs Version 8.3.0
Processed in 0.03125 s, 3 queries.