以文本方式查看主题

-  金字塔客服中心 - 专业程序化交易软件提供商  (http://weistock.com/bbs/index.asp)
--  公式模型编写问题提交  (http://weistock.com/bbs/list.asp?boardid=4)
----  [原创]请帮忙写一个交易模型  (http://weistock.com/bbs/dispbbs.asp?boardid=4&id=57260)

--  作者:ailefeile
--  发布时间:2013/10/8 10:21:31
--  [原创]请帮忙写一个交易模型
请老师帮我写一个交易模型:
 1:周期5分钟
 2:最大回撤8%
 3:交易思路:37日均线和241日均线金叉做多,
                    37日均线和241日均线死叉做空

--  作者:jinzhe
--  发布时间:2013/10/8 10:27:03
--  

最大回撤8%指的是回撤8%了然后怎么操作?

 


--  作者:ailefeile
--  发布时间:2013/10/8 10:34:00
--  
然后是止损
--  作者:jinzhe
--  发布时间:2013/10/8 10:46:44
--  
处理中,请稍等
--  作者:90也玩期货
--  发布时间:2013/10/8 11:45:24
--  
ma1:=ma(c,37);
ma2:=ma(c,241);
cond1:cross(ma1,ma2);
cond2:cross(ma2,ma1);
buy(cond1,1,MARKET);
BUYSHORT(cond2,1,MARKET);
bo:(hhv(c,ENTERBARS)-c)/enterprice;
if bo>0.8 and holding>0 then sell(1,holding,MARKET);


--  作者:jinzhe
--  发布时间:2013/10/8 13:19:08
--  

楼上思路正确,但是要加上以下内容:

1.cond1:cross(ma1,ma2) and holding=0;

cond2:cross(ma2,ma1) and holding=0

2.

一个空头止损

po:=(enterprice-(llv(l,enterbars+1)))/enterprice;

if bo>0.8 and holding>0 then sell(1,holding,MARKET);