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


金字塔客服中心 - 专业程序化交易软件提供商金字塔软件公式模型编写问题提交 → 总是显示是交易系统函数不是交易系统公式?

   

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


  共有2276人关注过本帖平板打印复制链接

主题:总是显示是交易系统函数不是交易系统公式?

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


加好友 发短信
等级:新手上路 帖子:4 积分:0 威望:0 精华:0 注册:2014/3/11 18:12:34
总是显示是交易系统函数不是交易系统公式?  发帖心情 Post By:2014/4/1 17:23:19    Post IP:121.236.159.47[只看该作者]

无论用哪个交易系统测试,总是显示是交易系统函数,但公式不是交易系统公式,可能无法正常工作。但是又不显示到底是哪个公式不是交易系统公式。真是难啊?到底啥问题啊?是版本的问题吗?测试的是个超简单的macd公式啊。
runmode:0;
input:p(26,20,100,8);
input:s(12,5,40,4);
input:m(9,2,60,6);
variable:myasset=300000;
diff:=ema(close,s)-ema(close,p);
dea:=ema(diff,m);
macd:=2*(diff-dea);
entertime:=time>=091000 and time<=145500;
exittime:=time>=150000;
buycond:=ref(cross(macd,0),1);
sellcond:=ref(cross(0,macd),1);
if holding=0 then begin
 if buycond then
  buy(1,1,limitr,open);
end
if holding=0 then begin
 if sellcond then
  buyshort(1,1,limitr,open);
end
if holding>0 then begin
 if exittime then
  sell(1,holding,limitr,close);
 
 if sellcond then begin
  sell(1,holding,limitr,open),orderqueue;
  buyshort(1,1,limitr,open),orderqueue;
 end 
end
if holding<0 then begin
 if exittime then
  sellshort(1,holding,limitr,close);
  
 if buycond then begin
  sellshort(1,holding,limitr,open),orderqueue;
  buy(1,1,limitr,open),orderqueue;
 end 
end
if exittime then
 myasset:=asset;
 
收益:myasset,noaxis,colormagenta;
次数:totaltrade,linethick0;
胜率:percentwin,linethick0;
连亏:maxseqloss,linethick0;
连赢:maxseqwin,linethick0;

 回到顶部