以文本方式查看主题

-  金字塔客服中心 - 专业程序化交易软件提供商  (http://weistock.com/bbs/index.asp)
--  公式模型编写问题提交  (http://weistock.com/bbs/list.asp?boardid=4)
----  一根K线上同时有开仓和平仓情况  (http://weistock.com/bbs/dispbbs.asp?boardid=4&id=58379)

--  作者:fff
--  发布时间:2013/11/5 7:51:35
--  一根K线上同时有开仓和平仓情况

若一根K线上同时有开仓和平仓情况,系统通过吗?如何写?比如最低价Low<2500开多仓、最高价High>2510平多仓并转开空仓?

--  作者:fff
--  发布时间:2013/11/5 7:58:16
--  

注意,刚好此根K线同时满足以上两个条件。

--  作者:jinzhe
--  发布时间:2013/11/5 9:09:53
--  

if l<2500 then begin

   sellshort(holding<0,0,market);

   buy(holding=0,1,market);

end

 

if h>2510 then begin

   sell(holding>0,0,market);

   buyshort(holding=0,1,market);

end