Rss & SiteMap

金字塔客服中心 - 专业程序化交易软件提供商 http://www.weistock.com/bbs/

专业程序化软件提供商
共2 条记录, 每页显示 10 条, 页签: [1]
[浏览完整版]

标题:在一个周期内如果开平仓

1楼
木瓜 发表于:2015/11/19 23:24:38
在一根K线上,限制开仓就不平仓,平仓就不开仓。应该怎么写?用的是LIMITR
[此贴子已经被作者于2015/11/19 23:26:20编辑过]
2楼
jinzhe 发表于:2015/11/20 8:57:04

大体上是这样的:开多条件加上exitbars>0,开空条件加上enterbars>0,但是要做特殊处理,避免没有任何的开仓

variable:n=0;

if n=0 and holding=0 and 开多条件 then begin

    buy.........;

    n:=1;

end

 

if n=0 and holding=0 and 开空条件 then begin

    buyshort.........;

    n:=1;

end

 

if n>0 and 开多条件 and exitbars>0 then buy........;

if N>0 and 开空条件 and exitbars>0 then buyshort.......;

 

if 平多条件 and enterbars>0 then sell.....;

if 平空条件 and enterbars>0 then sellshort........;

共2 条记录, 每页显示 10 条, 页签: [1]


Powered By Dvbbs Version 8.3.0
Processed in 0.03125 s, 3 queries.