Reply to topic

Currency Quotes

User avatar ipwizard
KDE Developer
Posts
534
Karma
1
OS

Re: Currency Quotes

Mon Nov 27, 2017 8:44 pm
Did you make the change to kmymoneyrc without KMyMoney running? If yes, I am out of ideas why you see this error. The only place where Malformed URL shows in the KMyMoney source tree is when saving the KMyMoney data file has a problem. But that certainly is not the case here.


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

Re: Currency Quotes

Mon Nov 27, 2017 11:34 pm
ipwizard wrote:Did you make the change to kmymoneyrc without KMyMoney running? If yes, I am out of ideas why you see this error. The only place where Malformed URL shows in the KMyMoney source tree is when saving the KMyMoney data file has a problem. But that certainly is not the case here.


Yes, I edited kmymoneyrc with KMyMoney closed :-\ thank you anyway for trying to find out what's going on!
alainpetit
Registered Member
Posts
12
Karma
0

Re: Currency Quotes

Sun Dec 03, 2017 2:07 pm
alainpetit wrote:@All:

Eureka, I've made a awesome discovery, and I have to share it with all here that were interested in this issue. Moving to Google Finance was good 99% of the time, but based on my own problems with ETH currency, I couldn't find a one solution to suit all. Until now ... I've found a little unknown currency tracker that works with ALL currency and crypto :

Code: Select all
Kmymoney Settings
URL : https://fx-rate.net/%1/%2
Symbol : href="https:\/\/fx-rate.net\/([^\/]+\/[^\/]+)
Price : 1\s[^=]+\s=<\/span><br\s\/>\s([^\s]+)
Date : updated\s\d+:\d+:\d+\(\w+\)\s(\d{1,2}\/\d{2}\/\d{4})
Date Format : %d/%m/%y
Skip Stripped HTML : CHECKED


@All :
Alrigth new minor problem, now that BTC is coming increasingly high .. fx-rate started displaying CAD to BTC price as 7.2482e-5 Bitcoin (scientific notation), which kinda screw the REGEX reading for that particular pair ... however everything else in KMyMoney seems to be based on BTC to CAD. Nonetheless, are there anyone REGEX wizard here that alter the Price : part of REGEX to support scientific notation ?

EDIT : Also Question 2 - how can I change the currency to 4 decimal digits precision ?
User avatar ipwizard
KDE Developer
Posts
534
Karma
1
OS

Re: Currency Quotes

Sun Dec 03, 2017 2:22 pm
Answer 1: Having a price in a scientific notation is (currently) not supported. I doubt that we can change the value from the scientific to normal representation using a regex.

Answer 2: Do you mean the precision of the currency or the price?


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

Re: Currency Quotes

Mon Dec 04, 2017 12:56 pm
ipwizard wrote:Answer 1: Having a price in a scientific notation is (currently) not supported. I doubt that we can change the value from the scientific to normal representation using a regex.

Answer 2: Do you mean the precision of the currency or the price?


hum, Question 2 : I meant the price but after further look .. it is 4 digit, and configurable in the general options. My bad.

But now that you mention about the precision of the currency, a minor annoyance I'm encountering is that my bitcoin accounts are displaying only 2 digit. is this customizable somewhere ?
User avatar ipwizard
KDE Developer
Posts
534
Karma
1
OS

Re: Currency Quotes

Mon Dec 04, 2017 3:08 pm
Not via the UI. You can try to modify that directly in your data file. Make sure to have a backup of it before you fiddle around. Search for the following line:
Code: Select all
<CURRENCY symbol="BTC" saf="100" type="3" id="BTC" rounding-method="0" name="Bitcoin" scf="100" pp="4"/>
Change saf (Smallest Account Fraction) and scf (Smallest Cash Fraction) to e.g. 10000 to get 4 digits of precision. Don't change anything else. Do that while KMyMoney is not running.

Here's a bit of documentation regarding the file formats provided/used by KMyMoney.

What would be a good default for saf and scf for Bitcoins? We can certainly adjust the source for future users.


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

Re: Currency Quotes

Wed Dec 06, 2017 3:46 pm
Very interesting discussion! I just registered to be a part of it! ;)

I have some cryptocurrencies that are not very popular (like MONA or OK). I'd like to add them to my KMyMoney as an investment. It works perfect for BTC with the Google Finance settings that you provided. But the only website I found listing all of the crypto prices is Coingecko.
Unfortunately I cannot find the right regex to extract price and date.
Can anybody help me?

URL is https://www.coingecko.com/de/munze/%1 (or /en/coins/%1 for english users).

Thank you very much in advance!!! o)
empenoso
Registered Member
Posts
27
Karma
0

Re: Currency Quotes

Mon Jan 08, 2018 5:58 pm
Why not use https://finance.yahoo.com/quote/ again?

Code: Select all
URL = https://finance.yahoo.com/quote/%1
Symbol = <!-- react-text: 36 -->[^0-9]*([0-9,\s\.]+).*
Quotation =
Date =
Date Format = %m %d %y

Put "Skip HTML string".

I can not write the code for the date.
But I receive the current price.
alainpetit
Registered Member
Posts
12
Karma
0

Re: Currency Quotes

Wed Feb 21, 2018 10:44 am
Hi all,

yea I coming back from the dead to this thread to try to solve another problem ...

As theravet was mentionning, I too have other cryptocurrencies that I starting to get annoy to update manually ... I'll try to work on the regex for Coingecko and/or coinmarketcap and see what i get ...

but this will still lead to 1 other issue : it will just do crypto ... not real investments (stocks, funds, etc.). The work around for this would be to another another source which will be named "Yahoo Currency (crypto)" but rename to "Yahoo Currency" when we want to gather the latest crypto quotes
alainpetit
Registered Member
Posts
12
Karma
0

Re: Currency Quotes

Wed Feb 21, 2018 1:02 pm
ipwizard wrote:Not via the UI. You can try to modify that directly in your data file. Make sure to have a backup of it before you fiddle around. Search for the following line:
Code: Select all
<CURRENCY symbol="BTC" saf="100" type="3" id="BTC" rounding-method="0" name="Bitcoin" scf="100" pp="4"/>
Change saf (Smallest Account Fraction) and scf (Smallest Cash Fraction) to e.g. 10000 to get 4 digits of precision. Don't change anything else. Do that while KMyMoney is not running.

Here's a bit of documentation regarding the file formats provided/used by KMyMoney.

What would be a good default for saf and scf for Bitcoins? We can certainly adjust the source for future users.



Sorry for the delay, and thanks for the advice, I did notice that this is for a data file saved in .xml format ... not .kmy but no worries .. that is indeed better to use that format is I want to specifically work on stuff. Changing the thing worked perfectly, and to answer your question, I would say 4 digits of precision is good for now (allow the granularity to be equivalent to more or less 1 USD). However, if development lead the way I think they will lead, I would be surprise that raising to 6 and or more would be better in the near future.

Rationale 1 : Increase in BTC value.
Rationale 2 : development of Lightning Network, allowing a better usage of IoT money-terization and payments (i.e. millions of sub-pennies transactions) ...

In Summary, keeping the door open would be good. How about working on a flexible way of expressing currencies, similar to what is frequently used in crypto world :
1 BTC / 1000 = 1 mBTC ;
1 mBTC / 1000 = 1 uBTC ;
1 uBTC / 100 = 1 sat (divided by one hundred indeed not a typo, special unit "satoshi")

Can KMymoney be wise enough to detect fractional unit so small (Or so big as well), and adjust with the appropriate Metric prefix ?

That being said I would assume that this could be a good addition to any currency. Expression a bank account in in 8-9 digit range could be useful as 15 787 K$.
grntbn
Registered Member
Posts
10
Karma
0

Re: Currency Quotes

Thu Apr 19, 2018 11:13 am
I've changed the setting of Yahoo Currency according the instructions from ipwizard and get the folloing error:

Preis für USD > EUR kann nicht aktualisiert werden (kein Preis oder kein Datum

 
Reply to topic

Bookmarks



Who is online

Registered users: Baidu [Spider], Bing [Bot], boudewijn, dmeszlender, Google [Bot], juku, Nayar, octavsly, redj, Sogou [Bot], toad, Yahoo [Bot]