Announcement

Collapse
No announcement yet.

Receiving no bars

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

  • Receiving no bars

    I followed the C# sample code for multiple product histories, but wrote it in vb.net. Instead of a button I activate the history requests from a timer event. I also am not capturing the OnBarsChanged event. Other than that, my app is doing the same thing as the sample, but I receive no bars. The OnBarsReceived event gets called, but the bar count is always zero. What might be causing that?
    Tom Hogan
    AxiDev Software
    Customized Software and Training

  • #2
    Seems okay now

    Today it was working properly. Very strange...
    Tom Hogan
    AxiDev Software
    Customized Software and Training

    Comment


    • #3
      Today it is not working

      This is very frustrating! How could this activex control work one day and not the next?!?! The eSignal application is showing bar data, but the api tells me there are no bars received. Has anyone seen anything like this before?
      Tom Hogan
      AxiDev Software
      Customized Software and Training

      Comment


      • #4
        Bars first call, then none

        When I started my program, everything went like it should. It jump started the eSignal program, engaged the api, made a call at the correct time for bar data for 6 symbols, and received those bars for all six symbols. The next call one minute later, and every call after that, receives no bar data at all, for any of the symbols. I am calling for one bar, a one-minute interval, and I am clearing the history for the returned handle as soon as I capture the data. Is there something else I am supposed to be doing? It would be nice if someone from eSignal would lend a hand on this.
        Tom Hogan
        AxiDev Software
        Customized Software and Training

        Comment


        • #5
          Can you tell us which function call you are calling and the arguments to it? You shouldn't need to keep requesting data for the same 6 symbols in a timer fashion, you just need to request data once for each symbol and process OnBarsReceived events for each handle from that point on.

          Given that this is the case, are you saying that any subsequent OnBarsReceived event contains no bars?

          Comment


          • #6
            data calls

            The reason I am using a timer is because I want the data for each minute as one bar, and I make the call at 1 second after the minute, like so:
            myMarkets(iProd).historyHandle = esig.RequestHistory(myMarkets(iProd).product, "1", _
            IESignal.barType.btBARS, 1, myMarkets(iProd).startrange, myMarkets(iProd).endrange)

            Each product is stored as a structure in an array. I ask for 1 minute of data, as 1 bar, beginning and ending at startrange and endrange.

            But, each 10 minutes, I call for 1 bar of data for the entire 10-minute interval for each of these same products. The structure tells me which interval I asked for when the historyhandle is returned in the OnBarsReceived event.

            In OnBarsReceived I verify the existence of bar data:
            If esig.GetNumBars(lHandle) = 0 Then

            If it is zero then I post a message in my form and return from the event proc. If there are bars, I capture the data and then clear the history for that handle.

            So, are you telling me that I should not clear the history, and just keep capturing the bars for that same handle? Will it keep giving me data for the one-minute and ten-minute intervals like I am doing in the timer event?

            I appreciate your assistance in this. For me the documentation is not very thorough, and the example code stops short of demonstrating any real-life functionality.
            Tom Hogan
            AxiDev Software
            Customized Software and Training

            Comment


            • #7
              Instead of calling RequestHistory in a timer fashion every minute, you may just call RequestHistory once and handle both OnBarsReceived and OnBarsChanged events. Subsequent newer bars will be fired if you don't clear the history handle. Note that if you want both 1 minute and 10 minute bars, you are actually dealing with two separate handles.

              You should refer to page 26 (Chapter 4) of the Desktop API documentation to see how FillHistory is being implemented. It demonstrates how to handle new bars as they come in.

              Comment


              • #8
                So, let's see if I understand this correctly now. I make my initial request, when my application starts up, for history bar data in one minute intervals beginning at the market open and ending at the market close.

                I then just wait for the OnBarsReceived event to be called and capture the data. Because I'm not interested in the changes during the one-minute interval, I will ignore the updates.

                I also make the same request for one bar of ten minute data and capture the bars as they are received.

                For both of these, I'm following this sytax:
                eSignal.RequestHistory(symbol,"1",btBARS,1,-1,-1) and
                eSignal.RequestHistory(symbol,"10",btBARS,1,-1,-1)

                Is this the correct call?

                And again, thank you so much for helping me with this.

                T
                Tom Hogan
                AxiDev Software
                Customized Software and Training

                Comment


                • #9
                  OK, I tried what you said, but my application is not getting any new bars. The eSignal program is getting bardata in the graph, but I'm not getting anything.
                  I tried it without releasing the history and I tried it with releasing the history. Neither worked. I don't get it!
                  Tom Hogan
                  AxiDev Software
                  Customized Software and Training

                  Comment


                  • #10
                    Hi Tom,

                    Can you post your code, including how you are processing the OnBarsReceived and OnBarsChanged events? Note that you must handle both events, or you will only get the first bar.

                    Comment


                    • #11
                      Okay, it became obvious that I only get the first bar in OnBarsReceived. So I went back to what I was doing before in my timer event.

                      The thing is, I'm tracking multiple symbols, and I don't want to be dealing with OnBarsChanged. I just want a solid one-minute bar, which is why I am calling the history in a timer event each minute, processing the bardata, then releasing the history for that handle.

                      I finally got this to work consistently today, only to find I don't actually get a solid one-minute bar. In comparing my results with the bar chart in eSignal, my values are all different except for the open. I am losing the actual high, low and close amounts.

                      This leads me to believe there is no way to avoid handling OnBarsChanged. Very disappointing.

                      So now I really need to know: is OnBarsChanged handled in a separate thread for each handle? This will make a big difference, but I can't find anything in the documentation about it.

                      And thank you, Starr, for your input.
                      Tom Hogan
                      AxiDev Software
                      Customized Software and Training

                      Comment

                      Working...
                      X