You are here

GnuCash and getting stock quotes

7 posts / 0 new
Last post
waltnorth
Offline
Last seen: 11 years 2 months ago
Joined: 2013-01-17 17:38
GnuCash and getting stock quotes

Has anyone had any luck getting stock quotes retrieval to work from GnuCash. I have both GnuCash and Perl loaded as PortableApps. I suspect that GnuCash is not aware of the Perl install.

Does it need to find Perl at GnuCash install time or runtime or both?

Is there a GnuCash configuration that can be changed to find the PortableApps version of Perl?

I've looked at the other Financial programs but overall GNuCash seems to be the most complete if I can get stock quotes to work. However I did find that the other Finanical apps available are at least able to retrieve quotes.

stain
Offline
Last seen: 8 years 5 months ago
Joined: 2015-09-13 19:25
Yeah.

Yeah.
I've finally got it working.
Is of interest? If not I would try to explain later. The way I made was not two-step, would need more time to write.

ps
btw, what other financial apps did you find? Are any better than gnucash?

Wm ...
Offline
Last seen: 7 years 2 months ago
Joined: 2010-07-17 12:37
it is good to have an up to date record or recent experience

it is good to have an up to date record or recent experience, so feel free, I'll test as GnuCash is a main App for me and I want it to work portably for as many people as possible (JTH uses it too I think though I don't know if he uses Finance::Quote portably or locally).

We (PApps) have a number of other personal finance type applications but none that can be used for accounting in a grown up sense, with those you will always need someone else to actually do your accounting for you. Hey, some people using GnuCash need that too but it isn't *necessary* Smile

P.S. I think which perl you use may be the answer, I use a locally installed strawberry

Wm

stain
Offline
Last seen: 8 years 5 months ago
Joined: 2015-09-13 19:25
GnuCash 2.6.7

UPDATED 10-15-2015
GnuCash 2.6.9 (PortableApps.com)
Setting up online quotes and currency rates retrieval.

1. Install Perl_Portable_5.10.0.1_Development_Test_1_en_us.paf.exe
(https://portableapps.com/node/12595)
Select both Perl and Development modules

2. Launch Perl Portable console (in the PortableApps menu)
In the console follow to PortableApps\GnuCashPortable\App\GnuCash\bin\

3. In the 'bin' folder all gnc-fq-* files are perl scripts
Launch "perl -w gnc-fq-check"
If everything is fine it yields a list of sources of online rates
NOTE: IF gnc-fq-check works fine and GnuCash spits out System error instead of retrieving quotes, try "echo (yahoo "CSCO") | perl gnc-fq-helper" in Perl console. It will say more if there are errors.

4. If you dodn't get the list you have to manually install in the folder PortableApps\CommonFiles\Perl\site\lib\ the module below:
Finance-Quote-1.38.tar.gz - http://finance-quote.sourceforge.net/
and its dependencies. In my case the missing modules were (you may download them from CPAN search page at http://search.cpan.org):
Class-Singleton-1.5.tar.gz
Date-Manip-6.51.tar.gz
DateTime-1.20.tar.gz
DateTime-Locale-0.46.tar.gz
DateTime-TimeZone-1.93.tar.gz
Exporter-Tiny-0.042.tar.gz
HTML-Tree-5.03.tar.gz
JSON-2.90.tar.gz
List-MoreUtils-0.413.tar.gz
Module-Implementation-0.09.tar.gz
Module-Runtime-0.014.tar.gz
Mozilla-CA-20150826.tar.gz
Params-Validate-1.21.tar.gz
parent-0.234.tar.gz
Try-Tiny-0.22.tar.gz

5. After that. If in the console you get the proper sources list then the only thing you have to do is to set the environment for GnuCash

6. In PortableApps\GnuCashPortable\App\AppInfo\Launcher you have to edit the file GnuCashPortable.ini:
Section: [Environment]
Variable: PATH
To do: append %PAL:PortableAppsDir%\CommonFiles\Perl\bin before the last %PATH%
=== patch
--- GnuCashPortable.ini.original Mon Jul 06 19:29:32 2015
+++ GnuCashPortable.ini Sun Sep 13 22:52:05 2015
@@ -26,7 +26,7 @@
GNUCASH_VERSION_MAJOR=2
GNUCASH_VERSION_MINOR=6
GNUCASH_VERSION_MICRO=7
-PATH=%PAL:AppDir%\GnuCash\bin;%PAL:AppDir%\GnuCash\lib;%PAL:AppDir%\GnuCash\share\gnucash;%PATH%
+PATH=%PAL:AppDir%\GnuCash\bin;%PAL:AppDir%\GnuCash\lib;%PAL:AppDir%\GnuCash\share\gnucash;%PAL:PortableAppsDir%\CommonFiles\Perl\bin;%PATH%
HOME=%PAL:DataDir%\Profile
TMP=%PAL:DataDir%\Temp
LANGUAGE=%PAL:LanguageCustom%
=== /patch

7. Check. If in GnuCash Price Editor (menu Tools) 'Get rates' button is active then you have done it right.

Literally GnuCash launches the very same file 'gnc-fq-check' during initialization to get the sources list. You can clearly see that if you examine the file PortableApps\GnuCashPortable\App\GnuCash\share\gnucash\scm\gnucash\price-quotes.scm.
AND YOU SHOULDN'T launch PortableApps\GnuCashPortable\App\GnuCash\bin\install-fq-mods.cmd, though you're advised to do so in the documentation.

Wm ...
Offline
Last seen: 7 years 2 months ago
Joined: 2010-07-17 12:37
Super post

I'm going to have a think about it.

Have you actually made the change in step 6 ?

Also, there is a continuity issue. You've used a Dev Test perl. Now, the weird fact is that some dev tests are as good as Official Apps (I'm doing my best to get people to test someone else's SquirrelSQL, if people don't use it, it drops of the radar Sad ) and others get out of date

my perl is 5.18, are we going to say 5.10 (which you seem to be using at least to test) is the right one for future people that read this?

I don't think the perl version is significant for finance::quote *but* finance::quote is updated more frequently than you might think to include new exchanges, products and so on.

If you look in your perl dirs do you have (for example)
FTFunds.pm
and more recent additions?

I think the last point is significant because to the gnc user an up to date f::q is useless if it doesn't collect prices or other exchange info from the right exchange.

Wm

stain
Offline
Last seen: 8 years 5 months ago
Joined: 2015-09-13 19:25
Don't think, try

1. Yes. Right. I made the change in step 6. It adds perl bin-dir to PATH var. Otherwise GnuCash would never see perl. Compare:

-PATH=%PAL:AppDir%\GnuCash\bin;%PAL:AppDir%\GnuCash\lib;%PAL:AppDir%\GnuCash\share\gnucash;%PATH%
+PATH=%PAL:AppDir%\GnuCash\bin;%PAL:AppDir%\GnuCash\lib;%PAL:AppDir%\GnuCash\share\gnucash;%PAL:PortableAppsDir%\CommonFiles\Perl\bin;%PATH%

2. I don't insist that Perl 5.10 is the best choice. I just chose it between two packages available on portableapps. 5.10 seemed more logically packaged, it was linked from GnuCash portable support page. Moreover, in changelogs of portable GnuCash i read that in some earlier GC versions it was modified to check for perl in CommonFiles (that's right the way 5.10 was packaged). So, 5.10 was my choice for several reasons. And when you don't know where to search for, then you better trace back that. I thought that if I could implement it with 5.10 then let it be. Finally, I concluded that portable GnuCash 2.6.7 knows nothing of perl in CommonFiles so you can set the PATH var to any dir you like. Anyway 5.10 is quite ok to implement all that I need and it's more logically packaged. I didn't check whether 5.10 modifies registry or whether it is truly portable.

3. Do I have FTFunds.pm? I do. The thing is, 5.10 from portableapps.com came with old or even without Finance::Quote. First, I took Finance::Quote most recent stable release. Then ran the gnc-fq-check script and got missing dependency error. Then I took all the dependencies (one by one: take one, check all, take next) from cpan and manually installed them until I got no errors. Installing them automatically thru the cpan script in portable perl console gave tons of errors and worked quite messy and unportably (created directories for downloads and compilation where it shouldn't have to). That's why I did it manually.

4. Finance::Quote is the most recent stable version (and dependencies) to date there. The reason I listed modules with version numbers was that I can say from my side that combination of modules worked fine in GnuCash - in case others read it months later.

5. You may see the logic of how to get it working. Thus you may use any portable perl version you want. Just set GnuCash environment to point at it.

stain
Offline
Last seen: 8 years 5 months ago
Joined: 2015-09-13 19:25
Fix.

Mine've just stopped working.
gnc-fq-check works fine while GnuCash spits out System error while trying to update quotes.
Here is a description of a fix: http://notesofaprogrammer.blogspot.ru/2015/09/gnucash-encountered-system...
use "echo (yahoo "CSCO") | perl gnc-fq-helper" to check for errors if GnuCash doesn't work while gnc-fq-check does fine.
You should update Date::Manip perl module to version 6.51
Works fine then

Log in or register to post comments