Reply to topic

The Problem with Online Quotes

empenoso
Registered Member
Posts
31
Karma
0

The Problem with Online Quotes

Thu Jan 05, 2017 4:56 pm
I think many online quotes that are configured in KMyMoney do not work.
I'm looking for the price of iShares MSCI Europe Inc (IE00B1YZSC51):

Setting -> Configure KMyMoney -> Online Quotes -> Yahoo UK
Link to website: https://uk.finance.yahoo.com/q?s=IQQY.F&ql=0
Symbol: IQQY.F
Online price update:
Fetching URL http://uk.finance.yahoo.com/d/quotes.cs ... &f=sl1d3...
Symbol found: "IQQY.F"
Price found: 22.79 (22,79)
Unable to update price for IQQY.F (no price or no date)


Setting -> Configure KMyMoney -> Online Quotes -> Finanztreff
Link to website: http://etf.finanztreff.de/etf_einzelkur ... i=42350034
Symbol: IQQY
Online price update:
Fetching URL http://finanztreff.de/kurse_einzelkurs_ ... 0&i=IQQY...
Symbol found:
Unable to update price for IQQY (no price or no date)


Setting -> Configure KMyMoney -> Online Quotes -> Financial Times UK Funds
Link to website: http://funds.ft.com/uk/Tearsheet/Summary?s=IQQY:GER:EUR
Symbol: IQQY:GER:EUR
Online price update:
Fetching URL http://funds.ft.com/uk/Tearsheet/Summar ... :GER:EUR...
Symbol found: IQQY:GER:EUR">Historical prices
View PDF
iShares MSCI Europe UCITS ETF (Dist)

22.83
0.00 / 0.00%
18.80 - 22.95
+0.46
Latest price in EUR
Today's change
52-week range
3-yr sharpe ratio

Data delayed at least 15 minutes, as of Jan 05 2017 16:26 GMT.
....

Unable to update price for IQQY:GER:EUR (no price or no date)



How can I fix the code (Setting -> Configure KMyMoney -> Online Quotes) to make it work?

Thank you!

P.S. I use KMyMoney 4.8.0 (KDE Development Platform 4.12.5).
empenoso
Registered Member
Posts
31
Karma
0

Re: The Problem with Online Quotes

Sat Jan 07, 2017 10:55 am
I like finanztreff.de and i use Finance::Quote, but https://github.com/finance-quote/finance-quote/blob/master/lib/Finance/Quote/VWD.pm VWD.pm (finanztreff.de part of VWD) does not work correctly with ETF :(
empenoso
Registered Member
Posts
31
Karma
0

Re: The Problem with Online Quotes

Tue Jan 10, 2017 5:17 am
I set up updating bond prices from the site http://www.boerse-berlin.com/index.php/Bonds! :)

Go into Settings/Configure KyMyMoney -> Select Online Quotes
New source is configured with following parameters :

URL = http://www.boerse-berlin.com/index.php/Bonds?isin=%1
Symbol =
Quotation = _last">([0-9.]+.\d+)
Date = _dateTime">(\d+\D+\d+\D+\d+)
Date Format = %d %m %y

Put the checkbox "Do not remove HTML fragments".

Press « Update » Button
empenoso
Registered Member
Posts
31
Karma
0
I modified the code to update from different sources.
Go into Settings/Configure KyMyMoney -> Select Online Quotes
New source is configured with following parameters :

boursorama.com bonds in % Stuttgart
Code: Select all
http://www.boursorama.com/cours.phtml?symbole=%1

<b><span class="cotation">([0-9]+.\d+)
change</td>
                      <td>(\d+\D+\d+\D+\d+)
%d/%m/%y
Put the checkbox "Do not remove HTML fragments".

boursorama.com bonds in % Berlin / Bremen
Code: Select all
http://www.boursorama.com/cours.phtml?symbole=%1

<meta itemprop="price" content="([0-9]+.\d+)" />
class="time-short">(\d+\D+\d+\D+\d+)
%d/%m/%y                     
Put the checkbox "Do not remove HTML fragments".

ariva.de
Code: Select all
http://www.ariva.de/%1/kurs


<meta itemprop="price" content="([0-9]+.\d+)" />
class="time-short">(\d+\D+\d+\D+\d+)
%d/%m/%y
Put the checkbox "Do not remove HTML fragments".

markets.businessinsider.com bonds in %
Code: Select all
http://markets.businessinsider.com/bonds/%1


<span class="price-row-price">([0-9.]+.\d+)
                           (\d+\D+\d+\D+\d+)
%m/%d/%y
Put the checkbox "Do not remove HTML fragments".
empenoso
Registered Member
Posts
31
Karma
0

Re: The Problem with Online Quotes

Wed Jan 11, 2017 7:05 am
And Russian mutual funds and coins:
pif.investfunds.ru mutual funds
Code: Select all
http://pif.investfunds.ru/funds/%1/detail/1/

<td style='text-align:right'>[^0-9]*([0-9,\s\.]+).*</td>
<input type='text' name='date2' value='(\d+\D+\d+\D+\d+)
%d.%m.%y

Put the checkbox "Do not remove HTML fragments".

gold.investfunds.ru coins
Code: Select all
http://gold.investfunds.ru/cbr_coins/%1

<td id="pos1" style="text-align:left;">[^0-9]*([0-9,\s\.]+).*</td>
<input name="dateto" value="(\d+\D+\d+\D+\d+)
%d.%m.%y

Put the checkbox "Do not remove HTML fragments".
aughyer
Registered Member
Posts
1
Karma
0

Re: The Problem with Online Quotes

Sun Mar 05, 2017 7:12 pm
Could someone help build the source for Polish mutual funds?

This URL should be OK, I think: http://www.bankier.pl/fundusze/notowania/%1 (e.g. http://www.bankier.pl/fundusze/notowania/AGF44)
The current price follows the expression "Wartość jednostki:", the date is right after that in parentheses.

Please note that the price uses a comma for decimal.
empenoso
Registered Member
Posts
31
Karma
0

Re: The Problem with Online Quotes

Tue Mar 07, 2017 4:23 am
aughyer wrote:Could someone help build the source for Polish mutual funds?

This URL should be OK, I think: http://www.bankier.pl/fundusze/notowania/%1 (e.g. http://www.bankier.pl/fundusze/notowania/AGF44)
The current price follows the expression "Wartość jednostki:", the date is right after that in parentheses.

Please note that the price uses a comma for decimal.


Try:
Code: Select all
Quotation =                    <td>[^0-9]*([0-9,\s\.]+).*&nbsp;zł</td>

Put the checkbox "Do not remove HTML fragments".

Spaces are also important. See:
Code: Select all
view-source:http://www.bankier.pl/fundusze/notowania/AGF44

                    <td><a href="/fundusze/notowania/AGF44">AGIO Akcji PLUS (AGIO PLUS FIO)</a></td>
                    <td>158,65&nbsp;zł</td>
                    <td class="textAlignRight change  up">53,34%</td>
                </tr>
                <tr>
                    <td><a href="/fundusze/notowania/PZU21">PZU Akcji Spółek Dywidendowych (GI SFIO)</a></td>
                    <td>139,28&nbsp;zł</td>
                    <td class="textAlignRight change  up">49,31%</td>
                </tr>
                <tr>
                    <td><a href="/fundusze/notowania/AGF07">AGIO Agresywny (AGIO SFIO)</a></td>
                    <td>1466,88&nbsp;zł</td>
                    <td class="textAlignRight change  up">39,50%</td>
                </tr>
                <tr>
                    <td><a href="/fundusze/notowania/SOV11">SATURN Agresywny FIZ</a></td>
                    <td>139,43&nbsp;zł</td>
                    <td class="textAlignRight change  up">33,80%</td>
                </tr>
                <tr>
                    <td><a href="/fundusze/notowania/CAS02">Caspar Akcji Polskich (Caspar Parasolowy FIO)</a></td>
                    <td>155,74&nbsp;zł</td>
                    <td class="textAlignRight change  up">30,97%</td>
empenoso
Registered Member
Posts
31
Karma
0

Re: The Problem with Online Quotes

Tue Jan 09, 2018 7:09 am
I collected all scripts for parsing different sites. They work for me. :)
I hope this will be useful to someone.

The easiest way is insert all codes in file "kmymoneyrc".
Windows 10 path: "c:\Users\USER1\AppData\Roaming\.kde4\share\config\kmymoneyrc"

Code: Select all
[Online-Quote-Source-Yahoo Currency]
DateFormatRegex=%d/%m/%y
DateRegex=updated\\s\\d+:\\d+:\\d+\\(\\w+\\)\\s(\\d{1,2}\\/\\d{2}\\/\\d{4})
PriceRegex=1\\s[^=]+\\s=<\\/span><br\\s\\/>\\s([^\\s]+)
SkipStripping=true
SymbolRegex=href="https:\\/\\/fx-rate.net\\/([^\\/]+\\/[^\\/]+)
URL=https://fx-rate.net/%1/%2

[Online-Quote-Source-boursorama.com bonds in % Berlin / Bremen ]
DateFormatRegex=%d/%m/%y
DateRegex=class="time-short">(\\+\\+\\+\\+\\+)
PriceRegex=<meta itemprop="price" content="([0-9]+.\\+)" />
SkipStripping=true
SymbolRegex=
URL=http://www.boursorama.com/cours.phtml?symbole=%1

[Online-Quote-Source-boursorama.com bonds in % Stuttgart]
DateFormatRegex=%d/%m/%y
DateRegex=change</td>\t\t\t    \t\t\t<td>(\\+\\+\\+\\+\\+)
PriceRegex=<b><span class="cotation">([0-9]+.\\+)
SkipStripping=true
SymbolRegex=
URL=http://www.boursorama.com/cours.phtml?symbole=%1

[Online-Quote-Source-domofond.ru realty Perm]
DateFormatRegex=%d.%m.%y
DateRegex=
PriceRegex='ноя.17' ,[^0-9]*([0-9,\\s\\.]+).*
SkipStripping=true
SymbolRegex=
URL=http://www.domofond.ru/tseny-na-nedvizhimost/permskiy_kray/perm/sverdlovskiy-d219

[Online-Quote-Source-finance.google.com]
DateFormatRegex=%y-%m-%d
DateRegex="quoteTime"\\s+content="(\\d{4}-\\d{2}-\\d{2})T
PriceRegex="price"\\s+content="((\\d+|\\d{1,3}(?:[,]\\d{3})).\\d+)
SkipStripping=true
SymbolRegex=%1
URL=https://finance.google.com/finance?q=%1

[Online-Quote-Source-finance.yahoo.com]
DateFormatRegex=%m %d %y
DateRegex=
PriceRegex=<!-- react-text: 36 -->((\\d+|\\d{1,3}(?:[,]\\d{3})).\\d+)
SkipStripping=true
SymbolRegex=%1
URL=https://finance.yahoo.com/quote/%1

[Online-Quote-Source-gold.investfunds.ru coins]
DateFormatRegex=%d.%m.%y
DateRegex=style="text-align:left;">(\\d+\\D+\\d+\\D+\\d+)
PriceRegex=<td id="pos1" style="text-align:left;">[^0-9]*([0-9,\\s\\.]+).*</td>
SkipStripping=true
SymbolRegex=
URL=http://gold.investfunds.ru/cbr_coins/%1

[Online-Quote-Source-markets.businessinsider.com bonds in %]
DateFormatRegex=%m/%d/%y
DateRegex=\t\t\t\t\t\t\t\t\t(\\d+\\D+\\d+\\D+\\d+)
PriceRegex=<span class="price-row-price">([0-9.]+.\\d+)
SkipStripping=true
SymbolRegex=
URL=http://markets.businessinsider.com/bonds/%1

[Online-Quote-Source-news.yandex.ru/quotes/]
DateFormatRegex=%d.%m.%y
DateRegex=<td class="quote__date">(\\d+\\D+\\d+\\D+\\d+)
PriceRegex=<span class="quote__sgn"></span>[^0-9]*([0-9,\\s\\.]+).*</td>
SkipStripping=true
SymbolRegex=
URL=https://news.yandex.ru/quotes/%1.html

[Online-Quote-Source-onvista.de]
DateFormatRegex=%d.%m.%y
DateRegex=<span class="datetime">(\\d+\\D+\\d+\\D+\\d+)
PriceRegex=<span class="price">((\\d+|\\d{1,3}(?:[,]\\d{3})).\\d+)
SkipStripping=true
SymbolRegex=
URL=https://www.onvista.de/fonds/%1

[Online-Quote-Source-pif.investfunds.ru mutual funds]
DateFormatRegex=%d.%m.%y
DateRegex=<input type='text' name='date2' value='(\\d+\\D+\\d+\\D+\\d+)
PriceRegex=<td style='text-align:right'>[^0-9]*([0-9,\\s\\.]+).*</td>
SkipStripping=true
SymbolRegex=
URL=http://pif.investfunds.ru/funds/%1/detail/1/

[Online-Quote-Source-www.boerse-berlin.com bonds]
DateFormatRegex=%d %m %y
DateRegex=_dateTime">(\\+\\+\\+\\+\\+)
PriceRegex=_last">([0-9.]+.\\+)
SkipStripping=true
SymbolRegex=
URL=http://www.boerse-berlin.com/index.php/Bonds?isin=%1
Lionel90
Registered Member
Posts
7
Karma
0
OS

Re: The Problem with Online Quotes

Thu Jan 11, 2018 6:17 pm
Hi
I am a linux user (ubuntu)

I am strugling to get the prices for some french funds.
Exemple: FR0010037341 http://www.boursorama.com/bourse/opcvm/ ... =MP-802280

I set the URL and symbol right but the price retrurned is wrong (it returns 1€ in Kmymoney)

any help would be handy.

Thank you
User avatar ipwizard
KDE Developer
Posts
673
Karma
3
OS

Re: The Problem with Online Quotes

Thu Jan 11, 2018 6:36 pm
You did not mention the regexes and settings you used to extract the various data fields. I see the price here:
Code: Select all
<span class="cotation">6 167.940 EUR</span>   
It might become a bit tricky to extract the price with a blank as thousand separator. The date can be found here:
Code: Select all
<td style="text-align: right;"><strong>09/01/2018&nbsp;</strong></td>
Does that help?


ipwizard, proud to be a member of the KMyMoney forum since its beginning. :-D
openSuSE Leap 15.0 64bit, KF5
Lionel90
Registered Member
Posts
7
Karma
0
OS

Re: The Problem with Online Quotes

Thu Jan 11, 2018 6:47 pm
here are 2 screenshots :
fund : (for which I am currently updating the prices manually, so don't bother with those numbers)
Image

My quotation settings :
I guess there is something wrong here.
Image
empenoso
Registered Member
Posts
31
Karma
0

Re: The Problem with Online Quotes

Fri Jan 12, 2018 5:19 pm
Lionel90 wrote:My quotation settings
...


Try
Code: Select all
[^0-9]*([0-9,\\s\\.]+).*
for price.
Lionel90
Registered Member
Posts
7
Karma
0
OS

Re: The Problem with Online Quotes

Fri Jan 12, 2018 8:47 pm
Thank you but this expression doesn't work.
It finds the isin number as price. ( FR0010037341)
In this exemple, it returns : 0010037341 (1,00373e+07)
empenoso
Registered Member
Posts
31
Karma
0

Re: The Problem with Online Quotes

Sat Jan 13, 2018 5:35 am
Lionel90 wrote:Thank you but this expression doesn't work.
It finds the isin number as price. ( FR0010037341)
In this exemple, it returns : 0010037341 (1,00373e+07)


Of course this does not work.

The complete line for the price is something like this:

Code: Select all
<span class="cotation">[^0-9]*([0-9,\\s\\.]+).*

http://www.boursorama.com/bourse/opcvm/opcvm.phtml?symbole=MP-802280
Code: Select all
<div class="fv-data-main">
               <div class="fv-qdata">
                  <big class="fv-last">
                     <span class="cotation">6 100.590 EUR</span>                     &nbsp;                  </big>
Lionel90
Registered Member
Posts
7
Karma
0
OS

Re: The Problem with Online Quotes

Sat Jan 13, 2018 5:04 pm
Hi
Thank you for your time and patience.
I also searched on my side and found this was working better with the "blank" as thousand separator.
Code: Select all
<span class="cotation">((?:\d{0,3}\s+)*\d{0,3}(?:,|\.)\d*)

 
Reply to topic

Bookmarks



Who is online

Registered users: Baidu [Spider], Bing [Bot], boudewijn, ChameleonScales, danasenhansen, duns, Exabot [Bot], Google [Bot], jackjo, Kawaii Specter, keyths, Majestic-12 [Bot], niccolove, Petra-Kathi, polsson, sarafox, stanleyf, surt, tymond