This forum has been archived. All content is frozen. Please use KDE Discuss instead.

[SOLVED] Update stock and currency prices

Tags: None
(comma "," separated)
User avatar
NickElliott
Registered Member
Posts
258
Karma
3
OS
I have been using the online update feature for some time for UK shares and this works excellently.

I also have units in an investment which has a SEDOL code, do you know if it is possible (and if so how) to lookup prices using this 7-digit code?

Thanks

Nick

Last edited by NickElliott on Wed Feb 11, 2009 12:31 pm, edited 1 time in total.


NickElliott, proud to be a member of KDE forums since 2008-Oct.
User avatar
ipwizard
KDE Developer
Posts
1359
Karma
6
OS
NickElliott wrote:I also have units in an investment which has a SEDOL code, do you know if it is possible (and if so how) to lookup prices using this 7-digit code?


We do have a price source which apparently works with SEDOL codes (Financial Times UK Funds). Check Settings/Online Quotes for details. It uses the following URL to retrieve the information:

Code: Select all
http://funds.ft.com/funds/simpleSearch.do?searchArea=%&search=%1


where %1 will be replaced with the symbol you assigned to the security in KMyMoney. Please see also the "What's this" note for the URL in the dialog by clicking on the ? in the title bar and then clicking into the URL field.

Hope that helps.


ipwizard, proud to be a member of the KMyMoney forum since its beginning. :-D
openSuSE Leap 15.4 64bit, KF5
User avatar
NickElliott
Registered Member
Posts
258
Karma
3
OS
Thank you for this, I couldn't get the search on the FT site to work, perhaps they've changed their setup. Fortunately I was successful using another of the built-in sources - Financial Express.


NickElliott, proud to be a member of KDE forums since 2008-Oct.
User avatar
NickElliott
Registered Member
Posts
258
Karma
3
OS
Further to the above I found a problem updating a particular investment on the Financial Express website because they quoted the price in £'s instead of pence. I created a second profile to import these prices, does this need adding to the default list in KMM?


NickElliott, proud to be a member of KDE forums since 2008-Oct.
User avatar
ipwizard
KDE Developer
Posts
1359
Karma
6
OS
NickElliott wrote:Further to the above I found a problem updating a particular investment on the Financial Express website because they quoted the price in £'s instead of pence. I created a second profile to import these prices, does this need adding to the default list in KMM?


You can control the price denomination with the security's online update settings. Set the factor to 1 and you should be set with the current profile.


ipwizard, proud to be a member of the KMyMoney forum since its beginning. :-D
openSuSE Leap 15.4 64bit, KF5
User avatar
NickElliott
Registered Member
Posts
258
Karma
3
OS
Yes, I thought so too and tried changing the factor but the update fails; it finds the symbol and finds the date but then reports 'Unable to update price for 3238080'.

Is it because there is a '£' sign in front of the price?


NickElliott, proud to be a member of KDE forums since 2008-Oct.
User avatar
ipwizard
KDE Developer
Posts
1359
Karma
6
OS
NickElliott wrote:Yes, I thought so too and tried changing the factor but the update fails; it finds the symbol and finds the date but then reports 'Unable to update price for 3238080'.

Is it because there is a '£' sign in front of the price?


Could be. Can you send me some details on what you try to do (symbol, URL, etc.)? If data is sensible, please use a private message/e-mail. It's probably the regular expression that is not correct (anymore).


ipwizard, proud to be a member of the KMyMoney forum since its beginning. :-D
openSuSE Leap 15.4 64bit, KF5
User avatar
NickElliott
Registered Member
Posts
258
Karma
3
OS
The example I've described uses the Financial Express online service as provided in KMM. This is the search URL:

https://webfund6.financialexpress.net/C ... aspx?code=%1

Try searching on these symbols:
B15F6J7
3238080

The price for the first symbol returns something like 82.24p which works fine with the standard Financial Express online quote in KMM.

Search on the second symbol and the price returned is something like £3.30 and KMM reports 'Unable to update price for 3238080'.

I suspected that the '£' sign was the problem so I made a modified copy of Financial Express and set the Price details as [Bid|Mid|Offer] Price[^0-9]*£([0-9,.]+).*

Amazingly, this seems to work.

Thoughts?


NickElliott, proud to be a member of KDE forums since 2008-Oct.
User avatar
ipwizard
KDE Developer
Posts
1359
Karma
6
OS
NickElliott wrote:I suspected that the '£' sign was the problem so I made a modified copy of Financial Express and set the Price details as [Bid|Mid|Offer] Price[^0-9]*£([0-9,.]+).*

Amazingly, this seems to work.

Thoughts?


So if I get this right, you copied the Financial Express and the only change was to add the '£' sign. If this is the case, you can simply change the price expression for Financial Express from

Code: Select all
[Bid|Mid|Offer] Price[^0-9]*([0-9,.]+)p.*


to

Code: Select all
[Bid|Mid|Offer] Price[^0-9]*£?([0-9,.]+)p?.*


(please notice the additional question mark following the pound sign and the pence at the end which means that the pound sign and letter p are optional) and things should be OK. If this is the case, please let us know and we'll change it in the source.


ipwizard, proud to be a member of the KMyMoney forum since its beginning. :-D
openSuSE Leap 15.4 64bit, KF5
User avatar
NickElliott
Registered Member
Posts
258
Karma
3
OS
This change fixes the update for prices in pounds but breaks it for those in pence. I'm going to read up on regular expressions and then see if I can get the symbol parser to work for both scenarios.


NickElliott, proud to be a member of KDE forums since 2008-Oct.
User avatar
NickElliott
Registered Member
Posts
258
Karma
3
OS
Ok, after spending a lot of time going nowhere I looked at the source of the webpage resulting from the search and realised that the data was more easily obtained from another part of the page.

If have found that this configuration for the symbol source works for prices in both pounds and pence:

Current Market Information[^0-9]*([0-9,.]+).*

I have e-mailed the guy who setup the online source for Financial Express to ask him if the modification works OK for him, I will let you know if he is happy after which you can make the change in the source.


NickElliott, proud to be a member of KDE forums since 2008-Oct.
User avatar
NickElliott
Registered Member
Posts
258
Karma
3
OS
As mentioned in my previous post I have modified the Financial Express online source to cope when prices are presented in different formats.

ipwizard wrote:...please let us know and we'll change it in the source.


The price expression for Financial Express should be modified to read as follows:

Code: Select all
Current Market Information[^0-9]*([0-9,.]+).*


Many thanks.


NickElliott, proud to be a member of KDE forums since 2008-Oct.
User avatar
ipwizard
KDE Developer
Posts
1359
Karma
6
OS
NickElliott wrote:The price expression for Financial Express should be modified to read as follows:

Code: Select all
Current Market Information[^0-9]*([0-9,.]+).*



Added to CVS. This will show up for new installations. Old ones need to update their configuration manually with the above mentioned value.


ipwizard, proud to be a member of the KMyMoney forum since its beginning. :-D
openSuSE Leap 15.4 64bit, KF5


Bookmarks



Who is online

Registered users: Bing [Bot], claydoh, Evergrowing, Google [Bot], rblackwell