Announcement

Collapse
No announcement yet.

Opening and closing prices

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

  • #16
    I wasn’t calling IsHistoryReady, but I am now, however the return value is never true in my tests.

    It won't be true the first time you run the app, but it often will be on subsequent runs if you haven't cleared the cache, or rebooted, etc.

    I am still perplexed as to why I am not getting all the stocks.

    Have you upgraded to the 7.7 release candidate?

    Cheers... George

    Comment


    • #17
      Here's some input from one of our engineers regarding this message:
      The following call will return the last 7 days worth of opening and closing prices for the stock “ES”:
      esignal.get_RequestHistory(“ES” ,”D”, IESignal.barType.btDAYS , 10, -1 , -1)
      There appears to be a strange relationship between the number of days worth of data that you request (10 in this example), and the number of days data that you will actually receive (7 in this example).
      I also found that data was not returned for all the stocks for which I requested a history. However, this was not predictable. For example, on my first run I received no data for the stock ‘WMT’, whereas on my 2nd run (which I ran only for the stocks for which data was not returned on the 1st run), I did receive data for ‘WMT’, but not for some other stocks (e.g. ‘ES’). On this run, I received a number of invalid handles in the OnBarsReceived Event.
      On another occasion, I received data for all stocks except two (‘ES’ and ‘ONE’).
      On another occasion, I received data for only a small number of stocks.
      Points in order:

      1. SetAbsoluteIndexing isn't required, it's something I added a little while ago at popular request. Historically, people have gotten bars by going from -(NUM-1) -> 0 with 0 being the most recent bar.

      2. The number of days is a straight date, whereas the number of bars depends on trading days and whatnot. 10 days could easily include three weekend days.

      3. You will continue to receive data on handles previously requested if you have not released them. Another convenient function for this is ReleaseAllHistory, if you don't want to call ReleaseHistory on each handle.

      4. Missing data; it's best to request data in batches. Here's a sample application that requests 500 symbols of history in batches of ten or whatever.



      Hope it helps.

      Comment


      • #18
        Thanks for your reply.
        For me, SetAbsoluteIndexing is required – if I don’t call it, for each stock I correctly get one bar representing the previous day’s opening and closing, plus a number of other bars (presumably one for each of the other days requested) which are all blank (all the values are zero).
        I take the point about about weekends etc., however for me it doesn’t work entirely correctly. When I requested ten days worth of data on 11th August, this was the relationship between the number of days requested and the number of days received:
        Number of Days requested Dates Received
        1 11th Aug (1)
        2 10th-11th Aug (2)
        3 10th-11th Aug (2)
        4 10th – 11th Aug (2)
        5 9th – 11th Aug (3)
        6 6th, 9th-11th Aug (4)
        7 5th – 6th, 9th – 11th Aug (5)
        I am using ReleaseAllHistory.
        The Esignal Stress Test application seems to work OK – I am successfully receiving all of the stocks in this application.

        Comment


        • #19
          Originally posted by geoff_olding
          For me, SetAbsoluteIndexing is required – if I don’t call it, for each stock I correctly get one bar representing the previous day’s opening and closing, plus a number of other bars (presumably one for each of the other days requested) which are all blank (all the values are zero).
          For those bars other than the first one (index zero), are you using negative indices? When not using absolute indexing, you want to do something like:

          GetBar(0); // most recent
          GetBar(-1); // previous bar
          GetBar(-2); // previous previous bar

          If you call GetBar(1), you will get empty data back, unless you are using absolute indexing and have data.

          Cheers... George

          Comment


          • #20
            Thanks - no I was using positive indexes

            Comment


            • #21
              IsHistoryReady()

              The examples use an if rather than a while loop waiting for the history. I am doing a charting app. and ran into this. My question then is if the while never succeds, then there should be a "Timeout" on these kind of tests?

              Comment


              • #22
                You can use a while and set a timeout. That's probably a good idea to account for any connectivity delays.

                Comment

                Working...
                X