引用公式“DAYTREND”
input:n(20,0,100,1);
input:m(20,0,100,1);
tr1 := max(max((high-low),abs(ref(close,1)-high)),abs(ref(close,1)-low));
atr1 : =ma(tr1,n);
atr:=ifelse(atr1<0.01*c,0.01*c,ifelse(atr1<0.025*c,atr1,0.025*c));
c1:=(h+l+2*c)/4;
mam1:ref(ema(c1,m),1);
top1:ref(ema(c1+atr,m),1);
bottom1:ref(ema(c1-atr,m),1);
mam2:ref(ema(c1,5*m),1);
top2:ref(ema(c1+atr,5*m),1);
bottom2:ref(ema(c1-atr,5*m),1);
引用公式“DAYTREND”日周期的指标如下
5mam1:stkindi('','DAYTREND.mam1',6,-1);
5top1:stkindi('','DAYTREND.top1',6,-1);
5bottom1:stkindi('','DAYTREND.bottom1',6,-1);
5mam2:stkindi('','DAYTREND.mam2',6,-1);
5top2:stkindi('','DAYTREND.top2',6,-1);
5bottom2:stkindi('','DAYTREND.bottom2',6,-1);
5atr:=stkindi('','DAYTREND.atr',6,-1);
5emastr:=stkindi('','DAYTREND.emastr',6,-1);
引用公式“DAYTREND”周周期的指标如下
5mam1:stkindi('','DAYTREND.mam1',7,-1);
5top1:stkindi('','DAYTREND.top1',7,-1);
5bottom1:stkindi('','DAYTREND.bottom1',7,-1);
5mam2:stkindi('','DAYTREND.mam2',7,-1);
5top2:stkindi('','DAYTREND.top2',7,-1);
5bottom2:stkindi('','DAYTREND.bottom2',7,-1);
5atr:=stkindi('','DAYTREND.atr',7,-1);
5emastr:=stkindi('','DAYTREND.emastr',7,-1);
交易模块分别按日周期引用“DAYTREND”的指标和按周周期的指标“DAYTREND”的指标回测结果都是一样的,是编写的问题?
因为你没写对,所有引用都按照下面改:
5mam1:stkindi('','DAYTREND.mam1',0,6,-1);
你没写对,你前面写的是错的。我修改的是正确的写法,