以文本方式查看主题 - 金字塔客服中心 - 专业程序化交易软件提供商 (http://www.weistock.com/bbs/index.asp) -- 公式模型编写问题提交 (http://www.weistock.com/bbs/list.asp?boardid=4) ---- 老师,帮我写一下模型 (http://www.weistock.com/bbs/dispbbs.asp?boardid=4&id=54725) |
-- 作者:漫步金字塔 -- 发布时间:2013/8/6 11:19:32 -- 老师,帮我写一下模型 加载在5分钟图上,若今天高开40个点,开盘后第一根K线为阳线,第二跟K线突破第一根K线高点,做多。止损10个点,收盘止盈或是40个点止盈。做空刚好相反。谢谢老师,在线等! |
-- 作者:jinzhe -- 发布时间:2013/8/6 11:24:05 -- 收盘止盈指的是收市前N分钟止盈的意思吗? |
-- 作者:漫步金字塔 -- 发布时间:2013/8/6 11:43:07 -- 是的,老师。 |
-- 作者:jinzhe -- 发布时间:2013/8/6 13:13:44 -- zuoshou:=callstock(STKLABEL,vtclose,6,-1); o1:=VALUEWHEN(TODAYBAR=1,o); //多头 if o1-zuoshou>=40*mindiff and todaybar=2 and ref(c>o,1) and h>ref(h,1) then buy(holding=0,1,market);; if enterprice-c>10*mindiff then sell(holding>0,0,market); if time>=145700 then sell(holding>0,0,market); //空头 if zuoshou-o1>=40*mindiff and todaybar=2 and ref(c<o,1) and l<ref(l,1) then buyshort(holding=0,1,market); if c-enterprice>10*mindiff then sellshort(holding<0,0,market); if time>=145700 then sellshort(holding<0,0,market); |