Hi, My strategies are written in R and they generate the desired positions to a textfile. Does anyone know of a program or script that could take a textfile as input and send the orders to IB TWS? This script/program could be written in any language. I will schedule the script to run every 5 minutes. I can easily modify the format of the textfile. This seems such a common need that I decided to ask here before I proceed to write one myself.
tnx but the problem with basket trader is that it has to be run manually. Baskettrader cannot AFAIK be run without user intervention.
People did something like that with Tradestation 2000. I don't recall the details. It was the inelegant solution that worked just fine. I'm familiar with Sierracharts, a script can indeed read/write text files and interface them to IB's API. Hyperorder was the thing a few years ago but I don't know if it's supported anymore http://www.hypertrader.it/hyperorder.shtml Tradelink is open source, it might work for you somehow..
try checking these: http://www.tradingsoftwarelab.com/jbreakouttrader/ http://www.tradingsoftwarelab.com/jopentrader/
My application does that (although it's not much used for that purpose). [ In the "Order enqueuer" (gear icon) you can specify to read a given file called "MyOrders.txt" placed in a given folder. At any change of the file (creation/change), any order not earlier enqueued would be scheduled for execution. It can be executed either at given price or current price. Order format is like: 0001 AAPL STK IBIS_EUR BUY 1 @ 504.15 0002 AAPL STK IBIS_EUR SELL 1 @ 504.95 0003 AAPL STK NASDAQ_USD BUY 1 @ 663.14 0004 AAPL STK NASDAQ_USD SELL 1 @ 663.21 0005 AGQ STK ARCA_USD BUY 1 @ 57.68 0006 AGQ STK ARCA_USD SELL 1 @ 57.71 ] You can <a href="http://www.datatime.eu/public/gbot/#copyrequest">request</a> it freely to experiment.
Thank you all for your suggestions! Will look into them to see if I can avoid re-inventing the wheel this time. No suggestions for scripts using the R package IBrokers so far? The rest of my algorithms are in R, altough that doesnt actually matter in this case.
""" NYSE,ibm,108.22,BUY,400 SMART,msft,38.36,BUY,300 """ f=open('c:/tmp/orders.txt') for x in f.readlines(): v=x.split(',') order = Order(v) twsclient.placeOrder(order) PM me if you want the Order() and twsclient code