以文本方式查看主题

-  金字塔客服中心 - 专业程序化交易软件提供商  (http://www.weistock.com/bbs/index.asp)
--  金字塔软件问题提交  (http://www.weistock.com/bbs/list.asp?boardid=2)
----  固定轮询问题  (http://www.weistock.com/bbs/dispbbs.asp?boardid=2&id=139984)

--  作者:yuanman
--  发布时间:2016/9/23 14:15:29
--  固定轮询问题
请问固定轮询的是怎样计算的?如果我是15分钟周期的模型,想实现60秒下单,我设置840秒的间隔,是不是在出现信号的时候可以实现提前60秒下单哪?谢谢
--  作者: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);


--  作者:yuanman
--  发布时间:2016/9/23 14:40:53
--  

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

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



--  作者:wenarm
--  发布时间:2016/9/23 14:57:06
--  

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

 

 


--  作者: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



--  作者:wenarm
--  发布时间:2016/9/23 15:35:22
--  
可以,这个是一个经典例子
--  作者: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

谢谢

--  作者: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

--  作者: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

--  作者:wenarm
--  发布时间:2016/9/26 12:44:12
--  
不理解你的代码意图?你是想相同条件中,开多次?还是什么?