Rss & SiteMap

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

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

标题:固定轮询问题

1楼
yuanman 发表于:2016/9/23 14:15:29
请问固定轮询的是怎样计算的?如果我是15分钟周期的模型,想实现60秒下单,我设置840秒的间隔,是不是在出现信号的时候可以实现提前60秒下单哪?谢谢
2楼
wenarm 发表于:2016/9/23 14:33:49

你理解的有点偏差。固定时间间隔,是间隔相同时间检测信号是否触发。

你是想提前60秒下单。可以考虑使用软件中带的走完k提前n秒下单(专业版功能)

或者在策略中用代码实现。

input:tq(5,3,60,1);//TQ即为您要提前的秒数
abb:=(time0-timetot0(dynainfo(207))<=tq) or not(islastbar);

3楼
yuanman 发表于:2016/9/23 14:40:53

input:tq(5,3,60,1);//TQ即为您要提前的秒数
abb:=(time0-timetot0(dynainfo(207))<=tq) or not(islastbar);

这个代码可以用在K线走完的模式吗?


4楼
wenarm 发表于:2016/9/23 14:57:06

代码实现的提前几秒下单,需要固定时间间隔的方式。

 

 

5楼
yuanman 发表于:2016/9/23 15:24:58
请教老师;论坛上的阿火秘籍中的提前下单方法是否可以实现?

ma5:=ma(c,5);
ma10:=ma(c,10);
input:tq(5,3,60,1);
abb:=(time0-timetot0(dynainfo(207))<=tq) 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


6楼
wenarm 发表于:2016/9/23 15:35:22
可以,这个是一个经典例子
7楼
yuanman 发表于:2016/9/26 9:45:13
请老师指点;我是15分钟周期,要提前10秒下单,每次开仓5手,

abb:=(time0-timetot0(dynainfo(207))<=10) 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,5,thisclose);
  if holding=0 and ma5<ma10 then buyshort(1,5,thisclose);
end

谢谢
8楼
pyd 发表于:2016/9/26 10:23:23

开平仓顺序写成

abb:=(time0-timetot0(dynainfo(207))<=10) or not(islastbar);
if abb then begin
if holding<0 and ma5>ma10 then sellshort(1,1,thisclose);
if holding=0 and ma5>ma10 then buy(1,5,thisclose);
if holding>0 and ma5<ma10 then sell(1,1,thisclose);
if holding=0 and ma5<ma10 then buyshort(1,5,thisclose);
end
9楼
yuanman 发表于:2016/9/26 11:23:53
如果我有多个平多,平空。开多,开空这样编写对吗?谢谢老师!

abb:=(time0-timetot0(dynainfo(207))<=10) or not(islastbar);
if abb then begin
if holding<0 and ma5>ma10 then sellshort(1,1,thisclose);
if holding<0 and ma5>ma10 then sellshort(1,1,thisclose);
if holding<0 and ma5>ma10 then sellshort(1,1,thisclose);

if holding=0 and ma5>ma10 then buy(1,5,thisclose);
if holding=0 and ma5>ma10 then buy(1,5,thisclose);

if holding>0 and ma5<ma10 then sell(1,1,thisclose);
if holding>0 and ma5<ma10 then sell(1,1,thisclose);
if holding>0 and ma5<ma10 then sell(1,1,thisclose);

if holding=0 and ma5<ma10 then buyshort(1,5,thisclose);
if holding=0 and ma5<ma10 then buyshort(1,5,thisclose);
end
10楼
wenarm 发表于:2016/9/26 12:44:12
不理解你的代码意图?你是想相同条件中,开多次?还是什么?
共26 条记录, 每页显示 10 条, 页签: [1] [2][3]


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