That is strange - it did not work earlier and now it does! I thought it might 
be the quote marks, but it works either way, single or none, but not with 
double.

Thank you,

Regards,
Divakar


On 16/08/20 8:51 pm, John Ralls wrote:

On Aug 16, 2020, at 7:03 AM, Jour Maken 
<jourma...@outlook.com><mailto:jourma...@outlook.com> wrote:

This is an issue with F:Q accessed through Gnucash or gnc-fq-dump. A stock I 
need to retrieve quotes from Yahoo JSON has an ampersand in its code and hence 
fails to retrieve the correct prices. If someone has faced this and come up 
with a workaround, I would like to know, please. The code is M&M for Mahindra 
and Mahindra, and the links for the same are as follows:

https://www.nseindia.com/get-quotes/equity?symbol=M%26M

https://in.finance.yahoo.com/quote/M&M.NS?p=M&M.NS&.tsrc=fin-srch

I have tried escape sequence ‘M\&M.NS’, ‘M&amp;M.NS’ and ‘M%26M.NS’ but in each 
case quotes for just ‘M’ corresponding to Macy’s is retrieved in USD - my 
locale is set for INR currency.

Please advise,



The last works for me:

gnc-fq-dump yahoo_json 'M%26M.NS'
Finance::Quote fields Gnucash uses:
    symbol: M%26M.NS             <=== required
      date: 08/14/2020           <=== recommended
  currency: INR                  <=== required
      last: 614.45               <=\
       nav:                      <=== one of these
     price:                      <=/
  timezone:                      <=== optional

and
echo '(yahoo_json  "M%26M.NS")' | gnc-fq-helper
(("M%26M.NS" (symbol . "M%26M.NS") (gnc:time-no-zone . "2020-08-14 12:00:00") 
(last . #e614.45) (currency . "INR")))

I tried it in GnuCash. Worked there too.

Regards,
John Ralls



_______________________________________________
gnucash-user mailing list
gnucash-user@gnucash.org
To update your subscription preferences or to unsubscribe:
https://lists.gnucash.org/mailman/listinfo/gnucash-user
If you are using Nabble or Gmane, please see 
https://wiki.gnucash.org/wiki/Mailing_Lists for more information.
-----
Please remember to CC this list on all your replies.
You can do this by using Reply-To-List or Reply-All.

Reply via email to