以文本方式查看主题 - 金字塔客服中心 - 专业程序化交易软件提供商 (http://weistock.com/bbs/index.asp) -- 公式模型编写问题提交 (http://weistock.com/bbs/list.asp?boardid=4) ---- 求助:开盘价买入,收盘价卖出 (http://weistock.com/bbs/dispbbs.asp?boardid=4&id=13478) |
-- 作者:phui999 -- 发布时间:2012/8/5 10:43:18 -- 求助:开盘价买入,收盘价卖出 开多条件,如果昨天是阴线(C<O),就以开盘价买入,收盘价平仓; 开空条件,如果昨天是阳线(C>O),就以开盘价卖出,收盘价平仓;
|
-- 作者:RogarZ -- 发布时间:2012/8/6 9:08:27 -- if ref(c<o,1) then buy(1,1,o); if ref(c>o,1) then buyshort(1,1,o); if time>145500 then begin sell(1,1,mkt); sellshort(1,1,mkt); end
|
-- 作者:phui999 -- 发布时间:2012/8/6 10:17:09 -- 不行啊,测试通过,但是没有成交。 |
-- 作者:jinzhe -- 发布时间:2012/8/6 10:35:30 -- if ref(c<o,1) then buy(1,1,o);
if ref(c>o,1) then buyshort(1,1,o);
改成
if ref(c<o,1) then buy(1,1,limitr,o);
if ref(c>o,1) then buyshort(1,1,limitr,o); |
-- 作者:董小球 -- 发布时间:2012/8/6 10:36:45 -- if ref(c<o,1) then begin buy(1,1,limit,o); sell(1,1,limit,close); end if ref(c>o,1) then begin buyshort(1,1,limit,o); sellshort(1,1,limit,close); end
|