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

Wrong quote retrieved when syock symbol contains '&' #202

Closed
bpschuck opened this issue Mar 5, 2022 · 3 comments · Fixed by #220
Closed

Wrong quote retrieved when syock symbol contains '&' #202

bpschuck opened this issue Mar 5, 2022 · 3 comments · Fixed by #220
Assignees

Comments

@bpschuck
Copy link
Contributor

bpschuck commented Mar 5, 2022

From https://rt.cpan.org/Ticket/Display.html?id=133159:

Finance:: Quote retrieves quote for ‘M’ corresponding to Macy’s instead of ‘M&M.NS’. The stock symbol stands for Mahindra & Mahindra, an Indian auto company (https://www.nseindia.com/get-quotes/equity?symbol=M%26M).

bschuck@valhalla:~$ gnc-fq-dump yahoo_json M
Finance::Quote fields Gnucash uses:
    symbol: M                    <=== required
      date: 03/04/2022           <=== recommended
  currency: USD                  <=== required
      last: 24.8                 <=\       
       nav:                      <=== one of these
     price:                      <=/        
  timezone:                      <=== optional

bschuck@valhalla:~$ gnc-fq-dump yahoo_json 'M&M.NS'
Finance::Quote fields Gnucash uses:
    symbol: M&M.NS               <=== required
      date: 03/04/2022           <=== recommended
  currency: USD                  <=== required
      last: 24.8                 <=\       
       nav:                      <=== one of these
     price:                      <=/        
  timezone:                      <=== optional

bschuck@valhalla:~$ gnc-fq-dump yahoo_json 'M%26M.NS'
Finance::Quote fields Gnucash uses:
    symbol: M%26M.NS             <=== required
      date: 03/04/2022           <=== recommended
  currency: INR                  <=== required
      last: 732.3                <=\       
       nav:                      <=== one of these
     price:                      <=/        
  timezone:                      <=== optional

FYI - Attempts to use Alphavantage method did not work.

bschuck@valhalla:~$ gnc-fq-dump alphavantage 'M\&M.NS'
Finance::Quote fields Gnucash uses:
  symbol: M\&M.NS (deduced)    <=== required
    date: ** missing **        <=== recommended
currency: ** missing **        <=== required
    last:                      <=\       
     nav:                      <=== one of these
   price:                      <=/        
timezone:                      <=== optional

** This stock quote cannot be used by GnuCash!

bschuck@valhalla:~$ gnc-fq-dump alphavantage 'M%26M.NS'
Can't use an undefined value as a HASH reference at /home/bschuck/PerlLibs/Finance/Quote/AlphaVantage.pm line 228.
@bpschuck
Copy link
Contributor Author

bpschuck commented Apr 18, 2022

I just realized the initial reporter on rt.cpan.org did not specify which source was being utilized. While the quote is available using the YahooJSON module, it is not a security offered in data from AlphaVantage and other sources.

@bpschuck bpschuck self-assigned this Jul 12, 2022
@bpschuck
Copy link
Contributor Author

This should be satisfied in PR #220

@bpschuck bpschuck linked a pull request Jul 21, 2022 that will close this issue
@bpschuck
Copy link
Contributor Author

bpschuck commented Jul 21, 2022

Corrected in PR #220

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.

1 participant