BullCharts Forum Homepage
Forum Home Forum Home > BullCharts > BullScript
  New Posts New Posts RSS Feed: Adding a moving average to existing indicator
  FAQ FAQ  Forum Search   Calendar   Register Register  Login Login

Adding a moving average to existing indicator

 Post Reply Post Reply Page  123 5>
Author
Message / View First Unread Post
meldeans View Drop Down
Newbie
Newbie


Joined: 13 Feb 2009
Posts: 8
Post Options Post Options   Quote meldeans Quote  Post ReplyReply Direct Link To This Post Topic: Adding a moving average to existing indicator
    Posted: 13 Feb 2009 at 4:39pm
Hi,
 
I want to be able to put a 30 period moving average onto the Relative Strength Comparison Normalised (RSCN) indicator to see when the RSCN starts to show consistent outperformance via some smoothing.  Is this possible?
 
I am very new to Bullscript and am trying to work out how to do it but am getting very confused with the notes.
 
thanks
Dean
Back to Top
brentjedi View Drop Down
Regular
Regular
Avatar

Joined: 13 Dec 2007
Posts: 34
Post Options Post Options   Quote brentjedi Quote  Post ReplyReply Direct Link To This Post Posted: 13 Feb 2009 at 7:42pm
ma(RSI,30,S)
Trading is art of self
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: 14 Feb 2009 at 4:34pm
Originally posted by meldeans

 
I want to be able to put a 30 period moving average onto the Relative Strength Comparison Normalised (RSCN) indicator to see when the RSCN starts to show consistent outperformance via some smoothing.  Is this possible?
 
 
Good choice of Indicators meldeans.  This is one I coded with those options.
 
 

{ RSC - Relative Strength Comparison }

select:=input("Type: RSC=0, ROC=1",0,0,1);

smooth:=input("Normal=0, Smoothed=1",0,0,1);

method := inputma("Method",E);

period:= input("Period",30,1);

symb := inputsymbol("Compare to", "XJO");

index:=LoadSymbol(symb,C);

ROCD:=ROC(C,period,%) - ROC(index,period,%);

[color=rgb(249,207,31); width=2] { gold }

If(select=1 and smooth=0,ROCD,if(select=1,ma(ROCD,3,S),undefined));

[color=lime green; width=2]

RSCD:=(( C/index - Ma(C/index,period,method)) / Ma(C/index,period,method))*100;

If(select=0 and smooth=0,RSCD,if(select=0,ma(RSCD,3,S),undefined));

[color=black; linestyle=solid; width=1]

0;



Edited by maximo - 14 Feb 2009 at 4:35pm
Back to Top
meldeans View Drop Down
Newbie
Newbie


Joined: 13 Feb 2009
Posts: 8
Post Options Post Options   Quote meldeans Quote  Post ReplyReply Direct Link To This Post Posted: 15 Feb 2009 at 11:41am
Thanks Brentjedi and Maximo for the replies.  Unfortunately, neither work as required.  I am currently doing the calcs manually on stocks that interest me and this sucks!! :)
Maximo - my level of understanding is nowhere near high enough to understand what your formula means but its values calculated are more of a ROC calc than a MA of RSCN when I copied it to indicator builder page.
 
The indicator builder accepts the simple ma("RSCN",30,e) which is what I had come up with but when you select it as an indicator it comes up with loads of errors which mean nothing to me.
 
Are you able to help further?
 
thanks
Dean
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: 15 Feb 2009 at 12:08pm
Yes I think that's the reason I created my own indicator because of those errors.  This indicator doesn't produce errors it produces results using one of the methods selected.
  Selection 0 (default) makes a comparison using a 30 period MA (default), Select 1  for the other method using Rate Of Change.   I have found both methods  to be effective,
though there's not a huge difference if you compare them visually. The first method is like RSI except it's comparing another symbol instead of itself. The second method using
 ROC is similar in that they both operate by calculating a percent of price change over the set period value.  Because these compare using percentages they are both what I'd
 call Universal Relative Strength Comparisons and are suitable for ranking the entire market or sector indices.  
  Anyway doing a scan will find the strongest performing stocks versus the index or anything else you want to compare them with.
 
Cheers! 
 


Edited by maximo - 15 Feb 2009 at 3:56pm
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: 15 Feb 2009 at 5:31pm
Here's what I mean by a Universal comparison. This is the indicator I created to rank the sector indices. The RSC that came with BullCharts won't do this.
 

[description="Universal Relative Strength Comparison, Max"]

symb := inputsymbol("ASX 300", "XKO");

period:= input("average period",144,1);

sec1 := inputsymbol("Energy", "XEJ");

sec2 := inputsymbol("Materials", "XMJ");

sec3 := inputsymbol("Industrials", "XNJ");

sec4 := inputsymbol("Consumer Discretionary", "XDJ");

sec5 := inputsymbol("Consumer Staples", "XSJ");

sec6 := inputsymbol("Health Care", "XHJ");

sec7 := inputsymbol("Financials", "XFJ");

sec8 := inputsymbol("Information Technology", "XIJ");

sec9 := inputsymbol("Telecommunications", "XTJ");

secA := inputsymbol("Utilities", "XUJ");

index:=LoadSymbol(symb,C);

sector1:=LoadSymbol(sec1,C);

sector2:=LoadSymbol(sec2,C);

sector3:=LoadSymbol(sec3,C);

sector4:=LoadSymbol(sec4,C);

sector5:=LoadSymbol(sec5,C);

sector6:=LoadSymbol(sec6,C);

sector7:=LoadSymbol(sec7,C);

sector8:=LoadSymbol(sec8,C);

sector9:=LoadSymbol(sec9,C);

sectorA:=LoadSymbol(secA,C);

[color=red; width=2]

ma(ROC(sector1,1,%),period,S)-ma(ROC(index,1,%),period,S);

[color=coral]

ma(ROC(sector2,1,%),period,S)-ma(ROC(index,1,%),period,S);

[color=violet]

ma(ROC(sector3,1,%),period,S)-ma(ROC(index,1,%),period,S);

[color=gold]

ma(ROC(sector4,1,%),period,S)-ma(ROC(index,1,%),period,S);

[color=olive]

ma(ROC(sector5,1,%),period,S)-ma(ROC(index,1,%),period,S);

[color=lawn green]

ma(ROC(sector6,1,%),period,S)-ma(ROC(index,1,%),period,S);

[color=Teal]

ma(ROC(sector7,1,%),period,S)-ma(ROC(index,1,%),period,S);

[color=Turquoise]

ma(ROC(sector8,1,%),period,S)-ma(ROC(index,1,%),period,S);

[color=Slate Blue]

ma(ROC(sector9,1,%),period,S)-ma(ROC(index,1,%),period,S);

[color=Blue]

ma(ROC(sectorA,1,%),period,S)-ma(ROC(index,1,%),period,S);

Back to Top
brentjedi View Drop Down
Regular
Regular
Avatar

Joined: 13 Dec 2007
Posts: 34
Post Options Post Options   Quote brentjedi Quote  Post ReplyReply Direct Link To This Post Posted: 15 Feb 2009 at 9:47pm
That's a Opus Magnum Maxmio
Trading is art of self
Back to Top
brentjedi View Drop Down
Regular
Regular
Avatar

Joined: 13 Dec 2007
Posts: 34
Post Options Post Options   Quote brentjedi Quote  Post ReplyReply Direct Link To This Post Posted: 15 Feb 2009 at 10:00pm
I have put that on my screen but I don't get the legend of the sectors and color?.


Trading is art of self
Back to Top
brentjedi View Drop Down
Regular
Regular
Avatar

Joined: 13 Dec 2007
Posts: 34
Post Options Post Options   Quote brentjedi Quote  Post ReplyReply Direct Link To This Post Posted: 15 Feb 2009 at 10:07pm

Trading is art of self
Back to Top
brentjedi View Drop Down
Regular
Regular
Avatar

Joined: 13 Dec 2007
Posts: 34
Post Options Post Options   Quote brentjedi Quote  Post ReplyReply Direct Link To This Post Posted: 15 Feb 2009 at 10:10pm
Trading is art of self
Back to Top
 Post Reply Post Reply Page  123 5>

Forum Jump Forum Permissions View Drop Down

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