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

Re: [EquisMetaStock Group] question to roy



PureBytes Links

Trading Reference Links

le corbeaux masque

> sorry there was a slight problem with the typo of the
> code i send, now it matches "my" trouble making
> version

I can't see your problem with just a quick look. Here's a version that works
on uncompressed daily data to give weekly values. The upper and lower bands
lag by 50 weeks regardless of the periods setting used but other than that I
think it is very accurate.

Roy

  {Weekly Bollinger Bands}
  {use on daily charts}
D:=Input("Weeks",6,50,10);
G:=Input("Deviations",0,9,2);
I:=Input("0=SMA 1=EMA",0,1,0);
A:=DayOfWeek()=5;Q:=2/(D+1);
B:=DayOfWeek()<=Ref(DayOfWeek(),-1);
J:=If(A,1,If(Alert(A,2)=0 AND B,2,0));
K:=ValueWhen(1,J,If(J=1,C,Ref(C,-1)));
M:=(Cum(If(J,K,0))-ValueWhen(D+1,J,Cum(If(J,K,0))))/D;
N:=If(Cum(J>0)=1,K,ValueWhen(1,J,PREV)*(1-Q)+K*Q);
X:=Power(M-ValueWhen(1,J,K),2)+
Power(M-ValueWhen(2,J,K),2)+
Power(M-ValueWhen(3,J,K),2)+
Power(M-ValueWhen(4,J,K),2)+
Power(M-ValueWhen(5,J,K),2)+
Power(M-ValueWhen(6,J,K),2)+
(D>6)*Power(M-ValueWhen(7,J,K),2)+
(D>7)*Power(M-ValueWhen(8,J,K),2)+
(D>8)*Power(M-ValueWhen(9,J,K),2)+
(D>9)*Power(M-ValueWhen(10,J,K),2)+
(D>10)*Power(M-ValueWhen(11,J,K),2)+
(D>11)*Power(M-ValueWhen(12,J,K),2)+
(D>12)*Power(M-ValueWhen(13,J,K),2)+
(D>13)*Power(M-ValueWhen(14,J,K),2)+
(D>14)*Power(M-ValueWhen(15,J,K),2)+
(D>15)*Power(M-ValueWhen(16,J,K),2)+
(D>16)*Power(M-ValueWhen(17,J,K),2)+
(D>17)*Power(M-ValueWhen(18,J,K),2)+
(D>18)*Power(M-ValueWhen(19,J,K),2)+
(D>19)*Power(M-ValueWhen(20,J,K),2)+
(D>20)*Power(M-ValueWhen(21,J,K),2)+
(D>21)*Power(M-ValueWhen(22,J,K),2)+
(D>22)*Power(M-ValueWhen(23,J,K),2)+
(D>23)*Power(M-ValueWhen(24,J,K),2)+
(D>24)*Power(M-ValueWhen(25,J,K),2)+
(D>25)*Power(M-ValueWhen(26,J,K),2)+
(D>26)*Power(M-ValueWhen(27,J,K),2)+
(D>27)*Power(M-ValueWhen(28,J,K),2)+
(D>28)*Power(M-ValueWhen(29,J,K),2)+
(D>29)*Power(M-ValueWhen(30,J,K),2)+
(D>30)*Power(M-ValueWhen(31,J,K),2)+
(D>31)*Power(M-ValueWhen(32,J,K),2)+
(D>32)*Power(M-ValueWhen(33,J,K),2)+
(D>33)*Power(M-ValueWhen(34,J,K),2)+
(D>34)*Power(M-ValueWhen(35,J,K),2)+
(D>35)*Power(M-ValueWhen(30+6,J,K),2)+
(D>30+6)*Power(M-ValueWhen(30+7,J,K),2)+
(D>30+7)*Power(M-ValueWhen(30+8,J,K),2)+
(D>30+8)*Power(M-ValueWhen(30+9,J,K),2)+
(D>30+9)*Power(M-ValueWhen(40,J,K),2)+
(D>40)*Power(M-ValueWhen(40+1,J,K),2)+
(D>40+1)*Power(M-ValueWhen(40+2,J,K),2)+
(D>40+2)*Power(M-ValueWhen(40+3,J,K),2)+
(D>40+3)*Power(M-ValueWhen(40+4,J,K),2)+
(D>40+4)*Power(M-ValueWhen(40+5,J,K),2)+
(D>40+5)*Power(M-ValueWhen(40+6,J,K),2)+
(D>40+6)*Power(M-ValueWhen(40+7,J,K),2)+
(D>40+7)*Power(M-ValueWhen(40+8,J,K),2)+
(D>40+8)*Power(M-ValueWhen(40+9,J,K),2)+
(D>40+9)*Power(M-ValueWhen(50,J,K),2);
I:=If(I,N,M);
R:=G*Sqrt(X/D);
Y:=I+R;
Z:=I-R;
M;Y;Z;



------------------------ Yahoo! Groups Sponsor ---------------------~-->
Buy Ink Cartridges or Refill Kits for your HP, Epson, Canon or Lexmark
Printer at MyInks.com. Free s/h on orders $50 or more to the US & Canada.
http://www.c1tracking.com/l.asp?cid=5511
http://us.click.yahoo.com/mOAaAA/3exGAA/qnsNAA/BefplB/TM
---------------------------------------------------------------------~->

To unsubscribe from this group, send an email to:
equismetastock-unsubscribe@xxxxxxxxxxxxxxx

 

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/