Created attachment 172854 [details] testcase SUMMARY Currency conversion rates can be found e.g. from yahoo with the following url https://query1.finance.yahoo.com/v7/finance/download/%1-%2?events=history&includeAdjustedClose=true. An example of this is BTC -> EUR. The problem, however, is that it does not work the other way around, as can be seen in the attached example. STEPS TO REPRODUCE 1. start kmymoney 2. Add an new online quote named "User" (systems with english language) or "Benutzer" (german language) with URL: https://query1.finance.yahoo.com/v7/finance/download/%1-%2?events=history&includeAdjustedClose=true Download mode: Default Data format: CSV Identifier: Select by: Symbol Price: Close Price decimal separator: Period (.) Date: Date Date format: %y-%m-%d Default identifier: EUR-USD Remote source: not checked 2. load appended test case 3. add account Name: "checking (BTC)" select "Online quotes" OBSERVED RESULT A message box appears that the update failed. EXPECTED RESULT This message should not appear and the update should finish without errors. SOFTWARE/OS VERSIONS Linux: openSUSE Leap 15.5 KDE Frameworks Version: 5.102 Qt Version: 5.15.8 ADDITIONAL INFORMATION The problem is that the desired direction EUR -> BTC is not supported by the remote source. The reverse direction, on the other hand, is available. There should be a possibility that after a failed request, a new request is made with a reversed direction and, if successful, the returned price is inverted.
(In reply to Ralf Habacker from comment #0) > ADDITIONAL INFORMATION > The problem is that the desired direction EUR -> BTC is not supported by the > remote source. The reverse direction, on the other hand, is available. There > should be a possibility that after a failed request, a new request is made > with a reversed direction and, if successful, the returned price is inverted. To add such a function, the following points should be noted: 1. should online listings allow reverse search by default ? 2. adding the reverse search after the first search has failed requires an internal refactoring so that errors that occur during the first search are not forwarded directly to the application and thus already trigger error processing. 3. a simpler alternative to 2. would be to manage a list of currency assignments in the online source, which is used to control the direction of a query.
The problem is even worse. All I get in both directions is: {"finance":{"result":null,"error":{"code":"unauthorized","description":"User is not logged in"}}} I doubt that there is a short term solution.
This issue has been reported for example at https://www.reddit.com/r/sheets/comments/1farvxr/broken_yahoo_finance_url/?rdt=38351. Yahoo changed the url and the output format to json, see https://query2.finance.yahoo.com/v8/finance/chart/BTC-EUR?events=history&includeAdjustedClose=true for an example.
A possibly relevant merge request was started @ https://invent.kde.org/office/alkimia/-/merge_requests/50
Git commit 07b92d7e646e26982efa5e6ca39aaa573bb11a2b by Ralf Habacker. Committed on 29/10/2024 at 21:17. Pushed by habacker into branch 'master'. Add support for reverse online quote search If a request for the rate of a conversion is not successful, a search with swapped symbols will be carried out afterwards, if activated, which can increase the success rate. As we are about to freeze the user interface, no changes to the user interface will be introduced with this commit. FIXED-IN:8.2 M +11 -15 src/alkonlinequote.cpp M +18 -0 src/alkonlinequote.h M +51 -1 src/alkonlinequote_p.cpp M +4 -0 src/alkonlinequote_p.h https://invent.kde.org/office/alkimia/-/commit/07b92d7e646e26982efa5e6ca39aaa573bb11a2b