Rss & SiteMap

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

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

标题:[原创]请教限制盘前平仓的时间代码

1楼
木鱼石传说 发表于:2013/8/21 16:19:34
看了一些收盘前平仓的代码,搞乱了,请老师厘清!

股指期货,我现在要求在151359时无论什么头寸都下单平仓,这个代码应该怎么写?要用交易所时间,不是本地电脑的时间。
2楼
jinzhe 发表于:2013/8/21 16:23:04
把刚才给你的时间判断改成151359
3楼
木鱼石传说 发表于:2013/8/21 19:40:26
下面三种的哪一种?

DYNAINFO(207)>151339 and islastbar


time > 151359 and not(islastbar)


not(islastbar) and time=151500 or islastbar and currenttime>151359
4楼
jinzhe 发表于:2013/8/22 8:48:32
我给你写的那种
5楼
武田晴信 发表于:2013/8/22 9:12:11
not(islastbar) and time=151500 or islastbar and currenttime>151359
这个,你还是没有理解代码的含义
6楼
fly 发表于:2013/8/22 17:18:20
楼上正解
not(islastbar) and time=151500 //非最后一根K线,时间151500平仓
 
 (islastbar and DYNAINFO(207)>151359)//最后一根K线,151359平仓----取的就是交易所时间
 
结合起来就是
not(islastbar) and time=151500 or  (islastbar and DYNAINFO(207)>151359)
7楼
木鱼石传说 发表于:2013/8/22 20:56:29
not(islastbar) and time=151500 or  (islastbar and DYNAINFO(207)>151359);其中含有DYNAINFO(207)那还能用于历史评测吗?
8楼
木鱼石传说 发表于:2013/8/23 7:59:10
    自己检测了一下,上述代码可以评测,不过在1minK线上对照一下信号,发现收盘平仓的信号出现在最后一根K线上,而个人原来的本意是要在倒数第二根K线走完时平仓,这样,于上述代码not(islastbar) and time=151500就有点出入,可否改成下面这样?
not(islastbar) and time=151400 or  (islastbar and DYNAINFO(207)>151359);

发现改成这样后,收盘信号就出现在倒数第二根K线上了,请老师指点!
9楼
木鱼石传说 发表于:2013/8/23 8:04:24
not(islastbar) and time=151500 改成not(islastbar) and time=151400 ,是不是固定轮询模式时,在15:13:01就会被执行平仓了?
10楼
木鱼石传说 发表于:2013/8/23 15:24:34


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


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