Calculating Beta

Questions about MultiCharts and user contributed studies.
quod_erat
Posts: 33
Joined: 14 Mar 2020
Has thanked: 4 times
Been thanked: 1 time

Calculating Beta

Postby quod_erat » 12 Dec 2020

Does anyone here know if MC has a built-in function for calculating the beta between two stocks? Something like what's described here -- https://www.investopedia.com/ask/answer ... g-beta.asp . It's something that's hand-codeable, but if there's an existing function, I'd rather not duplicate the work ...

quod_erat
Posts: 33
Joined: 14 Mar 2020
Has thanked: 4 times
Been thanked: 1 time

Re: Calculating Beta

Postby quod_erat » 13 Dec 2020

For anyone interested, this is what I hand-coded so far. I think it's right, though I haven't verified it yet:

Code: Select all

input: length(100); vars: return(0), return_benchmark(0), sd_security(0), sd_benchmark(0), Beta(0); return = (close of data2 - close of data2[1])/close of data2; return_benchmark = (close- close[1])/close; sd_security = StandardDev(return, length, 2); sd_benchmark = StandardDev(return_benchmark, length, 2); Beta = Correlation(return, return_benchmark, length) * (sd_security / sd_benchmark); plot1(Beta);


Return to “MultiCharts”