wealthfolio icon indicating copy to clipboard operation
wealthfolio copied to clipboard

Continued issue with GBP prices

Open zeeraktalat opened this issue 1 year ago • 5 comments
trafficstars

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..

Screenshot 2024-10-05 at 21 44 17

zeeraktalat avatar Oct 05 '24 19:10 zeeraktalat

Might be linked to https://github.com/afadil/wealthfolio/issues/106 ?

maelp avatar Oct 11 '24 14:10 maelp

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.

zeeraktalat avatar Oct 28 '24 10:10 zeeraktalat

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.

ikruglov avatar Jan 18 '25 20:01 ikruglov

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.

Image

zoltan-o avatar Mar 30 '25 20:03 zoltan-o

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.

BarryFogarty avatar Apr 15 '25 16:04 BarryFogarty

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.

JJJ-M avatar Oct 21 '25 14:10 JJJ-M