Iv been recently trying to find out how i can automatically compare an individuals stocks beta to its sectors performance E.G S&P/ASX 200 Materials sector with a ticker of XMJ. I Am struggling to find a code that is able to find the sector code from the individual stock , to put replace the "default" in the beta code.
An example for this would be me looking up "BHP" and the beta indicator would automatically assign "XMJ" as the indices to be compared to.
I am utilising Norgate Premium data which returns this data in symbol.
Hey mate, Finally got back to this problem after doing a lot of other work. Now that i know more about coding heres a solution which automatically finds the sector or index associated with the stock, as long as your categories are set up and linked each stock to the appropriate sector or index.