Announcement

Collapse
No announcement yet.

getBar returning null

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

  • getBar returning null

    Hi,

    I have a problem when I try to make a History Request. The program return that all of the Bars are available but when I use the method getBar it returns null. what can I do??.
    I am programming in Java language.

    Thanks in advance.

    CODE:


    int lhandle = m_app.get_RequestHistory("TEF-MAC","D",1,100,-1,-1);
    System.out.println(" Handle "+lhandle);

    while (m_app.get_IsHistoryReady(lhandle) != 0) {
    System.out.println(" HISTORY REQUEST " + m_app.get_IsHistoryReady(lhandle));
    Thread.sleep(5000);
    }

    // Wait 5 seconds for eSignal to finish loading.
    int lNumBars = m_app.get_GetNumBars(lhandle);
    System.out.println(" Numero de Barras "+lNumBars);
    for (int i= 0; i <lNumBars ;i++ ) {
    BarData data = (BarData)m_app.get_GetBar(lhandle,i);
    System.out.println(" BARRA "+data.dtTime+data.dClose);
    }

  • #2
    To determine if history data is ready to be processed, you should implement the event handler for OnBarsChanged (Long handle) and OnBarsReceived (Long handle). When these events are triggered, you can then use the GetBars and GetNumBars function to extract the history data. When using Java, you are responsible for coding the wrapper around the Desktop API.

    Sample codes are available at the ActiveX group at http://share.esignal.com.

    Comment


    • #3
      Hi Achan

      Could you provide me some example?. is there any group that are developing in Java or is the first time?. It is really difficult to find some documentation about Java development.
      I have search in the documents that you told me, but I donĀ“t find too much information.

      Thanks in advance.

      Comment


      • #4
        Unfortunately, we do not yet support Java. You would need to write your own wrapper around the API.

        Comment

        Working...
        X