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

[amibroker] Re: Question on RS, possibly for Tomasz



PureBytes Links

Trading Reference Links

Hi Dan,

You are absolutely right that the sectors are the market, but I still
think, if I'm not mistaken, that the actual RS value returned by the
RelStrength function has a numerical value related to the actual price
of the underlying.  Thus, how do you physically compare this to
another sector?  Does the ROC pull this off?  It may.  I need to think
about it.  But I do think that the issue is valid.  This is exactly
what IBD does with their industry groups and stock ranks.  The
question is how do they assign a meaningful numerical value?  This is
where I'm obviously confused as my simplistic solution was wrong.  You
have me thinking that perhaps you have to compare the change (ROC?) in
RS of one sector against all others and you can't simply sort for the
best change in RS versus the market.  I'm not sure my statement makes
sense, and even then I'm not sure this is straight forward.  The more
we think about it though the closer we will get.  I appreciate your help.

Thanks,

Bret


--- In amibroker@xxxxxxxxxxxxxxx, "Dan Clark" <dan_public@xxxx> wrote:
> Quad, Jason,
> 
>  
> 
> I've been wrestling with almost the exact same issues for the past
couple of
> weeks.    In fact, my post of 7:57 this morning is related to this
issue. 
> 
>  
> 
> Quad, regarding comparing Sector/Market Relative Strength against each
> other.  Is this even valid?   (No, I'm not trying to be rude.)  
Here's my
> thinking.
> 
>  
> 
> Unless I'm missing something, it seems that your underlying
questions are,
> "Which are the strongest and weakest Sectors?" and "How is Sector
strength
> changing over time?"   (If so, these are my questions as well.)   
If this
> is correct, why do we care about the comparative "Relative Strength to
> Market"? 
> 
>  
> 
> It seems to me that the combination of the Sectors IS the market. 
Correct?
> If so, then the Sectors' comparative ROC or RSI is a valid measure.  Or,
> perhaps calculating the rank of a Sector within all Sectors using ROC or
> RSI.    Do my arguments make any sense?  
> 
>  
> 
> I'm using TC2005 data also and the Sectors/Industries are one of the key
> reasons that I used the data.    I've got several indicators built that
> calculate Industry and Sector rank and comparative strength.  I use
ROC and
> RSI for both.   I'm VERY interested in improving this.
> 
>  
> 
> Jason, this looks VERY interesting, but there are two issues:
> 
>  
> 
> 1)       When I tried to run an exploration with this, I got the error,
> "Relative strength base symbol not found" on all of the RelStrength
lines
> starting with: 
> 
>  
> 
> j1 = RelStrength("j");
> 
>  
> 
>       I'm using 4.70.5.   Any idea why this happens?    What did you
do at
> work to make it run?
> 
>  
> 
> 2)       I'm a little confused about using this as a scan.  I.e. it
looks
> like the code computes the relative strength of the Nasdaq index to the
> S&P500 and it's changes over time.   But that wouldn't that only
return one
> row?
> 
>  
> 
> Inquiring minds want to know.  :-)
> 
>  
> 
> Regards,
> 
>  
> 
> Dan.
> 
>  
> 
> // Here's the code I'm using to compute Industry and Market Relative
> Strength to the current symbol.  (Obviously this works only with a stock
> symbol which has an industry.) 
> 
>  
> 
> _SECTION_BEGIN("Relative Strength");
> 
> // Get Symbols
> 
> MktBaseSymbol = ParamStr("Mkt ticker", "SP-500" ); 
> 
> IndustrySymbol = GetBaseIndex() ;
> 
>  
> 
> StockToIndColor = ParamColor( "Stock to Industry Color", colorOrange ); 
> 
> StockToIndStyle = ParamStyle("Stock To Industry Style", styleLine +
> styleNoLabel + styleOwnScale) | styleDots  ;  
> 
>  
> 
> StockToMktColor = ParamColor( "Stock to Market Color", colorRed ); 
> 
> StockToMktStyle = ParamStyle("Stock To Market Style", styleLine +
> styleNoLabel + styleOwnScale) ;  
> 
>  
> 
> IndToMktColor = ParamColor( "Industry to Market Color", colorGold ); 
> 
> IndToMktStyle = ParamStyle("Industry To Market Style", styleLine +
> styleNoLabel + styleOwnScale) ;  
> 
>  
> 
> RelStrengthSymbolToIndustry = RelStrength(IndustrySymbol );
> 
> RelStrengthSymbolToMarket= RelStrength(MktBaseSymbol );
> 
>  
> 
> ShortMAPeriods    = Param("Rel Strength Short MA Periods", 10, 1,
50, 1);
> 
> LongMAPeriods     = Param("Rel Strength Long MA Periods", 40, 1, 50, 1);
> 
>  
> 
> cShortMAPeriods = NumToStr(ShortMAPeriods, 3.0);
> 
> cLongMAPeriods  = NumToStr(LongMAPeriods, 3.0);
> 
>  
> 
> // Plot Relative Strength - Stock To Industry 
> 
> Plot( RelStrengthSymbolToIndustry , _SECTION_NAME() + " (" + Name()
+ " to "
> + IndustrySymbol + ")", StockToIndColor ,StockToIndStyle );
> 
>  
> 
> // Plot Relative Strength - Stock To Market
> 
> Plot( RelStrengthSymbolToMarket, " (" + Name() + " to " +
MktBaseSymbol +
> ")", StockToMktColor , StockToMktStyle );
> 
>  
> 
> // Now plot relative Strength - Industry to Market
> 
> RelStrengthIndustryToMarket =
> (Foreign(IndustrySymbol,"C")/Foreign(MktBaseSymbol,"C")) * 1000;
> 
> Plot(RelStrengthIndustryToMarket  ,  " (" + IndustrySymbol+ " to " +
Name()+
> ")", IndToMktColor , IndToMktStyle );
> 
>  
> 
> if( Status("action")==actionCommentary )
> 
> { printf("(Interpretation is not available yet)");}
> 
> _SECTION_END();
> 
>   _____  
> 
> From: amibroker@xxxxxxxxxxxxxxx [mailto:amibroker@xxxxxxxxxxxxxxx]
On Behalf
> Of Jason Hart
> Sent: Saturday, July 09, 2005 9:18 AM
> To: amibroker@xxxxxxxxxxxxxxx
> Subject: Re: [amibroker] Question on RS, possibly for Tomasz
> 
>  
> 
> Quad,
> 
>  
> 
> I've got a number of different RS-type explorations that I've been
> experimenting with.  Try this scan - it's by no means perfect, but
you can
> modify it to fit your criteria.  A quick warning though, this
formula works
> fine on my home PC but at work I had to play around with "j" because it
> wasn't recognized as a valid symbol...strange.   
> 
>  
> 
> Jason
> 
> Filter=C>0;
> 
> x=RelStrength("!comp");
> 
> j = Foreign("!spx", "c");
> 
> j1 = RelStrength("j");
> 
> j2 = RelStrength("j")/Ref(j1,-20);
> 
> j3 = RelStrength("j")/Ref(j1,-30);
> 
> j4 = RelStrength("j")/Ref(j1,-50);
> 
> j5 = RelStrength("j")/Ref(j1,-100);
> 
> j6 = RelStrength("j")/Ref(j1,-120);
> 
> j7 = RelStrength("j")/Ref(j1,-150);
> 
> j8 = RelStrength("j")/Ref(j1,-200);
> 
> vol1 = StDev(log(C/Ref(C,-1)),720) * sqrt(260)*100;
> 
> vol2 = StDev(log(C/Ref(C,-1)),20) * sqrt(260)*100;
> 
> vol3 = StDev(log(C/Ref(C,-1)),50) * sqrt(260)*100;
> 
> vol4 = StDev(log(C/Ref(C,-1)),90) * sqrt(260)*100;
> 
> Vol5 = (Vol2 + Vol3+ Vol4)/3;
> 
> Vol6 = Vol5-Vol1;
> 
> Final = (j2*1) + (j3*1.2) + (j4*1.3)+(j5*1.4) + (j6*1.5) + (j7*1.7) +
> (j8*1.7);
> 
> RSC=LinRegSlope(x,7);
> 
> AddColumn(IIf(rsc>0,BarsSince(rsc<=0),BarsSince(rsc>=0)),"Cross",1.0);
> 
> AddTextColumn(FullName(),"name",5);
> 
> AddColumn(FINAL,"Today
>
RSC",1.2,colorDefault,IIf(final==0,colorBlue,IIf(final>Ref(final,-1),colorGr
> een,colorRed)));
> 
> AddColumn(Ref(final,-1),"Yesterday
>
RSC",1.2,colorDefault,IIf(final==0,colorBlue,IIf(Ref(final,-1)>=Ref(final,-2
> ),colorGreen,colorRed)));
> 
> AddColumn(Ref(final,-2),"2
>
days",1.2,colorDefault,IIf(final==0,colorBlue,IIf(Ref(final,-2)>=Ref(final,-
> 3),colorGreen,colorRed)));
> 
> AddColumn(Ref(final,-3),"3
>
days",1.2,colorDefault,IIf(final==0,colorBlue,IIf(Ref(final,-3)>=Ref(final,-
> 4),colorGreen,colorRed)));
> 
> AddColumn(Ref(final,-4),"4
>
days",1.2,colorDefault,IIf(final==0,colorBlue,IIf(Ref(final,-4)>=Ref(final,-
> 5),colorGreen,colorRed)));
> 
> AddColumn(Ref(final,-5),"5
>
days",1.2,colorDefault,IIf(final==0,colorBlue,IIf(Ref(final,-5)>=Ref(final,-
> 6),colorGreen,colorRed)));
> 
> AddColumn(Ref(final,-6),"6
>
days",1.2,colorDefault,IIf(final==0,colorBlue,IIf(Ref(final,-6)>=Ref(final,-
> 7),colorGreen,colorRed)));
> 
> AddColumn(Ref(final,-7),"7
>
days",1.2,colorDefault,IIf(final==0,colorBlue,IIf(Ref(final,-7)>=Ref(final,-
> 8),colorGreen,colorRed)));
> 
> AddColumn(Ref(final,-8),"8
>
days",1.2,colorDefault,IIf(final==0,colorBlue,IIf(Ref(final,-8)>=Ref(final,-
> 9),colorGreen,colorRed)));
> 
> AddColumn(Ref(final,-9),"9
>
days",1.2,colorDefault,IIf(final==0,colorBlue,IIf(Ref(final,-9)>=Ref(final,-
> 10),colorGreen,colorRed)));
> 
> AddColumn(Ref(final,-10),"10
>
days",1.2,colorDefault,IIf(final==0,colorBlue,IIf(Ref(final,-10)>=Ref(final,
> -11),colorGreen,colorRed)));
> 
> 
> 
> Quad Rate Serial Abby <quad_pumped_abby@xxxx> wrote:
> 
> I would like to do an exploration for the change in RS of a sector
> over various periods, say one week, two weeks, etc.  I extracted the
> RS of the sector versus the S&P Equal Weight Index using:
> 
> Strength = RelStrength ( "SPEW-X", fixup = 1 );
> 
> Then I found the change over the time periods in question.
> 
> Of course, when you look at a plot of the RS for a symbol or sector it
> appears the numerical value of the RS is directly correlated to the
> price of the underlying.  Thus, the numerical change in RS would be
> meaningless against a different priced sector.  
> 
> I thought the simple solution was to divide the RS value by the
> closing price, thus normalizing the results.  But this caused the RS
> charts and values to be identical for every sector.  
> 
> Is what I'm trying to do an impossibility with Amibroker or is my
> approach all wrong?  Any help would be appreciated.
> 
> Thanks,
> 
> Bret
> 
> 
> 
> 
> Please note that this group is for discussion between users only.
> 
> To get support from AmiBroker please send an e-mail directly to 
> SUPPORT {at} amibroker.com
> 
> For other support material please check also:
> http://www.amibroker.com/support.html
> 
> 
> 
> 
> 
> 
> __________________________________________________
> Do You Yahoo!?
> Tired of spam? Yahoo! Mail has the best spam protection around 
> http://mail.yahoo.com 
> 
> Please note that this group is for discussion between users only.
> 
> To get support from AmiBroker please send an e-mail directly to 
> SUPPORT {at} amibroker.com
> 
> For other support material please check also:
> http://www.amibroker.com/support.html
> 
> 
> 
> 
> 
> 
> SPONSORED LINKS 
> 
> 
> Investment
>
<http://groups.yahoo.com/gads?t=ms&k=Investment+management+software&w1=Inves
>
tment+management+software&w2=Investment+property+software&w3=Investment+soft
>
ware&w4=Investment+tracking+software&w5=Return+on+investment+software&w6=Sto
> ck+investment+software&c=6&s=195&.sig=f7GzIv9NJMWrH8f5eIxZQQ> 
management
> software 
> 
> Investment
>
<http://groups.yahoo.com/gads?t=ms&k=Investment+property+software&w1=Investm
>
ent+management+software&w2=Investment+property+software&w3=Investment+softwa
>
re&w4=Investment+tracking+software&w5=Return+on+investment+software&w6=Stock
> +investment+software&c=6&s=195&.sig=fBbyjQAf07KrkKtKejJqSg>  property
> software 
> 
> Investment
>
<http://groups.yahoo.com/gads?t=ms&k=Investment+software&w1=Investment+manag
>
ement+software&w2=Investment+property+software&w3=Investment+software&w4=Inv
>
estment+tracking+software&w5=Return+on+investment+software&w6=Stock+investme
> nt+software&c=6&s=195&.sig=JfxNHYIXqCuLAnnc8YN4_A>  software 
> 
> 
> Investment
>
<http://groups.yahoo.com/gads?t=ms&k=Investment+tracking+software&w1=Investm
>
ent+management+software&w2=Investment+property+software&w3=Investment+softwa
>
re&w4=Investment+tracking+software&w5=Return+on+investment+software&w6=Stock
> +investment+software&c=6&s=195&.sig=SgkrPC352yiiN_zJGzIM9Q>  tracking
> software 
> 
> Return
>
<http://groups.yahoo.com/gads?t=ms&k=Return+on+investment+software&w1=Invest
>
ment+management+software&w2=Investment+property+software&w3=Investment+softw
>
are&w4=Investment+tracking+software&w5=Return+on+investment+software&w6=Stoc
> k+investment+software&c=6&s=195&.sig=L-DlQNXfuFeH8Mu0waS7qw>  on
investment
> software 
> 
> Stock
>
<http://groups.yahoo.com/gads?t=ms&k=Stock+investment+software&w1=Investment
>
+management+software&w2=Investment+property+software&w3=Investment+software&
>
w4=Investment+tracking+software&w5=Return+on+investment+software&w6=Stock+in
> vestment+software&c=6&s=195&.sig=0oBPv1BELuBmfls_PcSgGg>  investment
> software 
> 
>  
> 
>   _____  
> 
> YAHOO! GROUPS LINKS 
> 
>  
> 
> *	 Visit your group "amibroker
> <http://groups.yahoo.com/group/amibroker> " on the web.
>   
> *	 To unsubscribe from this group, send an email to:
>  amibroker-unsubscribe@xxxxxxxxxxxxxxx
> <mailto:amibroker-unsubscribe@xxxxxxxxxxxxxxx?subject=Unsubscribe> 
>   
> *	 Your use of Yahoo! Groups is subject to the Yahoo!
> <http://docs.yahoo.com/info/terms/>  Terms of Service. 
> 
>  
> 
>   _____




------------------------ Yahoo! Groups Sponsor --------------------~--> 
Try Online Currency Trading with GFT. Free 50K Demo. Trade 
24 Hours. Commission-Free. 
http://us.click.yahoo.com/DldnlA/9M2KAA/U1CZAA/GHeqlB/TM
--------------------------------------------------------------------~-> 

Please note that this group is for discussion between users only.

To get support from AmiBroker please send an e-mail directly to 
SUPPORT {at} amibroker.com

For other support material please check also:
http://www.amibroker.com/support.html

 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/amibroker/

<*> To unsubscribe from this group, send an email to:
    amibroker-unsubscribe@xxxxxxxxxxxxxxx

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