以文本方式查看主题
- 金字塔客服中心 - 专业程序化交易软件提供商 (http://weistock.com/bbs/index.asp)
-- 公式模型编写问题提交 (http://weistock.com/bbs/list.asp?boardid=4)
---- 提前下单 (http://weistock.com/bbs/dispbbs.asp?boardid=4&id=88553)
|
-- 作者:yuanman
-- 发布时间:2015/12/17 11:29:46
-- 提前下单
请教老师,高手;我想在30分钟周期图表程序化上实现提前5秒下单,在网上搜索到阿火的方法;请教这种方法这样可以在实现吗?如何改写?谢谢。
abb:=(mod(currenttime,100)>55 and islastbar) or not(islastbar);
if holding>0 and ma5<ma10 and abb then sell(1,1,thisclose);
if holding<0 and ma5>ma10 and abb then sellshort(1,1,thisclose);
if holding=0 and ma5>ma10 and abb then buy(1,1,thisclose);
if holding=0 and ma5<ma10 and abb then buyshort(1,1,thisclose);
|
-- 作者:jinzhe
-- 发布时间:2015/12/17 11:34:14
--
第一句要这样写:
abb:=(timetot0(dynainfo(207))>=time0-5 and islastbar) or not(islastbar);
使用固定轮询模式,一秒轮询
|
-- 作者:yuanman
-- 发布时间:2015/12/17 12:07:25
--
请老师解惑;
使用固定一秒轮询的模式,在30分钟操作周期上提前5秒下单。不太理解?如果我使用KDJ交叉作为开平仓信号,在30分钟周期上任意分钟内或者就是在第10分钟出现了交叉信号,会等到29分55秒再发出吗?谢谢。
abb:=(timetot0(dynainfo(207))>=time0-5 and islastbar) or not(islastbar);
if holding>0 and ma5<ma10 and abb then sell(1,1,thisclose);
if holding<0 and ma5>ma10 and abb then sellshort(1,1,thisclose);
if holding=0 and ma5>ma10 and abb then buy(1,1,thisclose);
if holding=0 and ma5<ma10 and abb then buyshort(1,1,thisclose);
|
-- 作者:jinzhe
-- 发布时间:2015/12/17 13:20:23
--
只要在k线走完前5秒信号还在,就会下单
固定轮询1米模式:
此主题相关图片如下:1.png

|
-- 作者:yuanman
-- 发布时间:2015/12/17 13:50:11
--
谢谢老师耐心解答。再请问两个问题。1;上面这段程序应该放到模型的哪里?2;如果用在15分钟周期上要修改吗?谢谢。
|
-- 作者:jinzhe
-- 发布时间:2015/12/17 13:59:32
--
1.abb这一句要放在最开始,然后添加进下单语句即可
2.一样代码,不用修改
|
-- 作者:yuanman
-- 发布时间:2015/12/17 14:05:11
--
如果改变开平仓条件,就修改粉色的位置对吗?
abb:=(timetot0(dynainfo(207))>=time0-5 and islastbar) or not(islastbar);
if holding>0 and ma5<ma10 and abb then sell(1,1,thisclose);
if holding<0 and ma5>ma10 and abb then sellshort(1,1,thisclose);
if holding=0 and ma5>ma10 and abb then buy(1,1,thisclose);
if holding=0 and ma5<ma10 and abb then buyshort(1,1,thisclose);
|
-- 作者:jinzhe
-- 发布时间:2015/12/17 14:21:30
--
是的
|
-- 作者:yuanman
-- 发布时间:2015/12/17 14:43:20
--
添加到模型中出现的提示,这样不会影响模型运行吧?
此主题相关图片如下:qq截图20151217143844.png

|
-- 作者:jinzhe
-- 发布时间:2015/12/17 14:48:56
--
不会,这是经过特殊处理后的dynainfo函数,用在 图表里面没问题的
|