wealthfolio
wealthfolio copied to clipboard
Continued issue with GBP prices
Related to #107
The fix mentioned in #107 did fix part of the issue, but other parts are still not quite fixed. If you see the screenshot, the all time return seems to be unaffected by the change while other measures seem to be correctly calculated..
Might be linked to https://github.com/afadil/wealthfolio/issues/106 ?
This is now also reflected in the dividends where the correct dividend (e.g., £100) will need to be entered as £10000 to be correctly reflected in the income view, but then is obviously incorrectly listed in the activity view.
I suffer from the same problem but with INRG.L. Yahoo Service gives rates in GBX which is same as GBp where 1 GBP == 100 GBp.
I tried applying the following patch:
diff --git a/src-core/src/fx/fx_service.rs b/src-core/src/fx/fx_service.rs
index 39c524e..3a6471a 100644
--- a/src-core/src/fx/fx_service.rs
+++ b/src-core/src/fx/fx_service.rs
@@ -44,6 +44,16 @@ impl CurrencyExchangeService {
return Ok(1.0);
}
+ if from_currency == "GBp" || from_currency == "GBX" {
+ let internal_rate = self.get_latest_exchange_rate("GBP", to_currency)?;
+ return Ok(internal_rate / 100.0);
+ }
+
+ if to_currency == "GBp" || to_currency == "GBX" {
+ let internal_rate = self.get_latest_exchange_rate(from_currency, "GBP")?;
+ return Ok(internal_rate * 100.0);
+ }
+
let key = format!("{}{}", from_currency, to_currency);
// Check cache
However, it only partially solved the problem.
I'm currently experiencing an issue with all stock symbols that Yahoo Finance displays in pence (GBp). This is causing incorrect holding position values in the system.
Is it possible that this is related to a currency case sensitivity problem, where the system may not be distinguishing between GBp (pence) and GBP (pounds)? Since 1 GBP equals 100 GBp, this could explain the discrepancy in the reported positions.
I can confirm this issue with the latest version. Also It is not possible to perform a CSV import specifying GBp. You can specify GBX (which I believe is the official currency code for penny sterling, 1 GBP = 100 GBX).
Perhaps it is a discrepancy with Yahoo Finance, and where GBp is encountered (and possibly mistaken as GBP) it should be read in as GBX.
Same issue in latest version 1.2.3 Incorrect holding value, leading to incorrect performance calculation for the entire portfolio which is a big issue as it ruins the entire portfolio calculations.