The Stock Price move from 100 ($p_1$) to 150 ($p_2$) and the FX rate moves from 1.2 ($c_1$) to 0.8 ($c_2$). therefore the base currency value stays the same.
I am looking for the fx vs stock contribution over the day using the natural log.
Usually I can use the following formula, but in the above case I get a divide by zero error.
stock contribution: ${p_2c_2 - p_1c_1 \over 1 + \frac {ln(p_2/p_1)} { ln(c_2/c_1) }}$
fx contribution = ${p_2c_2 - p_1c_1 \over 1 + \frac {ln(c_2/c_1)} { ln(p_2/p_1) }}$
Any obvious solutions?
With an obvious notation, $$S:=\frac{p_2c_2-p_1c_1}{1+\dfrac{\ln\left(\dfrac{p_2}{p_1}\right)}{\ln\left(\dfrac{c_2}{c_1}\right)}}=c_1p_1\frac{cp-1}{1+\dfrac{\ln(p)}{\ln(c)}}=c_1p_1\ln(c)\frac{cp-1}{\ln(c)+\ln(p)}.$$
Then by L'Hospital,
$$\lim_{c\to1/p}\frac{cp-1}{\ln(c)+\ln(p)}=\lim_{c\to1/p}\frac p{\dfrac1c}=1,$$
and
$$S=c_1p_1\ln\left(\frac{c_2}{c_1}\right).$$