I know how to calculate adjusted closing prices in case of splits, dividends, etc but I'm not able to figure out how it's done in case of a rights issue.
A typical rights issue is of the form:
A rights for every B shares at a price of C, where the closing price on the day prior to ex-rights date is D.
To calculate a dilution factor from a rights issue: ( ac/(a+b) + bd/(a+b) ) / d
In python code form:
# Rights issue - 1 for 4 rights issue at $18 with previous close of $20 a = 1 b = 4 c = 18 d = 20 dilutionfactor = ( a*c/(a+b) + b*d/(a+b) ) / d # the dilution factor calculated here here is 0.98
All prices prior to the ex-rights date need to be multiplied by this factor.
In the above example, this would make the adjusted price on the day prior to the ex-rights date $19.60.