以文本方式查看主题 - 金字塔客服中心 - 专业程序化交易软件提供商 (http://weistock.com/bbs/index.asp) -- 公式模型编写问题提交 (http://weistock.com/bbs/list.asp?boardid=4) ---- 老师帮忙编写策略 (http://weistock.com/bbs/dispbbs.asp?boardid=4&id=162977) |
-- 作者:huo88 -- 发布时间:2018/4/24 10:53:38 -- 老师帮忙编写策略 收盘价大于前收盘价,买入 |
-- 作者:FireScript -- 发布时间:2018/4/24 10:54:31 -- if c>ref(c,1) then buy(holding=0,1,market); 一句代码就行了。 |
-- 作者:huo88 -- 发布时间:2018/4/24 11:20:35 -- 如果一根比一根收盘大, 只开三次,每次一手。等到收盘小于前一根时,全部平仓,并且开空一手,最多也是连续开三次。反复如此。谢谢好老师再帮下 |
-- 作者:FireScript -- 发布时间:2018/4/24 13:21:49 -- if ref(c,1)<c then begin sellshort(holding<0,holding,market); buy(holding<3 and holding>=0,1,market); end if c<ref(c,1) then begin sell(holding>0,holding,market); buyshort(holding<=0 and abs(holding)<3,1,market); end 持仓:holding; |
-- 作者:huo88 -- 发布时间:2018/4/24 14:26:36 -- 不行,导入会乱套的,老师你给看看 |
-- 作者:huo88 -- 发布时间:2018/4/24 14:30:26 -- 可以了 |