Smooth:=(c+2*ref(c,1)+2*ref(c,2)+ref(c,3))/6;
IF BARSCOUNT(C)<7 then cycle:=(c-2*ref(c,1)+ref(c,2))/4;
IF BARSCOUNT(C)>6 then Cycle:=(1-.5*alpha)*(1-.5*alpha)*(Smooth-2*ref(smooth,1)+ref(smooth,2))+2*(1-alpha)*REF(Cycle,1)-(1-alpha)*(1-alpha)*REF(Cycle,2);
ICycle:(Exp(2*Cycle)-1)/(Exp(2*Cycle)+1);
SellRef:.5;
BuyRef:-.5; 以下内容为程序代码:
1 Smooth:=(c+2*ref(c,1)+2*ref(c,2)+ref(c,3))/6;
2 IF BARSCOUNT(C)<7 then cycle:=(c-2*ref(c,1)+ref(c,2))/4;
3 IF BARSCOUNT(C)>6 then Cycle:=(1-.5*alpha)*(1-.5*alpha)*(Smooth-2*ref(smooth,1)+ref(smooth,2))+2*(1-alpha)*REF(Cycle,1)-(1-alpha)*(1-alpha)*REF(Cycle,2);
4 ICycle:(Exp(2*Cycle)-1)/(Exp(2*Cycle)+1);
5 SellRef:.5;
6 BuyRef:-.5;
input:alpha(1,1,10,1);
smooth:=(c+2*ref(c,1)+2*ref(c,2)+ref(c,3))/6;
if barscount(c)<7 then cycle:=(c-2*ref(c,1)+ref(c,2))/4;
if barscount(c)>6 then cycle:=(1-.5*alpha)*(1-.5*alpha)*(smooth-2*ref(smooth,1)+ref(smooth,2))+2*(1-alpha)*ref(cycle,1)-(1-alpha)*(1-alpha)*ref(cycle,2);
icycle:(exp(2*cycle)-1)/(exp(2*cycle)+1);
sellref:.5;
buyref:-.5;
(1-.5*alpha)这种写法=====(1-0.5*alpha)?
如果是,可以考虑改成后者
以下是引用fly在2011-2-22 9:51:49的发言:
(1-.5*alpha)这种写法=====(1-0.5*alpha)?
如果是,可以考虑改成后者
依旧提示第三行错误,解释错误。
if barscount(c)>6 then cycle:=(1-.5*alpha)*(1-.5*alpha)*(smooth-2*ref(smooth,1)+ref(smooth,2))+2*(1-alpha)*ref(cycle,1)-(1-alpha)*(1-alpha)*ref(cycle,2);