Menu

Help with uk fund quotes

Anonymous
2010-10-23
2013-06-03
  • Anonymous

    Anonymous - 2010-10-23

    I'm new to perl, so I'm not sure if I'm missing something silly.
    I want to get uk fund quotes, ideally from trustnet, as the yahoo data seems to be 2 days out of date!
    I have managed to get results using yahoo_europe as the source, but I cannot get any results back from trustnet.
    I've tried several fund names, but the code below uses CF CYGNUS.

    1
    2
    3
    4
    5
    6
    7
    8
    9
    #!/usr/bin/perl
    # import module
    use Finance::Quote;
    # create object
    my $q = Finance::Quote->new();
    # retrieve stock quote
    my %data = $q->fetch('trustnet', 'CF CYGNUS');
    # print price
    print "The current price is:" . $data{'CF CYGNUS', 'price'};
    

    I have tried using the fund name, isin and sedol codes, but no data is returned.

    Am I doing somethig wrong?
    Is there a more reliable data source than trustnet for UK funds using this module?

    Thanks,

     
  • Martin Sadler

    Martin Sadler - 2011-01-30

    I've had similar trouble. I've developed a new module which implements "ftfunds" to access the Financial Times website at http://funds.ft.com. This module uses the MEXID to retrieve information. The MEXID is a 4-6 character code, eg. "FIAM" for Fidelity American fund. Using this site manually you can use (part of) the fund name, ISIN, SEDOL or MEXID to retirve fund data although as yet I've only been able to get the MEXID working. I use the site manually using the name/ISIN/SEDOL to find the MEXID.

    I'll post my module here on sourceforge.

     
  • Martin Sadler

    Martin Sadler - 2011-01-31

    Ok, I sent my module to bug-Finance-Quote@rt.cpan.org - hope that's the right place. This is my first attempt at submitting to Finance::Quote, or any other project for that matter.

    The module name is ftfunds.pm and implements the specific method "ftfunds" plus the failover "ukfunds" - I hope to find time to add other sources such as MorningStar UK and London Stock Exchange at some point in the future and to get ftfunds working with ISIN and SEDOL codes, too.

     
  • Martin Sadler

    Martin Sadler - 2011-01-31

    The ftfunds.pm module may be downloaded from…

    http://rt.cpan.org/Ticket/Display.html?id=65269

     
  • igk1

    igk1 - 2011-02-16

    Any guidance on how to get ftfunds.pm to work? Using Win32 I have downloaded the file and placed it in the C:\Perl\site\lib\Finance\Quote folder but I get a 'can't locate object method "new" via package "Finance::Quote:ftfunds" at line…' error. Perl 5.10.1

     
  • Martin Sadler

    Martin Sadler - 2011-02-16

    I was hoping that the project people would have issued a new release including ftfunds.pm and the necessary change to the "Quote.pm" module that sits in the next level up directory (…../Finance) - at least, that's where it sits on the Linux implementation that I use - I have no experience of Perl on Windows of any flavour.

    The change is simply to add "FTfunds" to the list of available services on lines 170-178 - here are the modified lines:

        @modules = qw/AEX AIAHK ASEGR ASX BMONesbittBurns Bourso Cdnfundlibrary
                Currencies Deka DWS FTPortfolios Fidelity FinanceCanada Fool HU
                GoldMoney HEX FTfunds
                IndiaMutual LeRevenu ManInvestments Morningstar NZX Platinum SEB
                StockHouseCanada TSP TSX Tdefunds Tdwaterhouse Tiaacref Troweprice
                Trustnet Union USFedBonds VWD ZA Cominvest Finanzpartner
                Yahoo::Asia Yahoo::Australia Yahoo::Brasil Yahoo::Europe Yahoo::NZ
                Yahoo::USA/; }

    If you'd prefer, send me your e-mail address (mailto: martinsadler@users.sourceforge.net) and I'll send you the updated Quote.pm by return.

    If you still have problems, please let me have the FULL error message, including the line number.

    Thanks for the interest in ftfunds.pm,

    Martin

     

Log in to post a comment.