Registered Member
|
I cannot get right Japanese stock price data from MSN.
My online quotes setting is as a following. URL: http://ca.moneycentral.msn.com/investor ... ?symbol=JP:%1 Symbol: (blank) Price: (\d+,\d+) [+-]\d+ [+-]\d+.\d+\% Date: Time of last trade (\d+/\d+/\d+) Date Format: %d %m %y KMyMoney fetch wrong price data as below. i.e. TOYOTA: trading symbol = 7203 Fetching URL http://ca.moneycentral.msn.com/investor ... =JP:7203... Symbol found: Price found: 3.340 (3.34) Date found: 金 4 8 2011 Price for 7203 updated (id E000003) But TOYOTA's right price is 3340 at 10 April. How to get right price? Thanks |
Registered Member
|
KMM is interpreting the comma as a separator of decimals rather than thousands. I could be wrong here, but I think KMM follows your system settings (Common Appearance -> Locale -> Numbers, depending on your OS).
|
Registered Member
|
|
KDE Developer
|
I don't think that this will help. From the source:
Well, this assumption is not valid for the Japanese quotes. Guess we have to take care of them in the future.
ipwizard, proud to be a member of the KMyMoney forum since its beginning.
openSuSE Leap 15.4 64bit, KF5 |
Registered Member
|
This is a Canadian website and a Japanese quote. So, is that comment still valid?
Shouldn't toki use a Japanese site, such that his local settings match the format of the web site? BTW I can't get a quote using toki's URL. |
KDE Developer
|
You need to activate the 'Skip HTML' option. Any site not using a thousand separator should work.
ipwizard, proud to be a member of the KMyMoney forum since its beginning.
openSuSE Leap 15.4 64bit, KF5 |
Registered Member
|
Thanks for your reply, zebulon and ipwizard.
I changed decimal and thousand separator in OS local settings, but still got wrong price. I doubt fetch data is using comma as a thousand separator. Why I used Canadian site for fetching. When I used Japanese site, I cannot recognize there are many matter or differences, multi byte character code, format, regular description. Then I used Canadian MSN that can show us Japanese stock price. Valid URL(This time I used URL function in this forum) http://ca.moneycentral.msn.com/investor/quotes/quotes.aspx?symbol=JP:7203 URL setting in Online quotes
By the way, if you know other stock price site that can show Japanese stock price in Europa, let me know it. Thanks |
Registered Member
|
If I may ask, what is the trading symbol of this stock, and how did you define the Online Update (investment detail wizard)? I'd like to try a couple of things.
|
KDE Developer
|
You can certainly try, but you won't succeed unless you are able to remove the optional comma. The code that is executed also does this
before the string is converted into a numeric value.
ipwizard, proud to be a member of the KMyMoney forum since its beginning.
openSuSE Leap 15.4 64bit, KF5 |
Registered Member
|
zebulon, Toyota's trading symbol is 7203.
By the way, I will be looking for other stock site that is not using a thousand separator. |
Registered Member
|
My intention was to try using Finance::Quote. The scripts it uses are easy to modify if necessary. However, I did not yet succeed getting a quote at all this way. Concerning MSC.CA, I can't get an online quote either. Does anybody have an idea what I am doing wrong? I defined The Toyota investment with trading symbol "JP:7203", full name "TOYOTA MOTOR CORP". In he online update panel, I do not check Finance::Quote but select MSN.CA. It is unable to get a price though. BTW: the URL echoed in the status window is correct and works if pasted in the address bar of a browser. |
Registered Member
|
It seems that Tokyo stock exchange commonly uses commas as thousand separator: I defined a new online quote source for Bloomberg, same issue.
@ipwizard: I second the suggestion to address the 'comma-is-thousands-separator' issue as soon as possible. @zebulon: I also like to try Finance::Quote as workaround. It seems that these scripts are highly adaptable to any kind of format. What did you try already? |
Registered Member
|
I mainly use it for the French stock market. The problem is that the scripts need to be adapted every time a web site changes its layout. You can find updated scripts on the web, e.g. on github. I use a perl script to test these Finance::Quote scripts
|
Registered Member
|
Thanks. In addition to the yahoo module, that you use in your example, I also have
DWS.pm LeRevenu.pm Troweprice.pm AIAHK.pm Fidelity.pm ManInvestments.pm Trustnet.pm ASEGR.pm FinanceCanada.pm Morningstar.pm TSP.pm ASX.pm Finanzpartner.pm NZX.pm TSX.pm BMONesbittBurns.pm Fool.pm Platinum.pm Union.pm Bourso.pm FTPortfolios.pm SEB.pm UserAgent.pm Cdnfundlibrary.pm GoldMoney.pm StockHouseCanada.pm USFedBonds.pm Cominvest.pm HEX.pm Tdefunds.pm VWD.pm Currencies.pm HU.pm Tdwaterhouse.pm Deka.pm IndiaMutual.pm Tiaacref.pm ZA.pm It seems I need to write an additional module for Japanese stocks, e.g. MSN-CA-for-Japan.pm or Tokyo-Stock-Exchange.pm Not what i hoped for, but a reason to start perl (in addition to C++ and Basic dialects). Or has anybody already a module for MSN.CA ? |
Registered Member
|
Meanwhile I wrote a perl script, i.e., a Finance:Quote module, to retrieve stock prices from the official website of the Tokyo stock exchange (http://www.tse.or.jp/english). This website has two shortcomings:
If you find the script useful, please let me know (by posting in this forum or by PM). Equally or more important, let me know if you find bugs, or if you know a more reliable webpage for Tokyo stock exchange prices. File: save the code below in TokyoStockExchange.pm, then proceed as per instructions in that file (see bottom half).
|
Registered users: Bing [Bot], blue_bullet, Google [Bot], rockscient, Yahoo [Bot]