Rss & SiteMap

金字塔客服中心 - 专业程序化交易软件提供商 http://www.weistock.com/bbs/

专业程序化软件提供商
共4 条记录, 每页显示 10 条, 页签: [1]
[浏览完整版]

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

1楼
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;
2楼
jinzhe 发表于:2014/4/1 17:26:36
如果有buy,sell这样的函数,那么你就要写在交易公式里面,如果没有交易函数,那么就可以建在其他的里面
图片点击可在新窗口打开查看此主题相关图片如下:1.png
图片点击可在新窗口打开查看
3楼
roxwang 发表于:2014/4/1 17:50:26
到底哪里的问题。请大神帮忙?超级新手求解答。
4楼
roxwang 发表于:2014/4/1 17:56:52
谢谢,明白了。真不好意思。但是新手什么都可能发生。

共4 条记录, 每页显示 10 条, 页签: [1]


Powered By Dvbbs Version 8.3.0
Processed in 0.03125 s, 3 queries.