TWS ActiveX C# programming how to get historical values high/low values

Discussion in 'Programming' started by lordoftrades, Apr 23, 2013.

  1. Hi

    I try to pull some data from TWS using ActiveX and I wonder how to get historical values: high, low, open and close?

    Kind regards
  2. There's a function called requestHistoricalData you can use. But first you have to build an event handler which can capture the incoming data.
  3. vicirek


    As already mentioned call reqHistoricalDataEx metod and wire event handler called HistoricalData() where you receive your bars.

    Read ActiveX guide and focus on historical data limitations to understand how to request bars - you receive OHLC plus few other things together with date/time stamp (watch for format and Daylight Saving Time).

    IB sends back bar by bar data up to 2000 bars per request and your requests have to be called in 10s intervals or more.

    Bottom line is that it is not a file with bars to download but you receive 1 bar data per event and you have to process and store that information.

    What bar you receiving is specified in your request that you fire first.

    In addition you have to create system that will verify received data for gaps, missing bars, and if it returned all data that you have requested in your method call.
  4. Bob111


    probably done by someone else. ask at TWSAPI yahoo group. or search thru examples