以文本方式查看主题

-  金字塔客服中心 - 专业程序化交易软件提供商  (http://weistock.com/bbs/index.asp)
--  公式模型编写问题提交  (http://weistock.com/bbs/list.asp?boardid=4)
----  这个后台测试怎么没有成交?  (http://weistock.com/bbs/dispbbs.asp?boardid=4&id=6207)

--  作者:manbutianya
--  发布时间:2011/4/19 1:29:09
--  这个后台测试怎么没有成交?
 if holding=0 and time<144000 then  //开多
 tbuy(KAIDUO,200,STPLMT,close-30,close-50+20);
if holding=0 and time< 144000 then   //开空
 tbuyshort(KAIKONG,200,STPLMT,close+30,close+50);
if holding>0 then  //平多
  tsell(PINGDUO,holding,lmt,close);
if time=145700 then
  tsell(time=145700,holding,lmt,close);
if holding<0 then   //平空
  tsellshort(PINGKONG,holding,lmt,close);
  tsellshort(time=145700,holding,lmt,close);
把buy等相应改成tbuy,怎么测试就没有成交,错在哪里?
[此贴子已经被作者于2011-4-19 1:30:19编辑过]

--  作者:z7c9
--  发布时间:2011/4/19 8:39:29
--  
tholding
--  作者:伍星亮
--  发布时间:2011/4/27 10:31:37
--  

首先,你用的都是LIMIT,后台是每秒重新计算的。而图表是同一支K线内只做一次操作。这个会影响成交。

第二,你用的是HODLING,他会在BUY函数启动后改变值,但你现在用TBUY就不一定了。建议你学习一下THODLING和HOLDING的不同。测试一下。