Homer: Kids, kids. As far as Daddy's concerned, you're both potential murderers.
Implementation PDF Print E-mail

 

           So now you have your strategy backtestested and optimized and you are salivating at the mouth ready to trade. There are several ways to implement your strategy. The easiest way, in my opinion, is via Interactive Brokers Trader Work Station API. Although the IB API will not give you real time quotes (the info they will give you is a 200-300 millisecond market snapshot so pretty much real time) for many trading strategies their data stream will be all you need.
 
           If you require a different type of data, I would suggest you shop around for quite some time before you pull the trigger. There are many data vendors out there and some are extremely expensive. Don’t forget you can get a decent amount of info from Yahoo! Finance’s premium service for only 13 dollars a month(see the Data Acquisition Tab Above).

          I would be very interested to hear how you addressed your specific data needs- feel free to drop me and email at This e-mail address is being protected from spambots. You need JavaScript enabled to view it .

Basically What You Need to do to Implement in IB


1.    Connect to IB’s TWS using the connect code (can be found on the wiki).
2.    Request whatever data (if any) you will be needing from Trader Workstations’ API. Most likely you are going to need to stream in the last price of the ticker you want to trade. Use the reqMktDataEx() method for this.
3.    Take the code you used to backtest your strategy and make it run continuously. (put a while loop in front of everything that will always be true, for example: while 2>1)
4.    In the code you used to backtest your strategy, change the if statement that determines weather or not you have a position to a statement that will check your position in TWS. To do this use the reqAccountUpdates() method and the updatePortfolio() and/or updateAccountValue() events. Then take a postion according to how your strategy took a postion in the backtested code using one of the orders methods (placeOdersEx() ).

           It is hard to give hard and fast rules on how to implement your strategy because every strategy is different and requires different types of data coming in and a different execution protocol. Above are just rough guidelines that I hope will help you get a feel for what you need to do. If you have a specific question feel free to ask it on the forum and I will try to answer them as best I can.