欢迎使用金字塔普通技术服务论坛,您可以在相关区域发表技术支持贴。
我司技术服务人员将优先处理 VIP客服论坛 服务贴,普通区问题处理速度慢,请耐心等待。谢谢您对我们的支持与理解。


金字塔客服中心 - 专业程序化交易软件提供商金字塔软件金字塔软件问题提交 → 公式评测统计错误

   

欢迎使用金字塔普通技术服务论坛,您可以在相关区域发表技术支持贴。
我司技术服务人员将优先处理 VIP客服论坛 服务贴,普通区问题处理速度慢,请耐心等待。谢谢您对我们的支持与理解。    


  共有5978人关注过本帖树形打印复制链接

主题:公式评测统计错误

帅哥哟,离线,有人找我吗?
zg611029
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:论坛游民 帖子:262 积分:2802 威望:0 精华:0 注册:2011/11/17 19:20:51
  发帖心情 Post By:2012/3/13 14:38:59 [显示全部帖子]

以下是引用readonly在2012-3-13 9:13:25的发言:
 hh:=ref(hhv(h,openminutes(time)),1);
 ll:=ref(llv(l,openminutes(time)),1);
bk1:=h>hh;
sk1:=l<ll;
if holding>0 and time>145900 then sell(1,0,market);
if holding<0 and time>145900 then sellshort(1,0,market);
if holding=0 and bk1 and time>090500 then buy(1,1,market);
if holding=0 and sk1 and time>090500  then buyshort(1,1,market);

这不是程序的问题,是你编制的测试方法不对,就这个模型来说,你的测试结果肯定不是你的实盘结果。拿这句来说if holding>0 and time>145900 then sell(1,0,market);你要求time>145900平仓,也就是在1分钟k线最后一根k线平仓,而market指令是要再最后一根k线结束后才发指令的。可是交易已经结束了,你的测试根本就没有平仓。金字塔怎么处理这个问题我肯定不知道。那么怎么让你的测试结果和实盘一致呢?

hh:=ref(hhv(h,openminutes(time)),1);
ll:=ref(llv(l,openminutes(time)),1);
bk1:=h>hh;
sk1:=l<ll;
if holding>0 and time>145900 then sell(1,0,thisclose);
if holding<0 and time>145900 then sellshort(1,0,thisclose);
if holding=0 and bk1 and time>090500 then buy(1,1,thisclose);
if holding=0 and sk1 and time>090500 then buyshort(1,1,thisclose);

以上是使用一根k线走完模式;

如果你是使用轮询则要如下进行测试:

hh:=ref(hhv(h,openminutes(time)),1);
ll:=ref(llv(l,openminutes(time)),1);
bk1:=h>hh;
sk1:=l<ll;
if holding>0 and time>145900 then sell(1,0,limitr,o-0.4);
if holding<0 and time>145900 then sellshort(1,0,limitr,o+0.4);
if holding=0 and bk1 and time>090500 then buy(1,1,limitr,hh+0.4);
if holding=0 and sk1 and time>090500 then buyshort(1,1,limitr,ll-0.4);

这样的测试结果才会和你的实盘结果一致

 

 


 


 回到顶部