[prev in list] [next in list] [prev in thread] [next in thread] 

List:       r-sig-finance
Subject:    [R-SIG-Finance] reqHistory
From:       Stephen Choularton <stephen () organicfoodmarkets ! com ! au>
Date:       2016-01-23 22:14:58
Message-ID: 56A3FB62.8000105 () organicfoodmarkets ! com ! au
[Download RAW message or body]

[Attachment #2 (text/html)]

<html>
  <head>

    <meta http-equiv="content-type" content="text/html; charset=utf-8">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    Hi<br>
    <br>
    I'm trying to download one years price history using this:<br>
    <br>
    This works perfectly:<br>
    <br>
    # prices from IBrokers<br>
    <br>
    library("IBrokers")<br>
    <br>
    # IBrokersRef()<br>
    <br>
    tws &lt;- twsConnect()<br>
    # reqCurrentTime(tws)<br>
    <br>
    <br>
    <br>
    contract &lt;- twsEquity('GLD', primary='ARCA', currency="USD")<br>
    <br>
    reqHistoricalData(tws, contract)<br>
    <br>
    but its for the 30 day limit period.<br>
    <br>
    So I try this:<br>
    <br>
    Sys.sleep(10) # mandatory 10s between request to avoid IB pacing
    violation<br>
    reqHistory(tws, Contract=contract, endDateTime = '20151231
    24:00:00', barSize='1 day', duration='1 Y')<br>
    <br>
    and I get an error:<br>
    <br>
    Error in reqHistoricalData(conn, Contract, barSize = barSize,
    duration = duration,  : <br>
      formal argument "endDateTime" matched by multiple actual arguments<br>
    &gt; <br>
    <br>
    although running it on the default looks as though it would work:<br>
    <br>
    &gt; reqHistory(tws, Contract=contract)<br>
    waiting for TWS reply on GLD .... done.<br>
    waiting for TWS reply on GLD .... done.<br>
    waiting for TWS reply on GLD .... done.<br>
    <br>
    <br>
    although I have never run it to conclusion.<br>
    <br>
    Can anyone tell me what I am doing wrong with the parameters in:<br>
    <br>
    reqHistory(tws, Contract=contract, endDateTime = '20151231
    24:00:00', barSize='1 day', duration='1 Y')<br>
    <br>
    Thanks<br>
    <br>
    <br>
    <br>
    <br>
    <br>
    <div class="moz-signature">-- <br>
      <div class="moz-signature">-----------------------------------------------------------------------------------------------------------------------------------


        <br>
        Stephen Choularton PhD, FIoD<br>
        0413 545 182<br>
        <br>
        <iframe src="http://www.organicfoodmarkets.com.au/signature.php"
          frame="0" moz-do-not-send="false" scrolling="no" height="300"
          width="650"></iframe>&gt; </div>
    </div>
  </body>
</html>



_______________________________________________
R-SIG-Finance@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-sig-finance
-- Subscriber-posting only. If you want to post, subscribe first.
-- Also note that this is not the r-help list where general R questions should go.

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic