Error in Finance:Quote

classic Classic list List threaded Threaded
10 messages Options
rs
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Error in Finance:Quote

rs
Hello:

On a Debian  testing machine, with Perl-5.26, I can get US stock prices, but strange errors trying to get Indian Mutual Funds or stock prices even in terminal. All instructions on installing pl module, editing Quote.pm file in /usr/share/perl5/Finance/ followed, yest get following what appear to be basic errors:

rs@debian:~/Documents$ gnc-fq-dump amfiindia 135765
Can't locate Finance/Quote/nseindia.pm in @INC (you may need to install the Finance::Quote::nseindia module) (@INC contains: /etc/perl /usr/local/lib/x86_64-linux-gnu/perl/5.26.0 /usr/local/share/perl/5.26.0 /usr/lib/x86_64-linux-gnu/perl5/5.26 /usr/share/perl5 /usr/lib/x86_64-linux-gnu/perl/5.26 /usr/share/perl/5.26 /usr/local/lib/site_perl /usr/lib/x86_64-linux-gnu/perl-base) at (eval 268) line 1, <DATA> line 1.
BEGIN failed--compilation aborted at (eval 268) line 1, <DATA> line 1.
 at /usr/bin/gnc-fq-dump line 148.
Can't locate object method "methods" via package "Finance::Quote::nseindia" (perhaps you forgot to load "Finance::Quote::nseindia"?) at /usr/share/perl5/Finance/Quote.pm line 119, <DATA> line 1.

Tried for days, and any help would be gratefully appreciated.

rs
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Error in Finance:Quote

John Ralls

> On Aug 11, 2017, at 8:31 PM, rs <[hidden email]> wrote:
>
> Hello:
>
> On a Debian  testing machine, with Perl-5.26, I can get US stock prices, but
> strange errors trying to get Indian Mutual Funds or stock prices even in
> terminal. All instructions on installing pl module, editing Quote.pm file in
> /usr/share/perl5/Finance/ followed, yest get following what appear to be
> basic errors:
>
> rs@debian:~/Documents$ gnc-fq-dump amfiindia 135765
> Can't locate Finance/Quote/nseindia.pm in @INC (you may need to install the
> Finance::Quote::nseindia module) (@INC contains: /etc/perl
> /usr/local/lib/x86_64-linux-gnu/perl/5.26.0 /usr/local/share/perl/5.26.0
> /usr/lib/x86_64-linux-gnu/perl5/5.26 /usr/share/perl5
> /usr/lib/x86_64-linux-gnu/perl/5.26 /usr/share/perl/5.26
> /usr/local/lib/site_perl /usr/lib/x86_64-linux-gnu/perl-base) at (eval 268)
> line 1, <DATA> line 1.
> BEGIN failed--compilation aborted at (eval 268) line 1, <DATA> line 1.
> at /usr/bin/gnc-fq-dump line 148.
> Can't locate object method "methods" via package "Finance::Quote::nseindia"
> (perhaps you forgot to load "Finance::Quote::nseindia"?) at
> /usr/share/perl5/Finance/Quote.pm line 119, <DATA> line 1.
>
> Tried for days, and any help would be gratefully appreciated.

Pretty simple: There's no nseindia.pm in Finance::Quote. There's an IndiaFunds.pm, try

gnc-fq-dump indiamutual foo

where 'foo' is the symbol for your stock or fund. There's no guarantee that it will work, the site (http://www.amfiindia.com/ <http://www.amfiindia.com/>) may not support your stock, may have changed their screen, or may no longer exist.

Regards,
John Ralls

_______________________________________________
gnucash-user mailing list
[hidden email]
https://lists.gnucash.org/mailman/listinfo/gnucash-user
-----
Please remember to CC this list on all your replies.
You can do this by using Reply-To-List or Reply-All.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Error in Finance:Quote

GnuCash - User mailing list
In reply to this post by rs
Rs,

I don't know exactly what your problem is, but I will ask the obvious: you *do* have nseindia.pm in your installation? F::Q seems to be unhappy about that...

I also note that there is a F::Q mailing list to which you might also direct your question. It's hosted through SourceForge.

David

On August 11, 2017, at 10:33 AM, rs <[hidden email]> wrote:

Hello:

On a Debian  testing machine, with Perl-5.26, I can get US stock prices, but
strange errors trying to get Indian Mutual Funds or stock prices even in
terminal. All instructions on installing pl module, editing Quote.pm file in
/usr/share/perl5/Finance/ followed, yest get following what appear to be
basic errors:

rs@debian:~/Documents$ gnc-fq-dump amfiindia 135765
Can't locate Finance/Quote/nseindia.pm in @INC (you may need to install the
Finance::Quote::nseindia module) (@INC contains: /etc/perl
/usr/local/lib/x86_64-linux-gnu/perl/5.26.0 /usr/local/share/perl/5.26.0
/usr/lib/x86_64-linux-gnu/perl5/5.26 /usr/share/perl5
/usr/lib/x86_64-linux-gnu/perl/5.26 /usr/share/perl/5.26
/usr/local/lib/site_perl /usr/lib/x86_64-linux-gnu/perl-base) at (eval 268)
line 1, <DATA> line 1.
BEGIN failed--compilation aborted at (eval 268) line 1, <DATA> line 1.
 at /usr/bin/gnc-fq-dump line 148.
Can't locate object method "methods" via package "Finance::Quote::nseindia"
(perhaps you forgot to load "Finance::Quote::nseindia"?) at
/usr/share/perl5/Finance/Quote.pm line 119, <DATA> line 1.

Tried for days, and any help would be gratefully appreciated.

rs



--
View this message in context: http://gnucash.1415818.n4.nabble.com/Error-in-Finance-Quote-tp4693217.html
Sent from the GnuCash - User mailing list archive at Nabble.com.
_______________________________________________
gnucash-user mailing list
[hidden email]
https://lists.gnucash.org/mailman/listinfo/gnucash-user
-----
Please remember to CC this list on all your replies.
You can do this by using Reply-To-List or Reply-All.
_______________________________________________
gnucash-user mailing list
[hidden email]
https://lists.gnucash.org/mailman/listinfo/gnucash-user
-----
Please remember to CC this list on all your replies.
You can do this by using Reply-To-List or Reply-All.
rs
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Error in Finance:Quote

rs
In reply to this post by rs
Thanks John and David.
I could resolve this error by using correct script of NseIndia in Quote.pm

But, still getting same error after using indiamutual (I tried multiple quotes available at http://portal.amfiindia.com/spages/NAV1.txt)
root@debian:/usr/share/perl5/Finance/Quote# gnc-fq-dump indiamutual 125112
=========================================
Finance::Quote fields Gnucash uses:
    symbol: 125112 (deduced)     <=== required
      date: ** missing **        <=== recommended
  currency: ** missing **        <=== required
Use of uninitialized value $last in printf at /usr/bin/gnc-fq-dump line 120,
        <DATA> line 1 (#1)
    (W uninitialized) An undefined value was used as if it were already
    defined.  It was interpreted as a "" or a 0, but maybe it was a mistake.
    To suppress this warning assign a defined value to your variables.
   
    To help you figure out what was undefined, perl will try to tell you
    the name of the variable (if any) that was undefined.  In some cases
    it cannot do this, so it also tells you what operation you used the
    undefined value in.  Note, however, that perl optimizes your program
    and the operation displayed in the warning may not necessarily appear
    literally in your program.  For example, "that $foo" is usually
    optimized into "that " . $foo, and the warning will refer to the
    concatenation (.) operator, even though there is no . in
    your program.
   
      last:                      <=\      
Use of uninitialized value $nav in printf at /usr/bin/gnc-fq-dump line 121,
        <DATA> line 1 (#1)
       nav:                      <=== one of these
Use of uninitialized value $price in printf at /usr/bin/gnc-fq-dump line 122,
        <DATA> line 1 (#1)
     price:                      <=/        
  timezone:                      <=== optional

** This stock quote cannot be used by GnuCash!
==========================================
lines 121 & 122 of /usr/bin/gnc-fq-dump are copied below:

  printf "       nav: %-20s <=== one of these\n", $nav;
  printf "     price: %-20s <=/        \n",  $price;

Any advice would be gratefully acknowledged.

rs
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Error in Finance:Quote

GnuCash - User mailing list
In reply to this post by rs
Rs,

I am not familiar with NSE India, but 125112 doesn't seem like a valid ticker symbol. The NSE India website seems to use letter symbols; does the equity you want have one?

David

On August 11, 2017, at 5:35 PM, rs <[hidden email]> wrote:

Thanks John and David.
I could resolve this error by using correct script of NseIndia in Quote.pm

But, still getting same error after using indiamutual (I tried multiple
quotes available at http://portal.amfiindia.com/spages/NAV1.txt)
root@debian:/usr/share/perl5/Finance/Quote# gnc-fq-dump indiamutual 125112
=========================================
Finance::Quote fields Gnucash uses:
    symbol: 125112 (deduced)     <=== required
      date: ** missing **        <=== recommended
  currency: ** missing **        <=== required
Use of uninitialized value $last in printf at /usr/bin/gnc-fq-dump line 120,
        <DATA> line 1 (#1)
    (W uninitialized) An undefined value was used as if it were already
    defined.  It was interpreted as a "" or a 0, but maybe it was a mistake.
    To suppress this warning assign a defined value to your variables.
   
    To help you figure out what was undefined, perl will try to tell you
    the name of the variable (if any) that was undefined.  In some cases
    it cannot do this, so it also tells you what operation you used the
    undefined value in.  Note, however, that perl optimizes your program
    and the operation displayed in the warning may not necessarily appear
    literally in your program.  For example, "that $foo" is usually
    optimized into "that " . $foo, and the warning will refer to the
    concatenation (.) operator, even though there is no . in
    your program.
   
      last:                      <=\      
Use of uninitialized value $nav in printf at /usr/bin/gnc-fq-dump line 121,
        <DATA> line 1 (#1)
       nav:                      <=== one of these
Use of uninitialized value $price in printf at /usr/bin/gnc-fq-dump line
122,
        <DATA> line 1 (#1)
     price:                      <=/        
  timezone:                      <=== optional

** This stock quote cannot be used by GnuCash!
==========================================
lines 121 & 122 of /usr/bin/gnc-fq-dump are copied below:

  printf "       nav: %-20s <=== one of these\n", $nav;
  printf "     price: %-20s <=/        \n",  $price;

Any advice would be gratefully acknowledged.

rs



--
View this message in context: http://gnucash.1415818.n4.nabble.com/Error-in-Finance-Quote-tp4693217p4693229.html
Sent from the GnuCash - User mailing list archive at Nabble.com.
_______________________________________________
gnucash-user mailing list
[hidden email]
https://lists.gnucash.org/mailman/listinfo/gnucash-user
-----
Please remember to CC this list on all your replies.
You can do this by using Reply-To-List or Reply-All.
_______________________________________________
gnucash-user mailing list
[hidden email]
https://lists.gnucash.org/mailman/listinfo/gnucash-user
-----
Please remember to CC this list on all your replies.
You can do this by using Reply-To-List or Reply-All.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

RE: Error in Finance:Quote

ChrisGood
In reply to this post by rs
> Message: 12

> Date: Fri, 11 Aug 2017 17:32:59 -0700 (PDT)
> From: rs <[hidden email]>
> To: [hidden email]
> Subject: Re: Error in Finance:Quote
> Message-ID: <[hidden email]>
> Content-Type: text/plain; charset=us-ascii
>
> Thanks John and David.
> I could resolve this error by using correct script of NseIndia in Quote.pm
>
> But, still getting same error after using indiamutual (I tried multiple
quotes
> available at http://portal.amfiindia.com/spages/NAV1.txt)
> root@debian:/usr/share/perl5/Finance/Quote# gnc-fq-dump indiamutual
> 125112 =========================================
> Finance::Quote fields Gnucash uses:
>     symbol: 125112 (deduced)     <=== required
>       date: ** missing **        <=== recommended
>   currency: ** missing **        <=== required
> Use of uninitialized value $last in printf at /usr/bin/gnc-fq-dump line
120,
> <DATA> line 1 (#1)
>     (W uninitialized) An undefined value was used as if it were already
>     defined.  It was interpreted as a "" or a 0, but maybe it was a
mistake.

>     To suppress this warning assign a defined value to your variables.
>
>     To help you figure out what was undefined, perl will try to tell you
>     the name of the variable (if any) that was undefined.  In some cases
>     it cannot do this, so it also tells you what operation you used the
>     undefined value in.  Note, however, that perl optimizes your program
>     and the operation displayed in the warning may not necessarily appear
>     literally in your program.  For example, "that $foo" is usually
>     optimized into "that " . $foo, and the warning will refer to the
>     concatenation (.) operator, even though there is no . in
>     your program.
>
>       last:                      <=\
> Use of uninitialized value $nav in printf at /usr/bin/gnc-fq-dump line
121,
> <DATA> line 1 (#1)
>        nav:                      <=== one of these
> Use of uninitialized value $price in printf at /usr/bin/gnc-fq-dump line
122,

> <DATA> line 1 (#1)
>      price:                      <=/
>   timezone:                      <=== optional
>
> ** This stock quote cannot be used by GnuCash!
> ==========================================
> lines 121 & 122 of /usr/bin/gnc-fq-dump are copied below:
>
>   printf "       nav: %-20s <=== one of these\n", $nav;
>   printf "     price: %-20s <=/        \n",  $price;
>
> Any advice would be gratefully acknowledged.
>
> rs
Hi rs,

It seems that NseIndia is not a standard module of Finance::Quote.
See the Finance::Quote github page [1].

Assuming you are not a perl programmer yourself, I suggest you contact
whoever wrote or provided NseIndia.pm and ask them to fix it.
Possibly they should hardcode the currency if that is not available on the
web page it uses. This is what ASX.pm does for Australian stocks. GnuCash
REQUIRES the currency.

[1]
https://github.com/finance-quote/finance-quote/tree/master/lib/Finance/Quote

Hope this helps,

Regards, Chris Good

_______________________________________________
gnucash-user mailing list
[hidden email]
https://lists.gnucash.org/mailman/listinfo/gnucash-user
-----
Please remember to CC this list on all your replies.
You can do this by using Reply-To-List or Reply-All.

smime.p7s (8K) Download Attachment
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Error in Finance:Quote

Frank H. Ellenberger-3
In reply to this post by GnuCash - User mailing list
Hi David,

Am 12.08.2017 um 03:31 schrieb D via gnucash-user:
> Rs,
>
> I am not familiar with NSE India, but 125112 doesn't seem like a valid ticker symbol. The NSE India website seems to use letter symbols; does the equity you want have one?
>
> David

Ticker symbols are specific for North America. Most exchanges use
security numbers instead.

Regards
Frank
_______________________________________________
gnucash-user mailing list
[hidden email]
https://lists.gnucash.org/mailman/listinfo/gnucash-user
-----
Please remember to CC this list on all your replies.
You can do this by using Reply-To-List or Reply-All.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Error in Finance:Quote

GnuCash - User mailing list
In reply to this post by rs
Ok, except that the NSE site seems to use ticker symbols.

On August 11, 2017, at 8:33 PM, "Frank H. Ellenberger" <[hidden email]> wrote:

Hi David,

Am 12.08.2017 um 03:31 schrieb D via gnucash-user:
> Rs,
>
> I am not familiar with NSE India, but 125112 doesn't seem like a valid ticker symbol. The NSE India website seems to use letter symbols; does the equity you want have one?
>
> David

Ticker symbols are specific for North America. Most exchanges use
security numbers instead.

Regards
Frank
_______________________________________________
gnucash-user mailing list
[hidden email]
https://lists.gnucash.org/mailman/listinfo/gnucash-user
-----
Please remember to CC this list on all your replies.
You can do this by using Reply-To-List or Reply-All.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Error in Finance:Quote

Frank H. Ellenberger-3
In reply to this post by rs
Hello,

Am 12.08.2017 um 02:32 schrieb rs:
> Thanks John and David.
> I could resolve this error by using correct script of NseIndia in Quote.pm
>
> But, still getting same error after using indiamutual (I tried multiple
> quotes available at http://portal.amfiindia.com/spages/NAV1.txt)
> root@debian:/usr/share/perl5/Finance/Quote# gnc-fq-dump indiamutual 125112

It is dangerous to enter the internet as root!

> =========================================
> Finance::Quote fields Gnucash uses:
>     symbol: 125112 (deduced)     <=== required
>       date: ** missing **        <=== recommended
>   currency: ** missing **        <=== required
> Use of uninitialized value $last in printf at /usr/bin/gnc-fq-dump line 120,
> <DATA> line 1 (#1)
>     (W uninitialized) An undefined value was used as if it were already
>     defined.  It was interpreted as a "" or a 0, but maybe it was a mistake.
>     To suppress this warning assign a defined value to your variables.
>    
>     To help you figure out what was undefined, perl will try to tell you
>     the name of the variable (if any) that was undefined.  In some cases
>     it cannot do this, so it also tells you what operation you used the
>     undefined value in.  Note, however, that perl optimizes your program
>     and the operation displayed in the warning may not necessarily appear
>     literally in your program.  For example, "that $foo" is usually
>     optimized into "that " . $foo, and the warning will refer to the
>     concatenation (.) operator, even though there is no . in
>     your program.
>    
>       last:                      <=\      
> Use of uninitialized value $nav in printf at /usr/bin/gnc-fq-dump line 121,
> <DATA> line 1 (#1)
>        nav:                      <=== one of these
> Use of uninitialized value $price in printf at /usr/bin/gnc-fq-dump line
> 122,
> <DATA> line 1 (#1)
>      price:                      <=/        
>   timezone:                      <=== optional
>
> ** This stock quote cannot be used by GnuCash!
> ==========================================
> lines 121 & 122 of /usr/bin/gnc-fq-dump are copied below:
>
>   printf "       nav: %-20s <=== one of these\n", $nav;
>   printf "     price: %-20s <=/        \n",  $price;
>
> Any advice would be gratefully acknowledged.
>
> rs

When I run with verbose flag, I get
gnc-fq-dump -v indiamutual 135765
Finance::Quote fields Gnucash uses:

    symbol: 135765 (deduced)     <=== required

      date: ** missing **        <=== recommended

  currency: ** missing **        <=== required

      last:                      <=\

       nav:                      <=== one of these

     price:                      <=/

  timezone:                      <=== optional



** This stock quote cannot be used by GnuCash!





All fields returned by Finance::Quote for stock 135765



stock           field  value

-----           -----  -----

135765       errormsg: HTTP failure

135765           last: **missing**

135765            nav: **missing**

135765          price: **missing**

135765        success: 0


'errormsg: HTTP failure' indicates the module did not get, what it expected.

Try to open
http://portal.amfiindia.com/NAVReport.aspx?type=0
in your browser and see. That is the URL, which the module calls.
So they changed something at amfiindia. You should watch it, to see, if
the issue is temporary or permanent.

If it is permanent, you or another user will have to find the new URL to
fix the module-

Regards
Frank
_______________________________________________
gnucash-user mailing list
[hidden email]
https://lists.gnucash.org/mailman/listinfo/gnucash-user
-----
Please remember to CC this list on all your replies.
You can do this by using Reply-To-List or Reply-All.
rs
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Error in Finance:Quote

rs
In reply to this post by rs
Thanks, Frank.
1. You were absolutely right in pointing that the URL on the IndiaMutual.pm was outdated. I changed it to the correct one, which is already listed as a reserve in the next line of .pm
http://portal.amfiindia.com/spages/NAV0.txt
& it works as a charm now! I have placed a record of this change in GitHub source of this module
https://github.com/finance-quote/finance-quote/blob/master/lib/Finance/Quote/IndiaMutual.pm

2. I still have issues with yahoo_json which does not return any value for Indian stocks using the symbols on https://in.finance.yahoo.com/lookup
for example:=====================
rs@debian:~/Documents$ gnc-fq-dump yahoo_json SBIN.NS
Finance::Quote fields Gnucash uses:
    symbol: SBIN.NS              <=== required
      date: ** missing **        <=== recommended
  currency: ** missing **        <=== required
      last:                      <=\      
       nav:                      <=== one of these
     price:                      <=/        
  timezone:                      <=== optional

** This stock quote cannot be used by GnuCash!
===============================
Any ideas as to how to resolve this ?
Loading...