以文本方式查看主题 - 金字塔客服中心 - 专业程序化交易软件提供商 (http://weistock.com/bbs/index.asp) -- 公式模型编写问题提交 (http://weistock.com/bbs/list.asp?boardid=4) ---- 日内交易同一个策略,不同品种,能不能进行时间段设置 (http://weistock.com/bbs/dispbbs.asp?boardid=4&id=94830) |
-- 作者:lvyi4201 -- 发布时间:2016/3/16 18:48:50 -- 日内交易同一个策略,不同品种,能不能进行时间段设置 我想做日内交易,时间段是 夜盘,开盘20分钟后,可以开始开仓。收盘前10分钟平仓。 白天盘也是开盘20分钟后,可以开始开仓。收盘前10分钟平仓 谢谢老师。
|
-- 作者:jinzhe -- 发布时间:2016/3/17 9:00:07 -- 开仓条件加入:=(time0>timetot0(opentime(1))+20*60 and time0<timetot0(closetime(1))-10*60) or (time0>timetot0(opentime(2))+20*60 and time0<timetot0(closetime(0))-10*60); 收盘前10分钟平仓代码: if time0>=timetot0(closetime(1))-10*60 and time<=closetime(1) then begin sell(1,0,marketr); sellshort(1,0,marketr); end
if time0>=timetot0(closetime(0))-10*60 and time<=closetime(0) then begin sell(1,0,marketr); sellshort(1,0,marketr); end |
-- 作者:lvyi4201 -- 发布时间:2016/3/17 14:14:42 -- 谢谢 |