Announcement

Collapse
No announcement yet.

cant pull historical contracts?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • cant pull historical contracts?

    Using MS Access, I bulk send out requests for all the data I want at one time and then check ishistoryready. If not, I wait for the OnBarsChanged or OnBarsReceived to fire and then check ishistoryready. The example code I'm using is at the bottom of this post...

    The problem I am having is that I request information for
    BO H2004,D
    BO K2004,D
    BO Q2004,D
    BO N2004,D
    BO Z2004,D
    but the OnBarsReceived event is only firing for Q and Z. When I exclude Q and Z from the list, no events fire.

    Do you have any ideas what might be wrong? I was wondering if there was a licensing issue working here; however, I can pul up those earlier charts just fine in the esignal client.

    Also, the esignal.RequestHistory method does return valid handles for the earlier contracts.

    Thanks!







    HistHandles(lngCurrentCommand) = esignal.RequestHistory(ESigSymbol, ESigDuration, IESignal.btBARS, NUM_ADDT_BARS_TO_REQUEST + lngNumBars, -1, -1)
    If esignal.IsHistoryReady(HistHandles(i)) Then
    ProcESigRst HistHandles(ioo)
    End If
    Loop
    End Sub
    Public Sub esignal_OnBarsChanged(ByVal lHandle As Long)
    If esignal.IsHistoryReady(lHandle) Then ProcESigRst lHandle
    End Sub
    Public Sub esignal_OnBarsReceived(ByVal lHandle As Long)
    If esignal.IsHistoryReady(lHandle) Then ProcESigRst lHandle
    End Sub
    Last edited by cmcdowell; 11-11-2004, 08:31 AM.

  • #2
    more investigation

    I've created a sample Access database project in the attached zip file to demonstrate the problem.

    Essentially, if esignal is not up and running, when you start processing in the sample application, esignal will open and the feedback screen will tell you that 4 history requests were submitted and valid handles were returned. As shown below:

    >> Requested bars for BO H2004,D (handle:4)
    >> Requested bars for BO K2004,D (handle:3)
    >> Requested bars for BO N2004,D (handle:2)
    >> Requested bars for BO Q2004,D (handle:1)
    >> ENTITLED!

    However, then it sits there doing nothing... Until you go to the esignal client, open a chart and open one of the commodities specified. For instance, typing in "BO H2004" and looking at daily ("D") data on the chart will immediately send the bars recieved message to the access database. The associated display in the database is shown below:

    >> Processing data for BO H2004 (Rows Returned: 10)
    >> Received information: BO H2004
    >> Handle 4 is ready for processing.
    >> Message OnBarsRecieved (handle:4)

    This behavior is only apparent with these commodity contracts and does not occur if you change them to stocks. You can change the commodities it looks at on line 149 of the code. If they are changed to stocks, then the program works as expected.

    The database is in Access 2000 format. If anyone has any ideas on how to make this work, please let me know.


    P.S. Yes, if you run this multiple times without shutting down the esignal client, the commodities stay in the cache and do get returned without the user having to pull up the specific chart...

    P.P.S. REMEMBER TO CHANGE THE esignal.SetApplication LINE IN THE CODE TO YOUR USERNAME - otherwise, it won't work.
    Attached Files
    Last edited by cmcdowell; 11-11-2004, 08:49 AM.

    Comment


    • #3
      Issues with past contracts and FX rates

      I've made some changes to the tester application to make it more easy to change the entitlement name and select a list of commodities.

      Some things I noticed in testing was that typically only the older contracts do not return data.

      Also, sometimes currency exchange rates (JPY A0-FX) come back with 0 bars which is ridiculous.
      Attached Files

      Comment


      • #4
        There not a bug in the API, but rather an error in the function call you are making. In your sample, you are asking for 100 bars of daily data for a contract that expired on May 14, which is around 150 days ago. That is why you are not getting data. Everything will work great if you change your function call from:

        HistHandles(i) = esignal.RequestHistory(ESigSymbols(i), "D", IESignal.btBARS, 100, -1, -1)

        to:

        HistHandles(i) = esignal.RequestHistory(ESigSymbols(i), "D", IESignal.btDAYS, 200, -1, -1)

        I have re-attached your sample with the necessary changes.
        Attached Files

        Comment


        • #5
          I have verified these results. Using btDAYS is not necessary, the btBARS works fine as long as the number of bars you request is selected to be from today's date, not the last trading day.

          With the 'OnBars' received event firing now, I have not been able to reproduce the exchange rates returning with 0 bars problem.

          THANK YOU ROBI!

          FYI, Robi also explained how displaying the non-returning contract in the eSignal client will cause the 'OnBars' event to receive the rows correctly. It sounds like if you requesthistory for 30 bars on a commodity who's last trading day was 40 days ago, then requesthistory sits there waiting becuase it doesn't have any bars for 30 days ago and requesthistory doesn't know that the contract's last trading day has already passed. When you try to pull up the chart in the esignal client, the esignal client determines when the last trading day was and somehow the requesthistory server also picks up that info and fires 'OnBars'.

          Comment

          Working...
          X