[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

BetterBB



PureBytes Links

Trading Reference Links

I think there is an error in the program.  Shouldn't

ut=alpha*price+(1-alpha)*ut

read 

ut=alpha*mt+(1-alpha)*ut

- Mark Jurik
-----------------------------------------------

inputs:lookback(79),mult(2),price(c);
vars:alpha(0),mt(0),ut(0),dt(0),
mt2(0),ut2(0),dt2(0),but(0),blt(0);
alpha=2/(lookback+1);
mt=alpha*price+(1-alpha)*mt;
ut=alpha*price+(1-alpha)*ut;
dt=((2-alpha)*mt-ut)/(1-alpha);
mt2=alpha*absvalue(price-dt)+(1-alpha)*mt2;
ut2=alpha*mt2+(1-alpha)*ut2;
dt2=((2-alpha)*mt2-ut2)/(1-alpha);
but=dt+mult*dt2;
blt=dt-mult*dt2;
plot1(dt,"centerb");
plot2(but,"upperb");
plot3(blt,"lowerb");