Rss & SiteMap

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

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

标题:k线结束前执行

1楼
ying_223223 发表于:2016/6/28 15:16:42
看了阿火的帖子,

abb:=(time0-timetot0(dynainfo(207))<=5) or not(islastbar);

if abb then begin
  if holding>0 and ma5<ma10 then sell(1,1,thisclose);
  if holding<0 and ma5>ma10 then sellshort(1,1,thisclose);
  if holding=0 and ma5>ma10 then buy(1,1,thisclose);
  if holding=0 and ma5<ma10 then buyshort(1,1,thisclose);

end
这个条件觉得不太对,

这段代码开平仓执行的时机是:如果当前k线是当天最后一根k线并且在收盘前5秒,或者当前k线不是最后一根k线,下面的开平仓就会被固定时间去执行
2楼
ying_223223 发表于:2016/6/28 15:18:48
如果想要实现,在每根k线都提前5秒执行不应该用上述条件吧
3楼
pyd 发表于:2016/6/28 15:28:47
是这个abb的条件和开平仓条件满足就会提前5秒下单
4楼
ying_223223 发表于:2016/6/28 15:34:28
abb:=(time0-timetot0(dynainfo(207))<=5) or not(islastbar);

只要islastbar=0, abb就会等于1,而islastbar=0不就是说当前的k线不是最后一根k线吗

也就是说只要当前不是最后一根k线开平仓的判断与执行就会在每次固定间隔时间去执行,而不是k线的最后5秒。
我上面的理解有什么问题吗
5楼
pyd 发表于:2016/6/29 14:08:00

不是的

not(islastbar)是保留历史信号用的,

(time0-timetot0(dynainfo(207))<=5)是判断当前k离走完k线是否<=5秒

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


Powered By Dvbbs Version 8.3.0
Processed in 0.18750 s, 2 queries.