I think the best way to handle this is to pretend that your account is a Mutual Fund or other collective investment vehicle that is in principle available for others to invest (even though in practice, for now, you are the only investor).
This means keeping track of two things, the number of "shares" outstanding and the Net Asset Value per share on a daily basis. (The NAV should be expressed in your "base currency", which is the currency you use on a daily basis to buy food, pay taxes, etc.).
The initial number of shares can be arbitrary (such as 10000 shares).
On any day in which you invest additional funds, at the close of business you compute the NAV/sh by valuing all securities in the portfolio (other thn the incoming cash) and dividing by the (previous) number of shares outstanding. You then issue yourself new shares in the amount of your investment divided by the NAV. You update the number of shares outstanding.
Vice versa when you withdraw money from the account you decrease the number of shares outstanding.
To compute returns between any two times of cash inflow/outflow (or two periods of complete portfolio valuation) you use the percentage change in NAV. For longer periods you can link the returns by the usual geometric linking formula.
This method will give you a perfectly accurate Time Weighted rate of return.
On problem is that it is a lot of work, especially if you want daily NAVs. The other method you mention, the modified Dietz method could be used as an approximation if you think the full NAV method is too labor intensive. For example you could value the portfolio only on a monthly or quarterly basis. So it depends how much work you want to do.