Tick by tick data on TWS

Discussion in 'Data Sets and Feeds' started by e-miNY, Sep 7, 2006.

  1. on ib's tws t&s data is not cumulative, some prints may be missin' but that's it.
     
    #11     Sep 8, 2006
  2. feb2006

    feb2006

    Hi,
    converting IB ticks (ticks in the sense of incoming data) is possible in several ways and can be done even with Excel.

    But this way it's impossible to get real ticks (ticks in the sense of single trades) cause IB simply doesn't transfer real ticks but 0.3 second bar data only. For data quality see also this thread.

    IB's data generation process is explained very well by kiwi_trader.

    Using this info, you can reconstruct incoming volume data to price bars as shown in the attached list.

    The result is very tradable even if it's not every very tick (in the sense of single trade) as already mentioned.



    For short time trading there rarely is a better data souce, since transmitting every very tick (single trade) would mean up to 10 seconds delay at news times.

    If we want to know more about data quality we have to look at detailed timestamped data.

    Could somebody please post a screenshot with IB and eSignal data side by side at news times timestamped like the attached example?

    Martin

    PS
    Excel VBA isn't prepared for millisecond processing. If you need Excal VBA timestamping you may use my timestamping makro you can import as 'mNow.bas'-module into your VBA project.
     
    #12     Sep 10, 2006
  3. Hi Martin,

    Are you taking quotes in to excel in real time and then using your code to timestamp them and shift them down a row? Or more likely have I got hold of the wrong end of the stick? If it is time stamping and ahifting that would be very neat.

    Cheers,
    Nick.
     
    #13     Sep 10, 2006
  4. feb2006

    feb2006

    Hi Nick, you got the right end.

    To connect with interactive Brokers TWS I use their activeX control.

    The control's ''tickprice' and ticksize' events push data realtime into Excel VBA.

    My 'mNow' function timestamps them.

    Old data are shifted down one row by an 'Insert'-command and new data written into the empty row.

    The result is the list posted as attachment above.


    Additionally you can chart the list and have an individual chart at your disposal as shown in the excelchart attachment here.

    Even if this result isn't so easy to achieve as it may sound I think it could be worthwhile if it helps in successful trading decisions.

    At least you can see, it's possible to extract IB data into Excel.

    Regards,
    Martin
     
    #14     Sep 10, 2006
  5. Thanks,

    I'll have a play with this a bit later (providing the pub dosent take too heavy a toll!). Should be easy to see what's going on while things are slow.

    Cheers,
    Nick.
     
    #15     Sep 10, 2006
  6. Feb (or anyone else),

    Maybe I'm being dense but the only sample spreadsheet i can find on is for getting data in is via DDE. Could someone point me in the right direction for ActiveX?

    All I want is to open a connection and use getmarketdata and the aformationed controls to get data. rather than mess around and get it wrong can someone point me in the right direction of a code snipet?

    Thanks In advaince,
    Nick.
     
    #16     Sep 10, 2006
  7. feb2006

    feb2006

    Hi Nick,
    the program Im using now isn't yet finished.

    But some time ago I posted the attached zero version 'Excel_TWSv2.0.xls' to the German Elite Trading Forum. In addition to the Excel file, you may find an additional manual and similar material there.

    Reading the VBA Code you should see how to get TWS data via activeX control. Details re getting the activeX control working are explained on page 2 of my Excel-TWSv1,2Manual.pdf and on page 4 of my Excel_VisualBasic.pdf with screenshots.

    The code lines (see Sub 'Verbinden' in modul 'ModulTWSapi')
    Worksheets("Basis").Tws1.Connect IP, Port, ClientID
    and
    Worksheets("Basis").Tws1.reqMktData _SymbolID, symbol, secType, expiry,
    _strike, right, Multipler, exchange,
    _PrimaryExchange, curency

    start the data Request

    And the TWS1_ticksize/Tws1_tickprice Subs in Sheet2, where the control is attached, process the incoming data.

    To be mentioned: the timestamp code 'MilliNow' used there isn't working correctly (Synchronization Problem), so better use the timestamp code 'mNow' of the mSekundenStempel.xls posted later.

    Hope that helps.
    Martin
     
    #17     Sep 10, 2006
  8. feb2006

    feb2006

    Attached find the manual mentinoned in my previous posting. On side 3 and 4 you find explanation how to get the activeX control working in Visual Basic. It's in German but with screenshots so I hope it's understandable. Regards, Martin
     
    #18     Sep 10, 2006
  9. Martin,

    Thanks very much for sharing all this. If you read the IB blurb it suggests that they have a sample spreadsheet with ActiveX controls. Seesm that isn't the case, when you download the API it still installs an old DDE spreadheet. Maybe I was too blind to find it.

    I am always banging into walls when I try and do something with the various off the shelf packages I have and am toying with the idea of taking a bit more control. Only thing is I am trading pretty short time frames and when I'm 'playing' with tools Im not trading :-(

    Cheers,
    Nick.
     
    #19     Sep 11, 2006
  10. feb2006

    feb2006

    Hi Nick,
    you are right, IB's sample spreadsheet is based on DDE and not on ActiveX.

    And using their other examples first you have to learn an outdated version of Visual Basic, either old day VB6 or VB_Net of 2003, both a big waste of time if you don't want to become a professional programmer.

    Unless I'm very much mistaken, there is no example for the current 'VisualStudio2005' with its time consuming improvements nor for the simple VBA included in Excel.

    But you can use my spreadsheet version 2.01 as example. It's still the zero version but with timestamp corrected to mNow, so you don't need to care for VBA. (Maybe you first have to disconnect/connect = Trennen/Verbinden to get it working)

    It should fulfill simple tasks out of the box - you only have to type your desired parameters into the 'Basis' sheet as explained in the manual.

    Below find a screenshot of the spreadsheet version 2.01. The spreadsheet file will follow as next posting.

    Enjoy, Martin

    PS
    Using a working spreadsheet you don't have to care how to get the activeX control into your project. That problem occurs only if you want to program a project yourself. What to do in this case is described on page 3 and 4 of the manual.
     
    #20     Sep 11, 2006