Rss & SiteMap

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

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

标题:如果平仓后,在多少根K线内不在开仓,应该如何编写

1楼
冷锋566 发表于:2015/8/15 12:58:21
如果平仓后,在几根K线内不在开仓,应该如何编写?比如在5根、或10根K线内不在开仓,谢谢!
2楼
jinzhe 发表于:2015/8/17 9:01:39
exitbars>5    exitbars>10
3楼
冷锋566 发表于:2015/8/17 12:03:35
比如下面这样写对吗?但是都没信号了
ma3:ma(c,13);
ma5:ma(c,21);
pkkd:cross(ma3,ma5);
pdkk:cross(ma5,ma3);
sellshort(pkkd and holding<0,0,limitr,close);
buy(pkkd and exitbars>5 and holding=0,1,limitr,close);
sell(pdkk and holding>0,0,limitr,close);
buyshort(pdkk and exitbars>5 and holding=0,1,limitr,close);
4楼
jinzhe 发表于:2015/8/17 13:16:53
variable:bj=0;
ma3:ma(c,13);
ma5:ma(c,21);
pkkd:cross(ma3,ma5);
pdkk:cross(ma5,ma3);
if pkkd and holding=0 and bj=0 then begin
buy(pkkd and  holding=0,1,limitr,close);
bj:=1;
end
if pdkk and holding=0 and bj=0 then begin
buyshort(pdkk and holding=0,1,limitr,close);
bj:=1;
end
 
if pkkd and holding=0 and bj=1 and exitbars>10 then buy(1,1,market);
if pdkk and holding=0 and bj=1 and exitbars>10 then buyshort(1,1,market);
sell(pdkk and holding>0,0,limitr,close);
sellshort(pkkd and holding<0,0,limitr,close);
5楼
冷锋566 发表于:2015/8/17 14:31:28
variable:bj=0;这是什么意思?
6楼
jinzhe 发表于:2015/8/17 14:32:44
全局变量的标记,用来记录是否开过首仓,开过后标记改变,后续的开仓就能加exitbars>10的条件了
共6 条记录, 每页显示 10 条, 页签: [1]


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