以文本方式查看主题

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

--  作者:金诚
--  发布时间:2013/9/4 22:33:35
--  [求助]布林带的改编

MID :  MA(CLOSE,26);
UPPER: MID + 2*STD(CLOSE,26);
LOWER: MID - 2*STD(CLOSE,26);

以上是金字塔自带的布林带公式  想把它改成 突破UPPER就开多  突破LOWER就开空 怎么编写,麻烦会的人帮个忙!谢谢!平仓就是回调到MID这条线   谢谢!


--  作者:jinzhe
--  发布时间:2013/9/5 9:07:52
--  

MID :  MA(CLOSE,26);
UPPER: MID + 2*STD(CLOSE,26);
LOWER: MID - 2*STD(CLOSE,26);

 

 

if cross(c,upper) then buy(holding=0,1,market);

 

if cross(lower,c) then buyshort(holding=0,1,market);

 

if ref(c>mid,1) and c<mid then sell(1,0,market);

 

if ref(c<mid,1)  and c>mid then sellshort(1,0,market);