欢迎使用金字塔普通技术服务论坛,您可以在相关区域发表技术支持贴。
我司技术服务人员将优先处理 VIP客服论坛 服务贴,普通区问题处理速度慢,请耐心等待。谢谢您对我们的支持与理解。


金字塔客服中心 - 专业程序化交易软件提供商金字塔软件公式模型编写问题提交 → [求助]开仓时间不对

   

欢迎使用金字塔普通技术服务论坛,您可以在相关区域发表技术支持贴。
我司技术服务人员将优先处理 VIP客服论坛 服务贴,普通区问题处理速度慢,请耐心等待。谢谢您对我们的支持与理解。    


  共有6349人关注过本帖树形打印复制链接

主题:[求助]开仓时间不对

帅哥哟,离线,有人找我吗?
战争魔鬼
  21楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:新手上路 帖子:65 积分:447 威望:0 精华:0 注册:2011/3/8 21:10:39
  发帖心情 Post By:2012/1/20 11:03:59    Post IP:119.51.90.203[只看该作者]

tq:=5;
long:=c>ma(c,5) and c>ma(c,3);
short:=c<ma(c,5) and c<ma(c,3);
ab:=(mod(dynainfo(207),100)>=60-tq and islastbar and (time=091500 or time=093000 or time=094500 or time=100000 or time=101500 or time=104500 or time=110000 or time=111500 or time=113000 or time=134500 or time=140000 or time=141500 or time=143000)) or not(islastbar);
ab1:=(mod(dynainfo(207),100)>=60-tq and islastbar and time=150000) or (not(islastbar) and time=150000);

EXITSHORT:long and ab or ab1,TFILTER;
ENTERLONG:long and ab ,TFILTER;
EXITLONG:short and ab or ab1,TFILTER;
ENTERSHORT:short and ab ,TFILTER;
不对啊,在10点58分53秒分开仓铜了


 回到顶部
帅哥哟,离线,有人找我吗?
战争魔鬼
  22楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:新手上路 帖子:65 积分:447 威望:0 精华:0 注册:2011/3/8 21:10:39
  发帖心情 Post By:2012/1/20 11:15:08    Post IP:119.51.90.203[只看该作者]

tq:=n;
abb:=(mod(dynainfo(207),100)>=60-tq and islastbar  and ( time>=091401 and time<=091500 or time>=092901 and time=093000 or time>=094401 and time=094500 or time>=095901 and time=100000 or time>=101401 and time=101500 or time>=104401 and time=104500 or time>=105901 and time=110000 or time>=111401 and time=111500 or time>=112901 and time=113000 or time>=134401 and time=134500 or time>=135901 and time=140000 or time>=141401 and time=141500 or time>=142901 and time=143000 or time>=144401 and time=144500 or time>=145901 and time=150000)) or not(islastbar);

ENTERLONG:c>ma(c,5) and c>ma(c,3) and time<144500 and abb ,TFILTER;
EXITLONG:c<ma(c,5) and c<ma(c,3) and abb or time>111500 and abb,TFILTER;
ENTERSHORT:c<ma(c,5) and c<ma(c,3) and time<144500 and abb ,TFILTER;
EXITSHORT:c>ma(c,5) and c>ma(c,3)  and abb or time>111500 and abb,TFILTER;
还是不对,在11点10分开仓PTA


 回到顶部
帅哥哟,离线,有人找我吗?
战争魔鬼
  23楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:新手上路 帖子:65 积分:447 威望:0 精华:0 注册:2011/3/8 21:10:39
  发帖心情 Post By:2012/1/20 11:18:03    Post IP:119.51.90.203[只看该作者]

咋就这么难呢

 回到顶部
帅哥哟,离线,有人找我吗?
fly
  24楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:管理员 帖子:5082 积分:17642 威望:0 精华:6 注册:2010/7/15 9:05:58
  发帖心情 Post By:2012/1/20 14:13:18    Post IP:58.246.57.26[只看该作者]

用下面的试试

 

//15分钟周期,因为周期已经固定,不需要在策略中写明
//运行模式:逐K线&固定时间间隔

//开仓条件:满足条件,且最后两根K线上即使满足条件,当日也不再开仓
//平仓条件1:满足条件,在周期上提前5秒下单
//平仓条件2:在最后一根K线上提前5秒平仓

 

tq:=5;//提前秒数

 

//平空开多
long:=c>ma(c,10) and c>ma(c,5);
//平多开空条件
short:=c<ma(c,10) and c<ma(c,5);

 

t1:=T0TOTIME(TIMETOT0(time)-TIMETOT0(dynainfo(207)))<60;//触发时间控制在该周期的最后一分钟内
//开平仓时间限制1
ab:=(mod(dynainfo(207),100)>=60-tq and t1 and islastbar  and (time=091500 or time=093000 or time=094500 or time=100000 or time=101500 or time=104500 or time=110000 or time=111500 or time=113000 or time=134500 or time=140000 or time=141500 or time=143000)) or not(islastbar);

 

//平仓时间限制2
ab1:=(mod(dynainfo(207),100)>=60-tq and t1 and islastbar  and time=150000) or (not(islastbar) and time=150000);

 

EXITSHORT:long and ab or ab1,TFILTER;
ENTERLONG:long and ab ,TFILTER;

EXITLONG:short and ab or ab1,TFILTER;
ENTERSHORT:short and ab ,TFILTER;

[此贴子已经被作者于2012-1-20 16:05:48编辑过]


金字塔—专业程序化交易量化投资平台

客户服务部

-----------------------------------------------------------

欢迎您参加我公司的技术培训,具体培训需求请发邮件到

service@weistock.com

您的宝贵建议或者投诉,请发往邮箱:weiwei@weistock.com

 回到顶部
总数 24 上一页 1 2 3