Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to use SIX module from GnuCash #380

Closed
hhindriks opened this issue Apr 17, 2024 · 3 comments · Fixed by #381
Closed

Unable to use SIX module from GnuCash #380

hhindriks opened this issue Apr 17, 2024 · 3 comments · Fixed by #381

Comments

@hhindriks
Copy link

Today I installed v1.60 and was trying to use the SIX module to get the current price of UBSG from GnuCash.
Output of gnucash-cli (translated from German):

c:\...>gnucash-cli --quotes dump six UBSG
Finance::Quote fields GnuCash uses::
    symbol: **missing**   <=== required
      date: 04/17/2024    <=== recommended
  currency: USD           <=== required
      last: **missing**   <=\
       nav: **missing**   <=== one of these
     price: **missing**   <=/

adding the option --verbose shows that the call is indeed returning data. just not the fields GnuCash is expecting. I have no experience with perl but with the following modifications GnuCash was updating its price db using the module:

  • return symbol by adding the following line around line 75:
    $info{$symbol, 'symbol'} = $metarow->[$metamap{ValorSymbol}];
  • return last by adding the following line around line 97:
    $info{$symbol, 'last'} = $datarow->[$datamap{ClosingPrice}] if $datarow->[$datamap{ClosingPrice}];

the last issue I noted was the returned currency, e.g. USD instead of CHF, this was solved by replacing the line
$info{$symbol, 'currency'} = $metarow->[$metamap{NominalCurrency}];
with
$info{$symbol, 'currency'} = $metarow->[$metamap{TradingBaseCurrency}];

To investigate the valorid was returned as well (line 62):
$info{$symbol, 'valor'} = $valorid;

With these modifications all the shares and ETFs I am interested in return the expected quotes. - Thanks for all the work creating and maintaining Finance-Quote!

@bpschuck
Copy link
Contributor

The SIX.pm module has probably not been working for a long time. Not sure if this will get addressed or if the module will get dropped. Sorry.

@hhindriks
Copy link
Author

What else needs to be done? Adding the 3 lines from above the module works for me. Should I create a PR? Why drop a working module?

@bpschuck
Copy link
Contributor

Pre-release v1.60_01 pushed to CPAN.
BPSCHUCK/Finance-Quote-1.60_01.tar.gz

@bpschuck bpschuck linked a pull request Apr 19, 2024 that will close this issue
bpschuck added a commit that referenced this issue Apr 19, 2024
Add additional URL fetch to YahooJSON.pm
Also fixes SIX.pm - #380
bpschuck added a commit that referenced this issue Apr 19, 2024
	* SIX.pm - Changed lookup for currency, added lookups for symbol and last. Issue #380
	* YahooJSON.pm - URLs to retrieve required cookies and crumbs were changed to allow EU based users to use the module. Issue #373
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants