用这个回测,不过不会有结果的。 年线的240均线,不存在的。你必须把参数调整小才能有回测结果。
至于如何回测,麻烦看下基础教程,我们不会手把手把这些都在论坛你和客户一一讲解的,也需要客户自行学习一点基础操作的:
https://www.weistock.com/docs/HE ... %E5%88%86%E6%9E%90/
[PEL] 复制代码 input:p(26,20,100,8),s(12,5,40,4),m(9,2,60,6);//参数设置
diff := ema(close,s) - ema(close,p);
dea : =ema(diff,m);
macd1 : =2*(diff-dea), colorstick;
macdjc:=cross(diff,dea);//macd金叉
macdsc:=cross(dea,diff);
year_ma:"ma.ma1#year"(240);
year_ma_sz:stkindi('sh000001','ma.ma1(240)',0,7,0);
year_ma_c:callstock('sh000001',vtclose,-1,0);
con:macdjc and c>year_ma and year_ma_c>year_ma_sz;
ss:=100;
buy(con and holding=0,ss,market);
d1:ref(date,enterbars);
sell(tradingdatediff(d1,date)>=3 and holding>0);
|