SI
SI
discoversearch

We've detected that you're using an ad content blocking browser plug-in or feature. Ads provide a critical source of revenue to the continued operation of Silicon Investor.  We ask that you disable ad blocking while on Silicon Investor in the best interests of our community.  If you are not using an ad blocker but are still receiving this message, make sure your browser's tracking protection is set to the 'standard' level.
Strategies & Market Trends : TA-Quotes Plus -- Ignore unavailable to you. Want to Upgrade?


To: Richard Estes who wrote (3110)1/18/1998 1:16:00 AM
From: TechTrader42  Read Replies (1) | Respond to of 11149
 
Richard: I'm not getting errors when I run that scan. Maybe a line
break was introduced in transit. But I have questions about that scan,
which I've sent to Bill R. I wonder whether it's calculating CCI
correctly, because of one variable -- I won't go into the details yet.
For all I know, it could be correct.

In the meantime, here's a scan for CCI (13) that I have verified. It gives
exactly the same values for CCI (13) that Window on Wall Street
gives. It's essentially John Sugas' scan, but I've changed the periods
to 13 and made one important change in the way absolute value was used.

John's CCI(8) scan had (0.015*abs((B-R)+(C-S)+(D-T)+(E-U)+(F-V)+abs(G-W)+(H-X)+(I-Y))/8),
but that throws the values off, so that you get some odd numbers that
don't agree with those in WOW.

Abs should be set up like this:
cci := (B-R)/(0.015*(abs(B-R)+abs(C-S)+abs(D-T)+abs(E-U)+abs(F-V)
+abs(G-W)+abs(H-X)+abs(I-Y))/8)

The formula for cci does call for calculating the absolute value of
each of those results, not the absolute value of the whole thing.

Read Step 4 under the formula for CCI in "TA from A to Z." Here's a
link to the page: equis.com

I noticed this only after comparing values with John's formula and
WOW, and being mystified by some discrepancies.

Once you change the formula in QP, you get values exactly the same
as those in WOW.

Here, then, are some scans:

CCI(8), by John Sugas (with abs corrected)

//cci(8), calculate value, by John Sugas

output="ccieight.lst";

float cci, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, R, S, T, U, V, W,
X, Y;

B :=(high(0)+low(0)+close(0))/3 ;
C :=(high(-1)+low(-1)+close(-1))/3 ;
D :=(high(-2)+low(-2)+close(-2))/3 ;
E :=(high(-3)+low(-3)+close(-3))/3 ;
F :=(high(-4)+low(-4)+close(-4))/3 ;
G :=(high(-5)+low(-5)+close(-5))/3 ;
H :=(high(-6)+low(-6)+close(-6))/3 ;
I :=(high(-7)+low(-7)+close(-7))/3 ;
J :=(high(-8)+low(-8)+close(-8))/3 ;
K :=(high(-9)+low(-9)+close(-9))/3 ;
L :=(high(-10)+low(-10)+close(-10))/3 ;
M :=(high(-11)+low(-11)+close(-11))/3 ;
N :=(high(-12)+low(-12)+close(-12))/3 ;
O :=(high(-13)+low(-13)+close(-13))/3 ;
P :=(high(-14)+low(-14)+close(-14))/3 ;
R :=(B+C+D+E+F+G+H+I)/8 ;
S :=(C+D+E+F+G+H+I+J)/8 ;
T :=(D+E+F+G+H+I+J+K)/8 ;
U :=(E+F+G+H+I+J+K+L)/8 ;
V :=(F+G+H+I+J+K+L+M)/8 ;
W :=(G+H+I+J+K+L+M+N)/8 ;
X :=(H+I+J+K+L+M+N+O)/8 ;
Y :=(I+J+K+L+M+N+O+P)/8 ;

cci := (B-R)/(0.015*(abs(B-R)+abs(C-S)+abs(D-T)+abs(E-U)+abs(F-V)+abs(G-W)+abs(H-X)+abs(I-Y))/8);
println symbol,": ",cci;

*******************

CCI(13), based on John's CCI(8) scan:

output="ccithirt.lst";

daystoload = 250;

float cci, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z, aa, bb, cc, dd, ee, ff, gg, hh, ii, jj, kk, ll, mm;

B :=(high(0)+low(0)+close(0))/3 ;
C :=(high(-1)+low(-1)+close(-1))/3 ;
D :=(high(-2)+low(-2)+close(-2))/3 ;
E :=(high(-3)+low(-3)+close(-3))/3 ;
F :=(high(-4)+low(-4)+close(-4))/3 ;
G :=(high(-5)+low(-5)+close(-5))/3 ;
H :=(high(-6)+low(-6)+close(-6))/3 ;
I :=(high(-7)+low(-7)+close(-7))/3 ;
J :=(high(-8)+low(-8)+close(-8))/3 ;
K :=(high(-9)+low(-9)+close(-9))/3 ;
L :=(high(-10)+low(-10)+close(-10))/3 ;
M :=(high(-11)+low(-11)+close(-11))/3 ;
N :=(high(-12)+low(-12)+close(-12))/3 ;
O :=(high(-13)+low(-13)+close(-13))/3 ;
P :=(high(-14)+low(-14)+close(-14))/3 ;
Q :=(high(-15)+low(-15)+close(-15))/3 ;
R :=(high(-16)+low(-16)+close(-16))/3 ;
S :=(high(-17)+low(-17)+close(-17))/3 ;
T :=(high(-18)+low(-18)+close(-18))/3 ;
U :=(high(-19)+low(-19)+close(-19))/3 ;
V :=(high(-20)+low(-20)+close(-20))/3 ;
W :=(high(-21)+low(-21)+close(-21))/3 ;
X :=(high(-22)+low(-22)+close(-22))/3 ;
Y :=(high(-23)+low(-23)+close(-23))/3 ;
Z :=(high(-24)+low(-24)+close(-24))/3 ;

aa :=(B+C+D+E+F+G+H+I+J+K+L+M+N)/13 ;
bb :=(C+D+E+F+G+H+I+J+K+L+M+N+O)/13 ;
cc :=(D+E+F+G+H+I+J+K+L+M+N+O+P)/13 ;
dd :=(E+F+G+H+I+J+K+L+M+N+O+P+Q)/13 ;
ee :=(F+G+H+I+J+K+L+M+N+O+P+Q+R)/13 ;
ff :=(G+H+I+J+K+L+M+N+O+P+Q+R+S)/13 ;
gg :=(H+I+J+K+L+M+N+O+P+Q+R+S+T)/13 ;
hh :=(I+J+K+L+M+N+O+P+Q+R+S+T+U)/13 ;
ii :=(J+K+L+M+N+O+P+Q+R+S+T+U+V)/13 ;
jj :=(K+L+M+N+O+P+Q+R+S+T+U+V+W)/13 ;
kk :=(L+M+N+O+P+Q+R+S+T+U+V+W+X)/13 ;
ll :=(M+N+O+P+Q+R+S+T+U+V+W+X+Y)/13 ;
mm :=(N+O+P+Q+R+S+T+U+V+W+X+Y+Z)/13 ;

cci := (B-aa)/(0.015*(abs(B-aa)+abs(C-bb)+abs(D-cc)+abs(E-dd)+abs(F-ee)+abs(G-ff)+abs(H-gg)+abs(I-hh)+abs(J-ii)+abs(K-jj)+abs(L-kk)+abs(M-ll)+abs(N-mm))/13);

//if
//(B-R)/(0.015*(abs(B-R)+abs(C-S)+abs(D-T)+abs(E-U)+abs(F-V)+abs(G-W)+abs(H-X)+abs(I-Y)+abs(J-Ya)+abs(K-Yb)+abs(L-Yc)+abs(M-Yd)+abs(N-Ye))/13)<-100 then
//println symbol,", ",description,", ",close(0); endif;

Println Symbol, ": ", cci:8:2;

********************

I'm going to add previous days' cci to these scans so we can look for
cci crossing up through -100, for example.

I'm also hoping to reduce some of these with for loops, and making
the scan so you can put in any period. Maybe John Sugas already has
some ideas.

I'd like to get a good variable formula for cci so that we
could move toward a formula for BNS (Bill's New System) in QP.
Why -- when we've got it in WOW and Metastock? Because it's there.
Maybe it'll lead to some insights into QP, too, or new trading
formulas. Maybe authorities will lock me up. We shall see.

Brooke



To: Richard Estes who wrote (3110)1/18/1998 1:46:00 AM
From: TechTrader42  Respond to of 11149
 
Here is a CCI(13) scan that calculates CCI for today and the previous
day, and looks for stocks with CCI that crossed up through -100.
The values of CCI(13) are identical to those in Window on Wall Street.
It's easy to change -100 to anything you want, too.

For me, this is a minor breakthrough, getting CCI values that agree
with those in WOW. Reducing the formula with the help of for loops,
and making it one with variable periods, will no doubt lead to a minor
breakdown, but that's the next step. After that, it would be nice
to come up with a formula for the slope of CCI, so that we could use
it in a QP BNS formula.

Here's the CCI (13) Crossing -100 scan, based on John Sugas' original:
CCI(8) scan (but with abs changed):

//cci crossing up through -100

output="ccicross.lst";
issuetype=common;
exchange nyse,nasdaq,amex;
daystoload = 250;

float cci, cciprev, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z, ZZ, aa, bb, cc, dd, ee, ff, gg, hh, ii, jj, kk, ll, mm, nn;

B :=(high(0)+low(0)+close(0))/3 ;
C :=(high(-1)+low(-1)+close(-1))/3 ;
D :=(high(-2)+low(-2)+close(-2))/3 ;
E :=(high(-3)+low(-3)+close(-3))/3 ;
F :=(high(-4)+low(-4)+close(-4))/3 ;
G :=(high(-5)+low(-5)+close(-5))/3 ;
H :=(high(-6)+low(-6)+close(-6))/3 ;
I :=(high(-7)+low(-7)+close(-7))/3 ;
J :=(high(-8)+low(-8)+close(-8))/3 ;
K :=(high(-9)+low(-9)+close(-9))/3 ;
L :=(high(-10)+low(-10)+close(-10))/3 ;
M :=(high(-11)+low(-11)+close(-11))/3 ;
N :=(high(-12)+low(-12)+close(-12))/3 ;
O :=(high(-13)+low(-13)+close(-13))/3 ;
P :=(high(-14)+low(-14)+close(-14))/3 ;
Q :=(high(-15)+low(-15)+close(-15))/3 ;
R :=(high(-16)+low(-16)+close(-16))/3 ;
S :=(high(-17)+low(-17)+close(-17))/3 ;
T :=(high(-18)+low(-18)+close(-18))/3 ;
U :=(high(-19)+low(-19)+close(-19))/3 ;
V :=(high(-20)+low(-20)+close(-20))/3 ;
W :=(high(-21)+low(-21)+close(-21))/3 ;
X :=(high(-22)+low(-22)+close(-22))/3 ;
Y :=(high(-23)+low(-23)+close(-23))/3 ;
Z :=(high(-24)+low(-24)+close(-24))/3 ;
ZZ :=(high(-25)+low(-25)+close(-25))/3 ;
aa :=(B+C+D+E+F+G+H+I+J+K+L+M+N)/13 ;
bb :=(C+D+E+F+G+H+I+J+K+L+M+N+O)/13 ;
cc :=(D+E+F+G+H+I+J+K+L+M+N+O+P)/13 ;
dd :=(E+F+G+H+I+J+K+L+M+N+O+P+Q)/13 ;
ee :=(F+G+H+I+J+K+L+M+N+O+P+Q+R)/13 ;
ff :=(G+H+I+J+K+L+M+N+O+P+Q+R+S)/13 ;
gg :=(H+I+J+K+L+M+N+O+P+Q+R+S+T)/13 ;
hh :=(I+J+K+L+M+N+O+P+Q+R+S+T+U)/13 ;
ii :=(J+K+L+M+N+O+P+Q+R+S+T+U+V)/13 ;
jj :=(K+L+M+N+O+P+Q+R+S+T+U+V+W)/13 ;
kk :=(L+M+N+O+P+Q+R+S+T+U+V+W+X)/13 ;
ll :=(M+N+O+P+Q+R+S+T+U+V+W+X+Y)/13 ;
mm :=(N+O+P+Q+R+S+T+U+V+W+X+Y+Z)/13 ;
nn :=(O+P+Q+R+S+T+U+V+W+X+Y+Z+ZZ)/13 ;

cci := (B-aa)/(0.015*(abs(B-aa)+abs(C-bb)+abs(D-cc)+abs(E-dd)+abs(F-ee)+abs(G-ff)+abs(H-gg)+abs(I-hh)+abs(J-ii)+abs(K-jj)+abs(L-kk)+abs(M-ll)+abs(N-mm))/13)+.001;
cciprev := (C-bb)/(0.015*(abs(C-bb)+abs(D-cc)+abs(E-dd)+abs(F-ee)+abs(G-ff)+abs(H-gg)+abs(I-hh)+abs(J-ii)+abs(K-jj)+abs(L-kk)+abs(M-ll)+abs(N-mm)+abs(O-nn))/13)+.001;

//if
//(B-R)/(0.015*(abs(B-R)+abs(C-S)+abs(D-T)+abs(E-U)+abs(F-V)+abs(G-W)+abs(H-X)+abs(I-Y)+abs(J-Ya)+abs(K-Yb)+abs(L-Yc)+abs(M-Yd)+abs(N-Ye))/13)<-100 then
//println symbol,", ",description,", ",close(0); endif;

if cci>-100 and cciprev<-100 then
Println Symbol, ": ", cci:8:2, ",", cciprev:8:2;
endif;