Announcement

Collapse
No announcement yet.

Historical Data

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

  • Historical Data

    I am trying to get historical data for two more time fames.
    Example:
    symbol1 for (15 min and 30 minute)
    symbol2 for (15min and 30 minute).

    and expecting: symbol1 , 15min data content
    symbol1, 30min data content
    symbol2, 15min data content
    symbol2, 30min data content


    What I experiencing is, I am getting four data files with same content eventhough the symbols and handles are different. I guess my question is how can I request symbols with multi time frames?

    Thanks,
    Ahmed.

  • #2
    It might be helpful if we could see your code. I request multiple time frames simultaneously all the time and get back what I expect.

    Cheers... George

    Comment


    • #3
      HISTORICAL DATA

      George,
      here is my code:

      private void startBtn_Click(object sender, System.EventArgs e)
      {


      ESignal01 es = new ESignal01() ;

      int i = 0 ;
      for (i = 0 ; i < es.symbols.Length; i++) // symbols loop
      {

      // ------- loop through the intervals ---------
      for (int j = 0 ; j < es.data_intervals.Length; j++)
      {
      if (es.symbols[i] == "EUR A0-FX")
      es.INPUT_FILE_NAME = ESignal01.PATH + "EUR_US_"
      + es.data_intervals[j] + "_" + "indata.txt" ;

      if (es.symbols[i] == "GBP A0-FX")
      es.INPUT_FILE_NAME = ESignal01.PATH + "GBP_US_"
      + es.data_intervals[j] + "_"
      + "indata.txt" ;


      //------------- delete existing file ------------------
      if (File.Exists(es.INPUT_FILE_NAME))
      File.Delete(es.INPUT_FILE_NAME);

      es.time_interval = es.data_intervals[j] ; //set interval

      es.start() ; // Call esignal start()

      } // for j (interval loop)
      }// for i (symbol loop)



      Application.Exit() ;


      } // startBtn_Click()
      --------------------------------------------------------------------------

      that code that is executed in the eSignal.start() is as follows:



      public void start ()
      {
      //-------- set params ---------
      int num_of_rows = 300 ; esignal.SetApplication("USER");

      if (esignal.IsEntitled == 0)
      {
      //MessageBox.Show("Not entitled");
      }
      else
      {
      esignal.ReleaseAllHistory(); // ??? not sure
      esignal.ReleaseAllTimeSales(); // ????
      foreach (symbolInfo info in symbolInfoArray)
      {

      //symbolInfo has two fields (info.symbol , info.historyHandle )
      string sym = info.symbol ;
      int handle = info.historyHandle ;


      // fill requests based on (info.symbol and time_interval)
      info.historyHandle = esignal.get_RequestHistory(info.symbol, time_interval, ESignal.barType.btDAYS, num_of_rows, -1, -1);

      int history_ready = 0;
      history_ready = esignal.get_IsHistoryReady(info.historyHandle);
      esignal_OnBarsReceived(info.historyHandle);

      }

      } //else



      }// start() method



      Thanks in advance,
      Ahmed.

      Comment


      • #4
        Arer you a Unix (or DOS) CLI programmer? You don't seem to be waiting for return data events.

        For example, esignal.get_IsHistoryReady does not block until history is ready. It immediately returns true or false depending on whether it is ready now. If it returns false, you shouldn't call your onBarsReceived method. The esignal object will call your onBarsReceived method for you when it receives bars. The IsReady is just to see if the data is already cached, if it is, you can deal with it. If not, you have to wait.

        Cheers... George

        Comment


        • #5
          Historical Data

          George,
          Thanks a lot for your help. I understand using Esignal is event
          driven and your suggestions are I should wait untill IsHistoryReady returns true. And some kind of delay machanism
          needs to be implemented in between requests.

          thanks,
          Ahmed.

          Comment


          • #6
            Have a look in the File Sharing section. There are a few demo projects. Specifically you might want to look at Multiple History Requests in VB.zip, which is really in C# and not VB.

            Cheers... George

            Comment

            Working...
            X