Rss & SiteMap

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

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

标题:如何延后发单呢?

1楼
ivan 发表于:2014/8/12 14:49:31
后台程序,由于用轮询方式提前几秒下单,可能在某个时候会出现信号闪烁,而造成频繁的下单(allowrepeat),怎么样才能通过限制的方式减少反复下单呢?

比如提前5秒下单,延后3秒才判断信号是否消失,代码该如何写呢?


2楼
jinzhe 发表于:2014/8/12 14:50:49

http://www.weistock.com/bbs/dispbbs.asp?BoardID=4&ID=2183&skin=0

信号延时参考这贴里面ADMIN的回答

3楼
Ivan 发表于:2014/8/12 15:13:54
我要的是同向开仓的间隔超过N秒,如何表达呢?
4楼
jinzhe 发表于:2014/8/12 15:32:23

我简化了一下,根据我的理解来的

if 开多条件 and 持仓判断 and timetot0(currenttime)-timetot0(extgbdata('time1'))>n then begin

    tbuy....;

    extgbdataset('time1',currenttime);

end

 

 

5楼
Ivan 发表于:2014/8/12 15:46:48
谢谢!我是单策略多周期交易,最好不用用数据库全局变量,用全局变量不行吗?

if 开多条件 and 持仓判断 and timetot0(currenttime)-timetot0('time1)>n then begin

    tbuy....;

    time1:=currenttime;

end


if time>=151458 then time1:=0;


这样不行吗?

6楼
jinzhe 发表于:2014/8/12 15:54:26
也可以不过不管哪种写法,每天重置全局变量为0
7楼
Ivan 发表于:2014/8/12 16:03:53
我在收盘时已做了重置为0:


if 开多条件 and 持仓判断 and timetot0(currenttime)-timetot0('time1)>n then begin

    tbuy....;

    time1:=currenttime;

end


if time>=151458 then time1:=0;


这样可以吧?

8楼
jinzhe 发表于:2014/8/12 16:12:12
可以
9楼
pyd 发表于:2014/8/12 16:19:47
加上一个超全局变量的定义
10楼
风水财神 发表于:2014/8/13 16:59:02
请问 

我简化了一下,根据我的理解来的

if 开多条件 and 持仓判断 and timetot0(currenttime)-timetot0(extgbdata('time1'))>n then begin

    tbuy....;

    extgbdataset('time1',currenttime);

end


time1 不用设定初始值吗 就直接这样用吗

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


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