以文本方式查看主题

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

--  作者:zhu2018
--  发布时间:2014/1/20 10:58:51
--  求助公式
60钟[价++]3+[60价-60]   60钟[价+价+]3-[60-60]  利50  3030010300 K线 
--  作者:jinzhe
--  发布时间:2014/1/20 11:04:34
--  

{价格大于前60分钟[最髙价+最低价+收盘价]除3+[前60分钟的最高价-前60分钟最低价]时开空单
 价格小于前60分钟[最高价+最低价+收盘价]除3-[前60分钟最高价-前60分钟最低价]时开多单
 多空单赢利50点平仓  要求时间在30至300分钟可调 点数在10至300点可调
}
input:n(60,30,300,1);
input:m(50,10,300,1);

if h>(ref(h+l+c,n)/3+ref(h-l,n)) then begin
 buyshort(holding=0,1,market);
end

if l<(ref(h+l+c,n)/3-ref(h-l,n)) then begin
 buy(holding=0,1,market);
end

if h-enterprice>m*mindiff and holding>0 then begin
 sell(1,0,market);
end

if enterprice-l>m*mindiff and holding<0 then begin
 sellshort(1,0,market);
end