以文本方式查看主题

-  金字塔客服中心 - 专业程序化交易软件提供商  (http://weistock.com/bbs/index.asp)
--  公式模型编写问题提交  (http://weistock.com/bbs/list.asp?boardid=4)
----  总是显示是交易系统函数不是交易系统公式?  (http://weistock.com/bbs/dispbbs.asp?boardid=4&id=63392)

--  作者:roxwang
--  发布时间:2014/4/1 17:23:19
--  总是显示是交易系统函数不是交易系统公式?
无论用哪个交易系统测试,总是显示是交易系统函数,但公式不是交易系统公式,可能无法正常工作。但是又不显示到底是哪个公式不是交易系统公式。真是难啊?到底啥问题啊?是版本的问题吗?测试的是个超简单的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;

--  作者:jinzhe
--  发布时间:2014/4/1 17:26:36
--  
如果有buy,sell这样的函数,那么你就要写在交易公式里面,如果没有交易函数,那么就可以建在其他的里面
图片点击可在新窗口打开查看此主题相关图片如下:1.png
图片点击可在新窗口打开查看

--  作者:roxwang
--  发布时间:2014/4/1 17:50:26
--  
到底哪里的问题。请大神帮忙?超级新手求解答。
--  作者:roxwang
--  发布时间:2014/4/1 17:56:52
--  
谢谢,明白了。真不好意思。但是新手什么都可能发生。