Maybe my last message was not clear, so I will try to explain better. I know how to use the getbaseindex() to get the base index (DJ, or comp, etc.) for each of the stocks, and to apply a formula on that index. But what I really want to do is to get BOTH the base index for the stock AND the industry or sector index, as to compare the industry/sector index with the base index and with the stock. I am looking for 3 informations there to compare one to each other.
If anyone could help me with this issue, maybe by telling me how I could write such code to get both index and industry or sector, I would greatly appreciate. I tried to search through all the information in the group in the last years, but found no answer to my question. Thank you very much! Louis --- In [email protected], "louisprefontaine" <[EMAIL PROTECTED]> wrote: > > Hi, > > I am a newbie with Amibroker as well as on this board, but I have some > talent for learning and am trying to learn to write code really hard. > So far, I had no problem that did not have a solution. > > But now this is something that I don't understand. I want to compare > a market indicator (such as the Dow Jones) and a sector indicator > (such as the mining index). > > Here is the code I wrote so far (I know it's messy; I'm still learning) > > > -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- > > Ticker = GetBaseIndex(); // plot industry, need to create composite > sectors > > TickerName = IndustryID(1); > > TickerClose = Foreign( Ticker, "close" ); > > > for( i = 0; ( symbol = StrExtract( Ticker, i ) ) != ""; i++ ) > { > fc = Foreign( ticker, "C" ); > } > > PlotGrid( 0, colorYellow ); > > > _N( Title = "{{NAME}} - Relative Performance [%]: {{VALUES}}" ); > > ticker= ( 100 * ( fc - Ref( fc, -10 ))/Ref (fc,-10)) ; > Current= ( 100 * ( C - Ref (Close, -10) ) / Ref (Close, -10)) ; > > > ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- > > Basically, all I want to do is to add the Industry index along with > the Market index which is what is displayed right now. Anybody would > know how to do this? I tried to experiment with getbaseindex and > industry() and things like that but I got no way to add both > marketid(0) and industryid (0) in the same piece of code. > > Thanks!! >
