Looking for a way to automate a system on Interactive Brokers

At what point do you "read" the futures prices prior to placing your trades to be executed at the close?

It's done before trading. It doesn't need to be ultra precise, if it's say 15 seconds before I trade, it's fine.

i want to see him overcome the auto logout and let's go from there. also ib has snapshot quotes which is a little different than real time data.

I'm subscribed to data, it is updated enough for me, I don't need nanosecond precision.

Part of IB's API offerings is an Excel platform that would suit your situation very well --
it requires no coding skills beyond the algebra of a cell formula and the ability to spec a field like a future's expiry. Its soft spot would be the ability to handle lots of contracts -- which (by design) your needs to not encompass.

That sounds promising. For the system I only need 3 prices from IB: index, first monthly future, second monthly future. Then I can manually set the market days until expirations and the formula would determine what the bot has to buy/sell/hold.
 
I don't know how this will affect your strategy, but one option would be to run your formula after the market closes and place your trades for the following open. This would drastically reduce the overhead for your strategy.
 
I don't know how this will affect your strategy, but one option would be to run your formula after the market closes and place your trades for the following open. This would drastically reduce the overhead for your strategy.

I thought about that, I could do it manually in that case. The problem is that my strategy is backtested on close prices, so I prefer to stick to that.
 
I thought about that, I could do it manually in that case. The problem is that my strategy is backtested on close prices, so I prefer to stick to that.

I've been taking 4:00pm ET as the close, and then working the signals through 4:15. Works pretty sweet. :thumbsup:
 
Last edited:
I thought about that, I could do it manually in that case. The problem is that my strategy is backtested on close prices, so I prefer to stick to that.
How hard is it to enter at the following open instead of the close for the backtest? I would expect it to be a trivial change.
 
How hard is it to enter at the following open instead of the close for the backtest? I would expect it to be a trivial change.

I'd love to know, but I don't have open prices. You are probably right, but just in case I want to follow exactly what I have backtested (or as similar as possible, as obviously I'm not going to get close prices either, but something approximate).
 
I'd love to know, but I don't have open prices. You are probably right, but just in case I want to follow exactly what I have backtested (or as similar as possible, as obviously I'm not going to get close prices either, but something approximate).
What do think is going to be more effort...getting opening prices and re-backtesting your strategy vs setting up a solution to auto trade your strategy? Essentially, you have an EOD strategy that you want to auto trade and I think you are underestimating the level of effort for setting up and maintaining an auto trading solution. Just some things to think about.

Good luck!
 
I use a system that trades at the NYSE's stock market close. As I'm living in Asia, that involves having a quite shitty schedule. So I wonder if there's any way to do it automatically.

My system is based on the following information: the two nearest futures's prices of a particular product, the index price and the number of market days until expiration for each of those two futures. Depending on the result of a formula that uses that information, I either go long one ETF, another one or stay in cash.

It seems like a relatively simple strategy, the only "external" information would be the market days until expiration, considering the software itself can't get that from Interactive Brokers. So I'd manually add that data, while the software would get from IB those futures and prices index. Then, my formula would say whether I should buy, sell or hold what I had from the previous day, and the bot would use a market order if needed.

I'd appreciate if anyone could guide me. I don't have any experience with this kind of bots, I have always traded manually following my systems.

Assuming that you know in advance that you want to enter a trade at the close on a particular day, simply set a conditional trade on TWS to execute at a particular time. In your case, just before the close. Much safer that trying to rig additional software to trigger a trade.
 
What do think is going to be more effort...getting opening prices and re-backtesting your strategy vs setting up a solution to auto trade your strategy? Essentially, you have an EOD strategy that you want to auto trade and I think you are underestimating the level of effort for setting up and maintaining an auto trading solution. Just some things to think about.

Good luck!

It's long to explain but unfortunately I don't have opening prices. I'd need opening prices of many products to be able to backtest everything. I suspect that trading at the open (or intraday) should change results, and I consider trading that way if I don't find any solution, but I'd prefer to just follow exactly what I have backtested.

Assuming that you know in advance that you want to enter a trade at the close on a particular day, simply set a conditional trade on TWS to execute at a particular time. In your case, just before the close. Much safer that trying to rig additional software to trigger a trade.

Unfortunately I don't know that in advance. The formula would check those futures and index prices shortly before the close and based on that and some other information (days until expiration and then some factors) it either buys/sell/holds one of two different ETF. I guess if I do that intraday (I did it sometimes when I wasn't going to be able to trade at the close) the results shouldn't change much, but I'd prefer to stick to exactly what I backtested.
 
Back
Top