BullCharts Forum Homepage
Forum Home Forum Home > BullCharts > BullScript
  New Posts New Posts RSS Feed: Number of New Daily Highs indicator
  FAQ FAQ  Forum Search   Calendar   Register Register  Login Login

Number of New Daily Highs indicator

 Post Reply Post Reply Page  12>
Author
Message Reverse Sort Order / View First Unread Post
cudderbean View Drop Down
Regular
Regular
Avatar

Joined: 02 Oct 2006
Location: Thailand
Posts: 40
Post Options Post Options   Quote cudderbean Quote  Post ReplyReply Direct Link To This Post Topic: Number of New Daily Highs indicator
    Posted: 21 Feb 2013 at 11:30am
That is a neat addition, Maximo. Thank you.
I am playing with various divergence and extreme situations at the moment to be highlighted in a ribbon. Will report back.
Back to Top
maximo View Drop Down
BullCharts Guru
BullCharts Guru
Avatar

Joined: 02 Sep 2006
Location: Australia
Posts: 232
Post Options Post Options   Quote maximo Quote  Post ReplyReply Direct Link To This Post Posted: 20 Feb 2013 at 4:21pm

Good work CB,

Here's another idea.  It may save time having to lookup, which stocks have made the new High, by having the stock code appear on the indicator.

 
lbk :=input("Lookback Periods",249,5);
s1 := inputsymbol("Symbol #1", "BHP");
p1 := if(s1="",0,loadsymbol(s1,H));
h1 := hist(hhv(p1,lbk),1); f1 := (p1 > h1);
s2 := inputsymbol("Symbol #2", "CBA");
p2 := if(s2="",0,loadsymbol(s2,H));
h2 := hist(hhv(p2,lbk),1); f2 := (p2 > h2);
s3 := inputsymbol("Symbol #5", "WOW");
p3 := if(s3="",0,loadsymbol(s3,H));
h3 := hist(hhv(p3,lbk),1); f3 := (p3 > h3);
f1+f2+f3;

[linestyle=Text; textalign=Above,Center]
[color=Forest Green]
If(f1>0 and hist(barssince(f1),1)>1,"BHP", undefined); f1;
[color=Dodger Blue]
If(f2>0 and hist(barssince(f2),1)>1,"CBA", undefined); f1+f2;
[color=Magenta]
If(f3>0 and hist(barssince(f3),1)>1,"WOW", undefined); f1+f2+f3;

Back to Top
cudderbean View Drop Down
Regular
Regular
Avatar

Joined: 02 Oct 2006
Location: Thailand
Posts: 40
Post Options Post Options   Quote cudderbean Quote  Post ReplyReply Direct Link To This Post Posted: 12 Feb 2013 at 3:41pm

Thank you again, Maximo and Robert. I have left the 50 symbols in the index for individual tinkering. They will perhaps need to be changed as time goes by anyway.

 

I have included a lookback periods option to make it more versatile...and also runs faster on <249 days for testing.

 

I ran the indicator then grabbed the values “Copy Plot Data”...that’s why I love BC so much, so compatible with Excel...and looked at them in Excel. I examined  the average and the standard deviation of the “count” whenever the new highs were >0, and similarly when the new lows were <0

 

New highs average >0                       =          3.29

New highs ave+ 1*stdev >0   =          5.75 (quite high)

New highs ave + 2*stdev >0  =          8.21 (very high)

 

New lows average <0             =          -3.19

New lows ave - 1*stdev >0    =          -7.21 (quite low)

New lows ave - 2*stdev >0    =          -11.22 (very low)

 

Can someone more skilful than I please put a few more lines of code in so that the line indicator changes colour to dark green whenever it is > 5.75 and red whenever it is <-7.21.

 

I can already see some divergences, but maybe I’m just seeing things...sizzling hot in Perth today!

 

Hopefully others will add their two cents worth if they find something useful.

 

I’m just a novice coder, so as always errors, shortcuts, and neater coding suggestions most welcome.

 

Thank you for your help.

 

{Symbols in Index. All from 2013 XJO but were also trading in 2000 ...may need some tinkering but I don't think results will differ widely}

 

lbk :=input("Lookback Periods",249,5);

 

s1 := inputsymbol("Symbol #1", "abc");

s2 := inputsymbol("Symbol #2", "aix");

s3 := inputsymbol("Symbol #3", "bhp");

s4 := inputsymbol("Symbol #4", "all");

s5 := inputsymbol("Symbol #5", "alz");

s6 := inputsymbol("Symbol #6", "amc");

s7 := inputsymbol("Symbol #7", "amp");

s8 := inputsymbol("Symbol #8", "anz");

s9 := inputsymbol("Symbol #9", "apa");

s10 := inputsymbol("Symbol #10", "asx");

s11 := inputsymbol("Symbol #11", "ben");

s12 := inputsymbol("Symbol #12", "bld");

s13 := inputsymbol("Symbol #13", "cba");

s14 := inputsymbol("Symbol #14", "ccl");

s15 := inputsymbol("Symbol #15", "coh");

s16 := inputsymbol("Symbol #16", "cpa");

s17 := inputsymbol("Symbol #17", "cpu");

s18 := inputsymbol("Symbol #18", "csl");

s19 := inputsymbol("Symbol #19", "ctx");

s20 := inputsymbol("Symbol #20", "flt");

s21 := inputsymbol("Symbol #21", "gnc");

s22 := inputsymbol("Symbol #22", "gpt");

s23 := inputsymbol("Symbol #23", "hvn");

s24 := inputsymbol("Symbol #24", "ilu");

s25 := inputsymbol("Symbol #25", "lei");

s26 := inputsymbol("Symbol #26", "llc");

s27 := inputsymbol("Symbol #27", "mgr");

s28 := inputsymbol("Symbol #28", "mnd");

s29 := inputsymbol("Symbol #29", "nab");

s30 := inputsymbol("Symbol #30", "ncm");

s31 := inputsymbol("Symbol #31", "org");

s32 := inputsymbol("Symbol #32", "ori");

s33 := inputsymbol("Symbol #33", "osh");

s34 := inputsymbol("Symbol #34", "pna");

s35 := inputsymbol("Symbol #35", "pry");

s36 := inputsymbol("Symbol #36", "qan");

s37 := inputsymbol("Symbol #37", "qbe");

s38 := inputsymbol("Symbol #38", "rhc");

s39 := inputsymbol("Symbol #39", "rio");

s40 := inputsymbol("Symbol #40", "sgp");

s41 := inputsymbol("Symbol #41", "shl");

s42 := inputsymbol("Symbol #42", "sto");

s43 := inputsymbol("Symbol #43", "tah");

s44 := inputsymbol("Symbol #44", "tcl");

s45 := inputsymbol("Symbol #45", "tls");

s46 := inputsymbol("Symbol #46", "tol");

s47 := inputsymbol("Symbol #47", "wbc");

s48 := inputsymbol("Symbol #48", "wes");

s49 := inputsymbol("Symbol #49", "wow");

s50 := inputsymbol("Symbol #50", "wpl");

 

{New Highs}

 

p1 := if(s1="",0,loadsymbol(s1,H));

h1 := hist(hhv(p1,lbk),1); u1 := (p1 > h1);

p2 := if(s2="",0,loadsymbol(s2,H));

h2 := hist(hhv(p2,lbk),1); u2 := (p2 > h2);

p3 := if(s3="",0,loadsymbol(s3,H));

h3 := hist(hhv(p3,lbk),1); u3 := (p3 > h3);

p4 := if(s4="",0,loadsymbol(s4,H));

h4 := hist(hhv(p4,lbk),1); u4 := (p4 > h4);

p5 := if(s5="",0,loadsymbol(s5,H));

h5 := hist(hhv(p5,lbk),1); u5 := (p5 > h5);

p6 := if(s6="",0,loadsymbol(s6,H));

h6 := hist(hhv(p6,lbk),1); u6 := (p6 > h6);

p7 := if(s7="",0,loadsymbol(s7,H));

h7 := hist(hhv(p7,lbk),1); u7 := (p7 > h7);

p8 := if(s8="",0,loadsymbol(s8,H));

h8 := hist(hhv(p8,lbk),1); u8 := (p8 > h8);

p9 := if(s9="",0,loadsymbol(s9,H));

h9 := hist(hhv(p9,lbk),1); u9 := (p9 > h9);

p10 := if(s10="",0,loadsymbol(s10,H));

h10 := hist(hhv(p10,lbk),1); u10 := (p10 > h10);

p11 := if(s11="",0,loadsymbol(s11,H));

h11 := hist(hhv(p11,lbk),1); u11 := (p11 > h11);

p12 := if(s12="",0,loadsymbol(s12,H));

h12 := hist(hhv(p12,lbk),1); u12 := (p12 > h12);

p13 := if(s13="",0,loadsymbol(s13,H));

h13 := hist(hhv(p13,lbk),1); u13 := (p13 > h13);

p14 := if(s14="",0,loadsymbol(s14,H));

h14 := hist(hhv(p14,lbk),1); u14 := (p14 > h14);

p15 := if(s15="",0,loadsymbol(s15,H));

h15 := hist(hhv(p15,lbk),1); u15 := (p15 > h15);

p16 := if(s16="",0,loadsymbol(s16,H));

h16 := hist(hhv(p16,lbk),1); u16 := (p16 > h16);

p17 := if(s17="",0,loadsymbol(s17,H));

h17 := hist(hhv(p17,lbk),1); u17 := (p17 > h17);

p18 := if(s18="",0,loadsymbol(s18,H));

h18 := hist(hhv(p18,lbk),1); u18 := (p18 > h18);

p19 := if(s19="",0,loadsymbol(s19,H));

h19 := hist(hhv(p19,lbk),1); u19 := (p19 > h19);

p20 := if(s20="",0,loadsymbol(s20,H));

h20 := hist(hhv(p20,lbk),1); u20 := (p20 > h20);

p21 := if(s21="",0,loadsymbol(s21,H));

h21 := hist(hhv(p21,lbk),1); u21 := (p21 > h21);

p22 := if(s22="",0,loadsymbol(s22,H));

h22 := hist(hhv(p22,lbk),1); u22 := (p22 > h22);

p23 := if(s23="",0,loadsymbol(s23,H));

h23 := hist(hhv(p23,lbk),1); u23 := (p23 > h23);

p24 := if(s24="",0,loadsymbol(s24,H));

h24 := hist(hhv(p24,lbk),1); u24 := (p24 > h24);

p25 := if(s25="",0,loadsymbol(s25,H));

h25 := hist(hhv(p25,lbk),1); u25 := (p25 > h25);

p26 := if(s26="",0,loadsymbol(s26,H));

h26 := hist(hhv(p26,lbk),1); u26 := (p26 > h26);

p27 := if(s27="",0,loadsymbol(s27,H));

h27 := hist(hhv(p27,lbk),1); u27 := (p27 > h27);

p28 := if(s28="",0,loadsymbol(s28,H));

h28 := hist(hhv(p28,lbk),1); u28 := (p28 > h28);

p29 := if(s29="",0,loadsymbol(s29,H));

h29 := hist(hhv(p29,lbk),1); u29 := (p29 > h29);

p30 := if(s30="",0,loadsymbol(s30,H));

h30 := hist(hhv(p30,lbk),1); u30 := (p30 > h30);

p31 := if(s31="",0,loadsymbol(s31,H));

h31 := hist(hhv(p31,lbk),1); u31 := (p31 > h31);

p32 := if(s32="",0,loadsymbol(s32,H));

h32 := hist(hhv(p32,lbk),1); u32 := (p32 > h32);

p33 := if(s33="",0,loadsymbol(s33,H));

h33 := hist(hhv(p33,lbk),1); u33 := (p33 > h33);

p34 := if(s34="",0,loadsymbol(s34,H));

h34 := hist(hhv(p34,lbk),1); u34 := (p34 > h34);

p35 := if(s35="",0,loadsymbol(s35,H));

h35 := hist(hhv(p35,lbk),1); u35 := (p35 > h35);

p36 := if(s36="",0,loadsymbol(s36,H));

h36 := hist(hhv(p36,lbk),1); u36 := (p36 > h36);

p37 := if(s37="",0,loadsymbol(s37,H));

h37 := hist(hhv(p37,lbk),1); u37 := (p37 > h37);

p38 := if(s38="",0,loadsymbol(s38,H));

h38 := hist(hhv(p38,lbk),1); u38 := (p38 > h38);

p39 := if(s39="",0,loadsymbol(s39,H));

h39 := hist(hhv(p39,lbk),1); u39 := (p39 > h39);

p40 := if(s40="",0,loadsymbol(s40,H));

h40 := hist(hhv(p40,lbk),1); u40 := (p40 > h40);

p41 := if(s41="",0,loadsymbol(s41,H));

h41 := hist(hhv(p41,lbk),1); u41 := (p41 > h41);

p42 := if(s42="",0,loadsymbol(s42,H));

h42 := hist(hhv(p42,lbk),1); u42 := (p42 > h42);

p43 := if(s43="",0,loadsymbol(s43,H));

h43 := hist(hhv(p43,lbk),1); u43 := (p43 > h43);

p44 := if(s44="",0,loadsymbol(s44,H));

h44 := hist(hhv(p44,lbk),1); u44 := (p44 > h44);

p45 := if(s45="",0,loadsymbol(s45,H));

h45 := hist(hhv(p45,lbk),1); u45 := (p45 > h45);

p46 := if(s46="",0,loadsymbol(s46,H));

h46 := hist(hhv(p46,lbk),1); u46 := (p46 > h46);

p47 := if(s47="",0,loadsymbol(s47,H));

h47 := hist(hhv(p47,lbk),1); u47 := (p47 > h47);

p48 := if(s48="",0,loadsymbol(s48,H));

h48 := hist(hhv(p48,lbk),1); u48 := (p48 > h48);

p49 := if(s49="",0,loadsymbol(s49,H));

h49 := hist(hhv(p49,lbk),1); u49 := (p49 > h49);

p50 := if(s50="",0,loadsymbol(s50,H));

h50 := hist(hhv(p50,lbk),1); u50 := (p50 > h50);

 

newhi :=u1+u2+u3+u4+u5+u6+u7+u8+u9+u10+u11+u12+u13+u14+u15+u16+u17+u18+u19+u20+u21+u22+u23+u24+u25+u26+u27+u28+u29+u30+u31+u32+u33+u34+u35+u36+u37+u38+u39+u40+u41+u42+u43+u44+u45+u46+u47+u48+u49+u50;

 

{New Lows}

 

q1 := if(s1="",0,loadsymbol(s1,L));

L1 := hist(llv(q1,lbk),1); d1 := (q1 < L1);

q2 := if(s2="",0,loadsymbol(s2,L));

L2 := hist(llv(q2,lbk),1); d2 := (q2 < L2);

q3 := if(s3="",0,loadsymbol(s3,L));

L3 := hist(llv(q3,lbk),1); d3 := (q3 < L3);

q4 := if(s4="",0,loadsymbol(s4,L));

L4 := hist(llv(q4,lbk),1); d4 := (q4 < L4);

q5 := if(s5="",0,loadsymbol(s5,L));

L5 := hist(llv(q5,lbk),1); d5 := (q5 < L5);

q6 := if(s6="",0,loadsymbol(s6,L));

L6 := hist(llv(q6,lbk),1); d6 := (q6 < L6);

q7 := if(s7="",0,loadsymbol(s7,L));

L7 := hist(llv(q7,lbk),1); d7 := (q7 < L7);

q8 := if(s8="",0,loadsymbol(s8,L));

L8 := hist(llv(q8,lbk),1); d8 := (q8 < L8);

q9 := if(s9="",0,loadsymbol(s9,L));

L9 := hist(llv(q9,lbk),1); d9 := (q9 < L9);

q10 := if(s10="",0,loadsymbol(s10,L));

L10 := hist(llv(q10,lbk),1); d10 := (q10 < L10);

q11 := if(s11="",0,loadsymbol(s11,L));

L11 := hist(llv(q11,lbk),1); d11 := (q11 < L11);

q12 := if(s12="",0,loadsymbol(s12,L));

L12 := hist(llv(q12,lbk),1); d12 := (q12 < L12);

q13 := if(s13="",0,loadsymbol(s13,L));

L13 := hist(llv(q13,lbk),1); d13 := (q13 < L13);

q14 := if(s14="",0,loadsymbol(s14,L));

L14 := hist(llv(q14,lbk),1); d14 := (q14 < L14);

q15 := if(s15="",0,loadsymbol(s15,L));

L15 := hist(llv(q15,lbk),1); d15 := (q15 < L15);

q16 := if(s16="",0,loadsymbol(s16,L));

L16 := hist(llv(q16,lbk),1); d16 := (q16 < L16);

q17 := if(s17="",0,loadsymbol(s17,L));

L17 := hist(llv(q17,lbk),1); d17 := (q17 < L17);

q18 := if(s18="",0,loadsymbol(s18,L));

L18 := hist(llv(q18,lbk),1); d18 := (q18 < L18);

q19 := if(s19="",0,loadsymbol(s19,L));

L19 := hist(llv(q19,lbk),1); d19 := (q19 < L19);

q20 := if(s20="",0,loadsymbol(s20,L));

L20 := hist(llv(q20,lbk),1); d20 := (q20 < L20);

q21 := if(s21="",0,loadsymbol(s21,L));

L21 := hist(llv(q21,lbk),1); d21 := (q21 < L21);

q22 := if(s22="",0,loadsymbol(s22,L));

L22 := hist(llv(q22,lbk),1); d22 := (q22 < L22);

q23 := if(s23="",0,loadsymbol(s23,L));

L23 := hist(llv(q23,lbk),1); d23 := (q23 < L23);

q24 := if(s24="",0,loadsymbol(s24,L));

L24 := hist(llv(q24,lbk),1); d24 := (q24 < L24);

q25 := if(s25="",0,loadsymbol(s25,L));

L25 := hist(llv(q25,lbk),1); d25 := (q25 < L25);

q26 := if(s26="",0,loadsymbol(s26,L));

L26 := hist(llv(q26,lbk),1); d26 := (q26 < L26);

q27 := if(s27="",0,loadsymbol(s27,L));

L27 := hist(llv(q27,lbk),1); d27 := (q27 < L27);

q28 := if(s28="",0,loadsymbol(s28,L));

L28 := hist(llv(q28,lbk),1); d28 := (q28 < L28);

q29 := if(s29="",0,loadsymbol(s29,L));

L29 := hist(llv(q29,lbk),1); d29 := (q29 < L29);

q30 := if(s30="",0,loadsymbol(s30,L));

L30 := hist(llv(q30,lbk),1); d30 := (q30 < L30);

q31 := if(s31="",0,loadsymbol(s31,L));

L31 := hist(llv(q31,lbk),1); d31 := (q31 < L31);

q32 := if(s32="",0,loadsymbol(s32,L));

L32 := hist(llv(q32,lbk),1); d32 := (q32 < L32);

q33 := if(s33="",0,loadsymbol(s33,L));

L33 := hist(llv(q33,lbk),1); d33 := (q33 < L33);

q34 := if(s34="",0,loadsymbol(s34,L));

L34 := hist(llv(q34,lbk),1); d34 := (q34 < L34);

q35 := if(s35="",0,loadsymbol(s35,L));

L35 := hist(llv(q35,lbk),1); d35 := (q35 < L35);

q36 := if(s36="",0,loadsymbol(s36,L));

L36 := hist(llv(q36,lbk),1); d36 := (q36 < L36);

q37 := if(s37="",0,loadsymbol(s37,L));

L37 := hist(llv(q37,lbk),1); d37 := (q37 < L37);

q38 := if(s38="",0,loadsymbol(s38,L));

L38 := hist(llv(q38,lbk),1); d38 := (q38 < L38);

q39 := if(s39="",0,loadsymbol(s39,L));

L39 := hist(llv(q39,lbk),1); d39 := (q39 < L39);

q40 := if(s40="",0,loadsymbol(s40,L));

L40 := hist(llv(q40,lbk),1); d40 := (q40 < L40);

q41 := if(s41="",0,loadsymbol(s41,L));

L41 := hist(llv(q41,lbk),1); d41 := (q41 < L41);

q42 := if(s42="",0,loadsymbol(s42,L));

L42 := hist(llv(q42,lbk),1); d42 := (q42 < L42);

q43 := if(s43="",0,loadsymbol(s43,L));

L43 := hist(llv(q43,lbk),1); d43 := (q43 < L43);

q44 := if(s44="",0,loadsymbol(s44,L));

L44 := hist(llv(q44,lbk),1); d44 := (q44 < L44);

q45 := if(s45="",0,loadsymbol(s45,L));

L45 := hist(llv(q45,lbk),1); d45 := (q45 < L45);

q46 := if(s46="",0,loadsymbol(s46,L));

L46 := hist(llv(q46,lbk),1); d46 := (q46 < L46);

q47 := if(s47="",0,loadsymbol(s47,L));

L47 := hist(llv(q47,lbk),1); d47 := (q47 < L47);

q48 := if(s48="",0,loadsymbol(s48,L));

L48 := hist(llv(q48,lbk),1); d48 := (q48 < L48);

q49 := if(s49="",0,loadsymbol(s49,L));

L49 := hist(llv(q49,lbk),1); d49 := (q49 < L49);

q50 := if(s50="",0,loadsymbol(s50,L));

L50 := hist(llv(q50,lbk),1); d50 := (q50 < L50);

 

newlo:=d1+d2+d3+d4+d5+d6+d7+d8+d9+d10+d11+d12+d13+d14+d15+d16+d17+d18+d19+d20+d21+d22+d23+d24+d25+d26+d27+d28+d29+d30+d31+d32+d33+d34+d35+d36+d37+d38+d39+d40+d41+d42+d43+d44+d45+d46+d47+d48+d49+d50;

 

[horzline=0;color=black]

[linestyle =solid;color=blue]

 

newhi-newlo;

Back to Top
rbbrain View Drop Down
BullCharts Staff
BullCharts Staff
Avatar

Joined: 22 Jul 2006
Location: Melbourne
Posts: 169
Post Options Post Options   Quote rbbrain Quote  Post ReplyReply Direct Link To This Post Posted: 11 Feb 2013 at 2:04pm
Hi folks,

Regarding index rebalancing, we can now see the news from S&P here:
http://www.standardandpoors.com/indices/index-announcements/en/us/?numDaysVal=archived&category=Equity&index=sp-asx-200&type=All
(There was a time where they put this stuff behind a pay-wall, but it is now freely available again).

Also, one minor point regarding selection of stocks for participation in an index. Don't forget that it is not only based on market cap. There are other "rules" that qualify some stocks to be listed in an index, and which disqualify others. The ASX web site offers this information here:
http://www.asx.com.au/products/capitalisation-indices.htm

(For my Share Market Toolbox members, these links are included within the Share Market information pages, and I frequently remind my members the details are there.)

Cheers

Robert B
Robert Brain (Brainy)
Convenor - Australian BullCharts User Group
Brainy's Share Market Toolbox and BullCharts Tips
[/CENTER
Back to Top
maximo View Drop Down
BullCharts Guru
BullCharts Guru
Avatar

Joined: 02 Sep 2006
Location: Australia
Posts: 232
Post Options Post Options   Quote maximo Quote  Post ReplyReply Direct Link To This Post Posted: 11 Feb 2013 at 12:18pm
I created a turnover indicator a while back and it's useful to visualize candidates.
 
There is a stability factor which ensures the turnover is stable for 100 days.   Those settings will catch stocks just entering or leaving the ASX200 without issues.
 
Red = no pass, Amber = pass but not yet 100 days, Green = pass.
 
{ Turnover > $1m every day for the last 100 days }
volsize := input("Volume",1000000,100);
period:= input("Average period",50,1);
VX:=ma(Close*Volume,period,S);
TO:=If(VX < volsize or barnumber=1,1,0);
{[linestyle=solid; color=blue]
VX;}
[linestyle=Grounded Bar; width=2]
[Color=red]
If(VX < volsize,V,undefined);
[Color=coral]
If(VX >= volsize and barssince(TO) < 100,V,undefined);
[Color=lime green]
If(VX >= volsize and barssince(TO) >= 100,V,undefined);


Edited by maximo - 11 Feb 2013 at 12:52pm
Back to Top
cudderbean View Drop Down
Regular
Regular
Avatar

Joined: 02 Oct 2006
Location: Thailand
Posts: 40
Post Options Post Options   Quote cudderbean Quote  Post ReplyReply Direct Link To This Post Posted: 11 Feb 2013 at 9:51am
Thanks for your suggestion, Maximo.
 
Maybe I'll fiddle a little more. There were 82 companies out of today's XJO that were actually trading 12 years ago too. Maybe I should use your liquidity criteria to find the best candidates that suit those criteria both then and now.
Back to Top
maximo View Drop Down
BullCharts Guru
BullCharts Guru
Avatar

Joined: 02 Sep 2006
Location: Australia
Posts: 232
Post Options Post Options   Quote maximo Quote  Post ReplyReply Direct Link To This Post Posted: 11 Feb 2013 at 1:06am

Good job CB,

They add and subtract stocks from the indices every 3 months.  If you are wanting reliable testing from an index then it gets more difficult the further back in history you go.    I used to be able to get new index announcements and archives of changes from http://www.standardandpoors.com/home/en/au   The info may still be there.  Some info requires a free registration.

Survivorship bias and look-ahead bias can definitely complicate the testing process of indices.
 
I think the top 50 which you have selected is good.   Results should be statistically sound considering fewer changes to the smaller index and them having more weight carried by those 50.
 
If you want to eliminate those index bias issues and looking up the index changes then don't use an index.
Use liquidity as the selection filter, such as:  ma(V * C, 50, S) > 500000 
Liquidity/$Turnover is how they get into the indices anyhow.   If they aren't doing a good turnover then Standard's & Poors wont have them in the index.  That's mostly their rating system.   You can check this for yourself by verifying the stocks with the highest turnover being in the smallest numbered index, so ASX20 has the most liquid.
 


Edited by maximo - 11 Feb 2013 at 1:37am
Back to Top
cudderbean View Drop Down
Regular
Regular
Avatar

Joined: 02 Oct 2006
Location: Thailand
Posts: 40
Post Options Post Options   Quote cudderbean Quote  Post ReplyReply Direct Link To This Post Posted: 10 Feb 2013 at 7:14pm

I have completed the new highs indicator for the ASX20 and ASX50 following Maximo’s template.

The problem is what BC includes in its ASX50 and what the ASX itself says composes its top 50 are different.  Which one should I go with? The ASX site itself http://www.asx.com.au/asx/widget/topCompanies.do looks to be more up to date.

Then I got to thinking...of course these index compositions change over time. Some codes weren’t even trading 12 years ago.

Should I create an ASX Longevity 50 index?

So what I have done is take the top 50 today from all the codes in today’s XJO that were also trading  on July 1st 2000. Am I skewing things statistically or am I actually doing something more statistically valid in that I am looking at the exact same companies today as were in the index 12 years ago?

Slow loading, but that doesn’t matter, my computer never complains. Is it worthwhile or possible even to go to an index of 100 or 200? More valid statistically?

Before I do a similar indicator for the new lows and NH-NL , any comments, errors, suggestions eg. MA smoothing   would be most welcome.

Thank you.
 
s1 := inputsymbol("Symbol #1", "abc");
p1 := if(s1="",0,loadsymbol(s1,H));
h1 := hist(hhv(p1,249),1); f1 := (p1 > h1);
s2 := inputsymbol("Symbol #2", "aix");
p2 := if(s2="",0,loadsymbol(s2,H));
h2 := hist(hhv(p2,249),1); f2 := (p2 > h2);
s3 := inputsymbol("Symbol #3", "bhp");
p3 := if(s3="",0,loadsymbol(s3,H));
h3 := hist(hhv(p3,249),1); f3 := (p3 > h3);
s4 := inputsymbol("Symbol #4", "all");
p4 := if(s4="",0,loadsymbol(s4,H));
h4 := hist(hhv(p4,249),1); f4 := (p4 > h4);
s5 := inputsymbol("Symbol #5", "alz");
p5 := if(s5="",0,loadsymbol(s5,H));
h5 := hist(hhv(p5,249),1); f5 := (p5 > h5);
s6 := inputsymbol("Symbol #6", "amc");
p6 := if(s6="",0,loadsymbol(s6,H));
h6 := hist(hhv(p6,249),1); f6 := (p6 > h6);
s7 := inputsymbol("Symbol #7", "amp");
p7 := if(s7="",0,loadsymbol(s7,H));
h7 := hist(hhv(p7,249),1); f7 := (p7 > h7);
s8 := inputsymbol("Symbol #8", "anz");
p8 := if(s8="",0,loadsymbol(s8,H));
h8 := hist(hhv(p8,249),1); f8 := (p8 > h8);
s9 := inputsymbol("Symbol #9", "apa");
p9 := if(s9="",0,loadsymbol(s9,H));
h9 := hist(hhv(p9,249),1); f9 := (p9 > h9);
s10 := inputsymbol("Symbol #10", "asx");
p10 := if(s10="",0,loadsymbol(s10,H));
h10 := hist(hhv(p10,249),1); f10 := (p10 > h10);
s11 := inputsymbol("Symbol #11", "ben");
p11 := if(s11="",0,loadsymbol(s11,H));
h11 := hist(hhv(p11,249),1); f11 := (p11 > h11);
s12 := inputsymbol("Symbol #12", "bld");
p12 := if(s12="",0,loadsymbol(s12,H));
h12 := hist(hhv(p12,249),1); f12 := (p12 > h12);
s13 := inputsymbol("Symbol #13", "cba");
p13 := if(s13="",0,loadsymbol(s13,H));
h13 := hist(hhv(p13,249),1); f13 := (p13 > h13);
s14 := inputsymbol("Symbol #14", "ccl");
p14 := if(s14="",0,loadsymbol(s14,H));
h14 := hist(hhv(p14,249),1); f14 := (p14 > h14);
s15 := inputsymbol("Symbol #15", "coh");
p15 := if(s15="",0,loadsymbol(s15,H));
h15 := hist(hhv(p15,249),1); f15 := (p15 > h15);
s16 := inputsymbol("Symbol #16", "cpa");
p16 := if(s16="",0,loadsymbol(s16,H));
h16 := hist(hhv(p16,249),1); f16 := (p16 > h16);
s17 := inputsymbol("Symbol #17", "cpu");
p17 := if(s17="",0,loadsymbol(s17,H));
h17 := hist(hhv(p17,249),1); f17 := (p17 > h17);
s18 := inputsymbol("Symbol #18", "csl");
p18 := if(s18="",0,loadsymbol(s18,H));
h18 := hist(hhv(p18,249),1); f18 := (p18 > h18);
s19 := inputsymbol("Symbol #19", "ctx");
p19 := if(s19="",0,loadsymbol(s19,H));
h19 := hist(hhv(p19,249),1); f19 := (p19 > h19);
s20 := inputsymbol("Symbol #20", "flt");
p20 := if(s20="",0,loadsymbol(s20,H));
h20 := hist(hhv(p20,249),1); f20 := (p20 > h20);
s21 := inputsymbol("Symbol #21", "gnc");
p21 := if(s21="",0,loadsymbol(s21,H));
h21 := hist(hhv(p21,249),1); f21 := (p21 > h21);
s22 := inputsymbol("Symbol #22", "gpt");
p22 := if(s22="",0,loadsymbol(s22,H));
h22 := hist(hhv(p22,249),1); f22 := (p22 > h22);
s23 := inputsymbol("Symbol #23", "hvn");
p23 := if(s23="",0,loadsymbol(s23,H));
h23 := hist(hhv(p23,249),1); f23 := (p23 > h23);
s24 := inputsymbol("Symbol #24", "ilu");
p24 := if(s24="",0,loadsymbol(s24,H));
h24 := hist(hhv(p24,249),1); f24 := (p24 > h24);
s25 := inputsymbol("Symbol #25", "lei");
p25 := if(s25="",0,loadsymbol(s25,H));
h25 := hist(hhv(p25,249),1); f25 := (p25 > h25);
s26 := inputsymbol("Symbol #26", "llc");
p26 := if(s26="",0,loadsymbol(s26,H));
h26 := hist(hhv(p26,249),1); f26 := (p26 > h26);
s27 := inputsymbol("Symbol #27", "mgr");
p27 := if(s27="",0,loadsymbol(s27,H));
h27 := hist(hhv(p27,249),1); f27 := (p27 > h27);
s28 := inputsymbol("Symbol #28", "mnd");
p28 := if(s28="",0,loadsymbol(s28,H));
h28 := hist(hhv(p28,249),1); f28 := (p28 > h28);
s29 := inputsymbol("Symbol #29", "nab");
p29 := if(s29="",0,loadsymbol(s29,H));
h29 := hist(hhv(p29,249),1); f29 := (p29 > h29);
s30 := inputsymbol("Symbol #30", "ncm");
p30 := if(s30="",0,loadsymbol(s30,H));
h30 := hist(hhv(p30,249),1); f30 := (p30 > h30);
s31 := inputsymbol("Symbol #31", "org");
p31 := if(s31="",0,loadsymbol(s31,H));
h31 := hist(hhv(p31,249),1); f31 := (p31 > h31);
s32 := inputsymbol("Symbol #32", "ori");
p32 := if(s32="",0,loadsymbol(s32,H));
h32 := hist(hhv(p32,249),1); f32 := (p32 > h32);
s33 := inputsymbol("Symbol #33", "osh");
p33 := if(s33="",0,loadsymbol(s33,H));
h33 := hist(hhv(p33,249),1); f33 := (p33 > h33);
s34 := inputsymbol("Symbol #34", "pna");
p34 := if(s34="",0,loadsymbol(s34,H));
h34 := hist(hhv(p34,249),1); f34 := (p34 > h34);
s35 := inputsymbol("Symbol #35", "pry");
p35 := if(s35="",0,loadsymbol(s35,H));
h35 := hist(hhv(p35,249),1); f35 := (p35 > h35);
s36 := inputsymbol("Symbol #36", "qan");
p36 := if(s36="",0,loadsymbol(s36,H));
h36 := hist(hhv(p36,249),1); f36 := (p36 > h36);
s37 := inputsymbol("Symbol #37", "qbe");
p37 := if(s37="",0,loadsymbol(s37,H));
h37 := hist(hhv(p37,249),1); f37 := (p37 > h37);
s38 := inputsymbol("Symbol #38", "rhc");
p38 := if(s38="",0,loadsymbol(s38,H));
h38 := hist(hhv(p38,249),1); f38 := (p38 > h38);
s39 := inputsymbol("Symbol #39", "rio");
p39 := if(s39="",0,loadsymbol(s39,H));
h39 := hist(hhv(p39,249),1); f39 := (p39 > h39);
s40 := inputsymbol("Symbol #40", "sgp");
p40 := if(s40="",0,loadsymbol(s40,H));
h40 := hist(hhv(p40,249),1); f40 := (p40 > h40);
s41 := inputsymbol("Symbol #41", "shl");
p41 := if(s41="",0,loadsymbol(s41,H));
h41 := hist(hhv(p41,249),1); f41 := (p41 > h41);
s42 := inputsymbol("Symbol #42", "sto");
p42 := if(s42="",0,loadsymbol(s42,H));
h42 := hist(hhv(p42,249),1); f42 := (p42 > h42);
s43 := inputsymbol("Symbol #43", "tah");
p43 := if(s43="",0,loadsymbol(s43,H));
h43 := hist(hhv(p43,249),1); f43 := (p43 > h43);
s44 := inputsymbol("Symbol #44", "tcl");
p44 := if(s44="",0,loadsymbol(s44,H));
h44 := hist(hhv(p44,249),1); f44 := (p44 > h44);
s45 := inputsymbol("Symbol #45", "tls");
p45 := if(s45="",0,loadsymbol(s45,H));
h45 := hist(hhv(p45,249),1); f45 := (p45 > h45);
s46 := inputsymbol("Symbol #46", "tol");
p46 := if(s46="",0,loadsymbol(s46,H));
h46 := hist(hhv(p46,249),1); f46 := (p46 > h46);
s47 := inputsymbol("Symbol #47", "wbc");
p47 := if(s47="",0,loadsymbol(s47,H));
h47 := hist(hhv(p47,249),1); f47 := (p47 > h47);
s48 := inputsymbol("Symbol #48", "wes");
p48 := if(s48="",0,loadsymbol(s48,H));
h48 := hist(hhv(p48,249),1); f48 := (p48 > h48);
s49 := inputsymbol("Symbol #49", "wow");
p49 := if(s49="",0,loadsymbol(s49,H));
h49 := hist(hhv(p49,249),1); f49 := (p49 > h49);
s50 := inputsymbol("Symbol #50", "wpl");
p50 := if(s50="",0,loadsymbol(s50,H));
h50 := hist(hhv(p50,249),1); f50 := (p50 > h50);
 
f1+f2+f3+f4+f5+f6+f7+f8+f9+f10+f11+f12+f13+f14+f15+f16+f17+f18+f19+f20+f21+f22+f23+f24+f25+f26+f27+f28+f29+f30+f31 +f32+f33+f34+f35+f36+f37+f38+f39+f40+f41+f42+f43+f44+f45+ f46+f47+f48+f49+f50;
Back to Top
cudderbean View Drop Down
Regular
Regular
Avatar

Joined: 02 Oct 2006
Location: Thailand
Posts: 40
Post Options Post Options   Quote cudderbean Quote  Post ReplyReply Direct Link To This Post Posted: 10 Feb 2013 at 11:57am
Thank you so much, Maximo.
 
I will post the ASX20 and ASX50 for new highs when I've done it and new lows also. If not too slow I will go onto the ASX 200. Maybe there'll be a useful indicator in there somewhere to confirm or tell us something slightly different about RSI spikes and divergences.
 
If it's any good, we could maybe ask Brendon to include a faster version in future versions of BC.
 
I can do some of this stuff in XL. But the beauty of Bullcharts is that you can try out your theories so much more quickly in BC. And of course if it's programmable in BC, then its just one small step further to test it in Tradesim.
 
Thank you so kindly once more, Maximo. Thumbs Up ... Shift+R improves the quality of this image. CTRL+F5 reloads the whole page.
 
Back to Top
maximo View Drop Down
BullCharts Guru
BullCharts Guru
Avatar

Joined: 02 Sep 2006
Location: Australia
Posts: 232
Post Options Post Options   Quote maximo Quote  Post ReplyReply Direct Link To This Post Posted: 09 Feb 2013 at 11:46pm
I got this to work, though it currently only includes 3 stocks you can add as many symbols as you wish to create an index of new highs. 
 
It sums the new highs of included symbols and shows them as an indicator line chart.
 

s1 := inputsymbol("Symbol #1", "BHP");

p1 := if(s1="",0,loadsymbol(s1,H));

h1 := hist(hhv(p1,249),1); f1 := (p1 > h1);

s2 := inputsymbol("Symbol #2", "CBA");

p2 := if(s2="",0,loadsymbol(s2,H));

h2 := hist(hhv(p2,249),1); f2 := (p2 > h2);

s3 := inputsymbol("Symbol #3", "WOW");

p3 := if(s3="",0,loadsymbol(s3,H));

h3 := hist(hhv(p3,249),1); f3 := (p3 > h3);

f1+f2+f3;

  


Edited by maximo - 09 Feb 2013 at 11:53pm
Back to Top
 Post Reply Post Reply Page  12>

Forum Jump Forum Permissions View Drop Down

Bulletin Board Software by Web Wiz Forums® version 9.69
Copyright ©2001-2010 Web Wiz