Real time volume histogram

Discussion in 'Index Futures' started by piggie, Jul 19, 2006.


  1. The MD information during the day can add precision to trade entries and be used for the basis of a solid trade methodology.
     
    #61     Aug 5, 2006
  2. teuffy

    teuffy

    Hi Piggie,

    I am struggling to use to data I receive from IB (activex connection within matlab). I need help in order to use the real time data to plot it or store it in a vector. Do you know an easy way to handle it?
    Many thanks in advance


     
    #62     Aug 10, 2006
  3. bgp

    bgp

    would one of you traders post a graph of the volume under a chart?

    thx,
    bgp
     
    #63     Aug 10, 2006
  4. piggie

    piggie

    teuffy,

    I started my programming project from this thread in IB's TWS API forum.

    http://www.interactivebrokers.com/discus/messages/2/33586.html

    The two files to get are connect_ib.m and TWSevents.m. This is for the ActiveX approach. You have to download from IB and install the API's. The concept is to first initiate the ActiveX component connection between Matlab and IB TWS, and then process the incoming events in Matlab. The callback function processes the events from TWS.


     
    #64     Aug 11, 2006
  5. piggie

    piggie

    Nick,

    My programming project has been going well. I got true tick by tick data and am happy with the accuracy of my MD plots. 5Pillars is correct, IB's snap shot can be misleading at times, but this does not mean that you can't build a profitable strategy using IB's feed.

    I am moving into strategy development phase of my project, and just by chance through EliteTrade.com, I have the opportunity to join a trading firm to do the same thing. I will see how it goes, and hope to learn good and solid strategies from the traders in the firm.

    best,

    -p

     
    #65     Aug 11, 2006
  6. teuffy

    teuffy

    Piggie,
    Thank you.
    As you can see I started with the same files. I have problem to hande the data I can see coming into matlab as I do not know how to save it or use it in real time. Can you show an easy example (chart or storing close in a vector or matrix wth the time).
    Cheers

     
    #66     Aug 11, 2006
  7. piggie

    piggie

    The lines below are from the TWSevents file, containing the ActiveX callback function TWSevents.

    The incoming events are first assigned to variable sd, based the id and message type, and then stored in global variable ticker, which is a structure array, and can be access in other functions using the global variable declaration. The id corresponds to the stock symbols (ie ibm or aapl) you assigned to it. Type would be tickprice or ticksize, etc.

    It is in the other functions that you access the elements in each field of the structure, ticker, for further analysis. The Matlab help files have great examples on global variables and structures. Hopefully from this point on the code will become more transparent and self-explanatory.

    Be bold and creative on testing the codes. Knowing how to read the error message is important. I am not a computer science major, but happen to enjoy programming and have never been afraid to run the code and tackle the bugs one by one until everything makes sense to me.

    The Matlab news group is also a very useful site.

    http://groups.google.com/group/comp.soft-sys.matlab

    best of luck.


    -h


    %%%%%%%%%%%%%%%%%%%%%%%%%
    function TWSevents(varargin)

    global ticker account data p doprint

    data.doprint=1

    % parse stream
    sd = varargin{length(varargin)-1}; % ?!
    % Use Type because EventID may change over time !!!
    switch sd.Type
    case 'tickPrice'
    % tickers are identified by id
    switch sd.tickType
    case 1
    ticker(sd.id).bidprice=sd.price;
    myfprintf('BidPrice: %f\n',sd.price);
    case 2



     
    #67     Aug 11, 2006
  8. teuffy

    teuffy

    Piggie,
    I try do disturb you one more time.
    Many thanks again for the details. I got to this point already (I apologize I was not clear enough).

    For Instance here is what I have within matlab

    >>ticker(1).bidprice

    ans

    101.20

    then I have the updates coming ...
    I don't how to collect the information into a variable that I can query or do calculation on (for instance Is it possible to have all the bidprice that are coming + the time stamp stacked into a variable or vector?).
    If you can show me that I will really, really appreciate.
    Many thanks in advance
    Cheers
     
    #68     Aug 12, 2006