<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <div class="moz-cite-prefix">On 10/26/2013 12:06 AM, Thomas Baumgart
      wrote:<br>
    </div>
    <blockquote cite="mid:2207329.or5uc0OWmN@thb-nb.site" type="cite">
      <pre wrap="">Hi,

On Wednesday 23 October 2013 22:00:22 Koos Pol wrote:

</pre>
      <blockquote type="cite">
        <pre wrap="">Good evening all,

Is it possible to automatically update the prices of currencies and stocks?
For instance by cron? Or update once a week but also download the prices
for all intermediate days? I find myself firing up KMM everynight just to
keep an eye on my stock portfolio. (granted, I should probably use a stock
program for this ;-)
</pre>
      </blockquote>
      <pre wrap="">
No, unfortunately this is currently not supported, though thoughts have 
already been spent as part of the Alkimia project. Even some source code for 
such feature already exists but is not integrated/used yet.

</pre>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
KMyMoney mailing list
<a class="moz-txt-link-abbreviated" href="mailto:KMyMoney@kde.org">KMyMoney@kde.org</a>
<a class="moz-txt-link-freetext" href="https://mail.kde.org/mailman/listinfo/kmymoney">https://mail.kde.org/mailman/listinfo/kmymoney</a>
</pre>
    </blockquote>
    My workaround is using the following perl script on linux and the
    import into Kmymoney.  Put your symbols into @syms.  I would like to
    pass a parameter to read a text or xml file of the ticker symbols,
    but this is low on my priority.  I also pasted in a scirpt that will
    backfill dates not currently in kymoney.<br>
    <br>
    Have fun.<br>
    <br>
    Joe<br>
    <br>
    <br>
    #!/usr/bin/perl -w
<br>
     <br>
    #***************************************************************************
    
<br>
    # fy-qif.pl - description
<br>
    # -------------------
<br>
    # begin : Sat 10 Feb 2012
<br>
    # copyright : (C) 2012 by Joe W. Byers
<br>
    # email : <a class="moz-txt-link-abbreviated" href="mailto:ecjbosu@aol.com">ecjbosu@aol.com</a><br>
    #
<br>
    #***************************************************************************/
    
<br>
    #
<br>
    #***************************************************************************
    
<br>
    #* *
<br>
    #* This program is free software; you can redistribute it and/or
    modify *
<br>
    #* it under the terms of the GNU General Public License as published
    by *
<br>
    #* the Free Software Foundation; either version 2 of the License, or
    *
<br>
    #* (at your option) any later version. *
<br>
    #* *
<br>
    #***************************************************************************/
    
<br>
     <br>
    # Simple script to download security prices from finance.yahoo and
    create a 
<br>
    # qif format for KMyMoney2.
<br>
    # Run by ''./fy-qif.pl' .
<br>
    # You are required to specify a directory and file location in line 
    57.
<br>
    # You should edit the list of security symbols in line 42.
<br>
    # This file can be scheduled as a cron job if needed
<br>
     <br>
    # Output format -
<br>
    # !Type:Prices
<br>
    # "HJU8.BE",61.62,"23.12.09"
<br>
    # ^
<br>
     <br>
    # This uses perl-Finance-YahooQuote
<br>
    # Copyright (C) 2002 Dirk Eddelbuettel <a class="moz-txt-link-rfc2396E" href="mailto:edd@debian.org"><edd@debian.org></a>, and
    GPL'ed
<br>
    # Based on the original example by Dj Padzensky
<br>
    #
<br>
    # $Id: yahooquote,v 1.2 2002/12/24 17:50:28 edd Exp $
<br>
     <br>
    #Todo: create a file read to read a file
<br>
     <br>
    #use strict;
<br>
    use Getopt::Long;
<br>
    use Finance::YahooQuote;
<br>
    @syms=(WMB,AAON,CSCO,EP,FLVCX,FSCGX,ISSC,MSFT,NOEQX,NOSIX,NTCHX,PG,RHT,SLR,FCNTX,FPURX,FJPNX,FSENX,OSMVX,ALU,TCLFX,FSLBX,FDFAX,FDIVX,ARTMX,EPD,FDGFX,OBFVX,TCLFX,OBBC,FDIKX,FDGFX);
    
<br>
     <br>
    my $verbose = 0;
<br>
    #GetOptions("verbose" => \$verbose);
<br>
     <br>
    #die "Usage: $0 [--verbose] symbol [symbol ...]\n" if $#ARGV == -1;
<br>
     <br>
    my @h = ("Symbol","Name","Last","Trade Date","Trade
    Time","Change","% Change",
<br>
         "Volume","Avg. Daily Volume","Bid","Ask","Prev. Close","Open",
<br>
         "Day's Range","52-Week Range","EPS","P/E Ratio","Div. Pay
    Date",
<br>
         "Div/Share","Div. Yield","Mkt. Cap","Exchange");
<br>
     <br>
    $Finance::YahooQuote::TIMEOUT = 30;
<br>
     <br>
    my @q = getquote(@syms);
<br>
    $file = "/var/datadl/quotes.csv";
<br>
    open(FH, ">> $file") || die $!;
<br>
    foreach $a (@q) {
<br>
    print FH "!Type:Prices\n";
<br>
      foreach (0..$#h) {
<br>
        if ($verbose) {
<br>
          print "$h[$_]: $$a[$_]\n";
<br>
        } else {
<br>
          print FH "\"$$a[$_]\"," if $h[$_] =~ /(Symbol)/m;
<br>
          print FH "\"$$a[$_]\"\n" if $h[$_] =~ /(Trade Date)/m;
<br>
    #      print FH "$$a[$_]\n" if $h[$_] =~ /(Symbol)/m;
<br>
          print FH "$$a[$_]," if $h[$_] =~ /(Last)/m;
<br>
        }
<br>
      }
<br>
      print FH "^\n";
<br>
    }
<br>
    close(FH);<br>
    <br>
    backfill history of uquoted.<br>
    #!/usr/bin/perl -w
<br>
     <br>
    #***************************************************************************
    
<br>
    # fy-qif.pl - description
<br>
    # -------------------
<br>
    # begin : Sat 10 Feb 2012
<br>
    # copyright : (C) 2012 by Joe W. Byers
<br>
    # email : <a class="moz-txt-link-abbreviated" href="mailto:ecjbosu@aol.com">ecjbosu@aol.com</a>
<br>
    #
<br>
    #***************************************************************************/
    
<br>
    #
<br>
    #***************************************************************************
    
<br>
    #* *
<br>
    #* This program is free software; you can redistribute it and/or
    modify *
<br>
    #* it under the terms of the GNU General Public License as published
    by *
<br>
    #* the Free Software Foundation; either version 2 of the License, or
    *
<br>
    #* (at your option) any later version. *
<br>
    #* *
<br>
    #***************************************************************************/
    
<br>
     <br>
    # Simple script to download security prices from finance.yahoo and
    create a 
<br>
    # qif format for KMyMoney2.
<br>
    # Run by ''./fy-qif.pl' .
<br>
    # You are required to specify a directory and file location in line 
    57.
<br>
    # You should edit the list of security symbols in line 42.
<br>
    # This file can be scheduled as a cron job if needed
<br>
     <br>
    # Output format -
<br>
    # !Type:Prices
<br>
    # "HJU8.BE",61.62,"23.12.09"
<br>
    # ^
<br>
     <br>
    # This uses perl-Finance-YahooQuote
<br>
    # Copyright (C) 2002 Dirk Eddelbuettel <a class="moz-txt-link-rfc2396E" href="mailto:edd@debian.org"><edd@debian.org></a>, and
    GPL'ed
<br>
    # Based on the original example by Dj Padzensky
<br>
    #
<br>
    # $Id: yahooquote,v 1.2 2002/12/24 17:50:28 edd Exp $
<br>
     <br>
    #Todo: create a file read to read in security symbols
<br>
     <br>
    #use strict;
<br>
    use Getopt::Long;
<br>
    use Finance::QuoteHist::Yahoo;
<br>
    use HTTP::Date;
<br>
    use DateTime;
<br>
    use DateTime::Format::Flexible;
<br>
     <br>
    #@syms=qw("WMB AAON");
<br>
    # CSCO EP FLVCX FSCGX ISSC MSFT NOEQX NOSIX NTCHX PG RHT SLR
<br>
    #        FCNTX FPURX FJPNX FSENX OSMVX ALU TCLFX FSLBX FDFAX FDIVX
    ARTMX EPD FDGFX OBFVX TCLFX 
<br>
    #        OBBC FDIKX FDGFX");
<br>
    $padlen = 2;
<br>
     <br>
     <br>
    #print "@syms";
<br>
     <br>
    my $verbose = 0;
<br>
    my $q = new Finance::QuoteHist::Yahoo (
<br>
        symbols    => [qw("WMB AAON CSCO EP FLVCX FSCGX ISSC MSFT
    NOEQX NOSIX NTCHX PG RHT SLR
<br>
            FCNTX FPURX FJPNX FSENX OSMVX ALU TCLFX FSLBX FDFAX FDIVX
    ARTMX EPD FDGFX OBFVX TCLFX 
<br>
            OBBC FDIKX FDGFX")],
<br>
            start_date => '1/1/2010',
<br>
        end_date   => 'today'
<br>
        );
<br>
     <br>
    $file = "/var/datadl/quoteshist.csv";
<br>
    open(FH, ">> $file") || die $!;
<br>
     <br>
     <br>
    #values
<br>
    foreach $row ($q->quotes()) {
<br>
      print FH "!Type:Prices\n";
<br>
        ($symbol, $date, $close) = @$row;
<br>
    #print "$symbol\n";
<br>
          print FH "Y$symbol" . ",";
<br>
          $yr=substr($date,0,4);
<br>
          $mm = substr($date,5,2);
<br>
          $mm = sprintf("%0${padlen}d", $mm);
<br>
          $dd = substr($date,8,2);
<br>
          #$dd=sprintf("%0${padlen}d", $d);
<br>
          #print "$date\n";
<br>
          print FH "  $mm/$dd/$yr" . "\n";
<br>
          print FH "I$close\n";
<br>
          print FH "^\n";
<br>
     <br>
    #  print @$row["$symbol"]; print "=="; print @$row[ "$date"] ; 
<br>
     <br>
    }
<br>
    close(FH);<br>
    <div class="moz-signature">-- <br>
      <b>Joe W. Byers</b><br>
    </div>
  </body>
</html>