Announcement

Collapse
No announcement yet.

Find out with historyHandle

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

  • Find out with historyHandle

    Can anyone help me, please ?

    I'm trying to request the closing prices of 2 symbols. I use the RequestHistory-Function to receive the reply (VB-Code is following). That's NO problem, it works!

    historyHandle = esignal.RequestHistory(symbol, "D", btDAYS, 2, -1, -1)

    When I receive the reply from eSignal, it's calling the esignal_OnBarsReceived-Function. So that is also OK.

    But how can I discover the name of the symbol, because I only have the historyHandle (a number) in the esignal_OnBarsReceived-Function ???

    Why I want this feature. Because I would like to save the closing price and the corresponding symbolname (not the historyHandle)
    in a datastructure.

    Thx...

  • #2
    Hi
    The handle is all you will ever see.
    Whenever you get a handle, you must associate it with your symbol and store it away, e.g in a list.
    When bars come in, you retrieve the symbol associated with the handle, and there you go.
    You'll get used to it.

    Comment


    • #3
      But my opinion is, that a list is not a secure solution. Because when I receive the reply before I could save the handle in a list. In some cases, the reply is faster than I could save the handle. That's the real problem. So when the esignal_OnBarsReceived-function is calling, I can't identify the symbol, because the handle is not in my list.

      Does it gives any other solutions?

      Thx...

      Comment


      • #4
        Here is a code snippet to show you how I handle your question:
        '**** This a portion of the Handler code: I have an array that stores the data received from eSignal - when the Handler is exited, the mainline code retrieves the data from the assigned array sector. In the mainline code, before I issued the call to eSignal for data, I requested the Handle ID and then assigned a section of the array to the HandleID. All of the data items are available here, including the Ticker. Note that I test for the Handler being entered with Bars, but no data passed to the Handler.


        Dim BarCount As Integer = eSignalOpenHandlelNumBars(HandleID)
        Dim barcounter As Integer
        For barcounter = 0 To -(BarCount - 1) Step -1
        Dim baritem As IESignal.BarData
        baritem = esignal.GetBar(HandleID, barcounter)

        If baritem.dOpen <> 0 Then ' test if null data row
        Dim NR7ArrayDate As Date
        NR7_Array_Ticker(iNR7_Array_Ticker) = ssymbol
        NR7_Array_Date(iNR7_Array_Ticker) = baritem.dtTime
        NR7_Array_Open(iNR7_Array_Ticker) = baritem.dOpen
        NR7_Array_High(iNR7_Array_Ticker) = baritem.dHigh
        NR7_Array_Low(iNR7_Array_Ticker) = baritem.dLow
        NR7_Array_Close(iNR7_Array_Ticker) = baritem.dClose
        NR7_Array_Volume(iNR7_Array_Ticker) = baritem.dVolume
        NR7_Array_Flags(iNR7_Array_Ticker) = baritem.bfFlags
        NR7_Array_Ask(iNR7_Array_Ticker) = baritem.dTickAsk
        NR7_Array_Bid(iNR7_Array_Ticker) = baritem.dTickBid
        NR7_Array_Trade(iNR7_Array_Ticker) = baritem.dTickTrade
        NR7_Array_Index(iNR7_Array_Ticker) = iNR7_Array_Ticker

        Comment


        • #5
          hi wscully
          How can I request the HandleID before I call to eSignals' data?

          Comment


          • #6
            I should have written "when I request data." I have always found that the handle is returned before the data is returned. In my Handler, I test to see that the ID is expected. I have encountered instances wherein the Handler was entered with an unexpected HandleID and Ticker (which I disregard and exit the Handler).

            According to the eSignal documentation "Each RequestHistory function call immediately returns a handle for that specific request."

            Sorry for the earlier misstatement.

            Comment


            • #7
              You should be able to create a lookup dictionary of sorts. I'm using a Dictionary<int,PriceRequest> for this very thing. That way, I can resolve all the qualities of a request using the key of the request handle.

              Cheers!
              -s

              Comment

              Working...
              X