A friend recently highlighted to me that when he ran a backtest on PyInvesting with both US and Hong Kong stocks, the backtester did not account for the currency differences. As a result, the simulated portfolio’s performance was incorrect because it did not handle the forex fluctuations between US and Hong Kong stocks.
I’ve been putting off this fix for a while because it was not easy to implement with many details that needed to be handled. However, I decided to implement this feature this week because it was requested by a number of my users and it would be useful going forward as I introduce stocks from other countries into my database.
Updating backtester price feeds
Being able to handle the forex fluctuations between stocks of different currencies meant that I needed to convert the prices of every stock into a single currency before feeding the prices into the backtester....