Hi guys,
I'm trying to build an algorithm that makes trades based on beta movement however I can't figure out how to calculate beta for the given security relative to SPY. When trying to calculate it I get stuck on variance and covariance. I'm new to algorithmic trading and any help would be appreciated.
Thanks;