Rss & SiteMap

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

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

标题:[求助]提前平仓

1楼
宁静致远1 发表于:2017/3/3 12:45:02

麻烦一下老师,我想设置在9:00-9:30和21:00-21:30这两个交易时间段提前250秒平仓,该怎么表达?

If c<enterprice-5     and holding>0 then sell(1,0,marketr);

If c>enterprice+5      and holding<0  then sellshort(1,0,marketr);

2楼
jinzhe 发表于:2017/3/3 13:19:16
当前周期是多少?
3楼
宁静致远1 发表于:2017/3/3 13:29:32
5分钟周期的
4楼
jinzhe 发表于:2017/3/3 13:36:26

tq:=Not(islastbar) or (timetot0(dynainfo(207))>=time0-250);

If c<enterprice-5     and holding>0 and tq and ((time>090000 and time<=093000)  or (time>210000 and time<=213000)) then sell(1,0,marketr);

If c>enterprice+5      and holding<0  and tq and ((time>090000 and time<=093000)  or (time>210000 and time<=213000)) then sellshort(1,0,marketr);

5楼
宁静致远1 发表于:2017/3/3 14:10:40
测试了一下,发现当根K线开仓之后马上平仓了,不知道为什么
6楼
jinzhe 发表于:2017/3/3 14:17:57
说明满足你讲的了
7楼
宁静致远1 发表于:2017/3/3 15:00:52
当根K线开仓之后马上平仓,连第二根K线都没走下去
8楼
jinzhe 发表于:2017/3/3 15:12:27

说明满足你的条件了

9楼
宁静致远1 发表于:2017/3/3 15:16:37
该成金字塔时间就可以使用,老师能不能把它该成北京时间也可以用的代码
10楼
jinzhe 发表于:2017/3/3 15:19:33
这段就是北京时间的代码,金字塔时间你按F10,对照着改
共11 条记录, 每页显示 10 条, 页签: [1] [2]


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