Currently, I'm implementing currency exchange feature, for a stock market portfolio app.
I had faced the following obstacle.
In 2008, I bought a stock priced USD 1, using currency MYR. 1 USD is 3 MYR. I paid MYR 3.
In 2015, I sold the stock price USD 2, using curreny MYR. 1 USD is 4 MYR. I paid MYR 8.
My profit in MYR is 5 (MYR 8 - MYR 3)
My profit in USD is 2 (USD 2 - USD 1)
Now, I wish to view my portfolio profit in term of SGD. What should it be?