1

I wanted to get into algorithmic trading, so I started looking for an API. I stumbled upon this answer and some others, mainly suggesting going for Interactive Brokers.

I downloaded it and added the API jar to my project. Then I realised that what I actually want is an API that will allow me to see how my algorithm is performing daily.

In other words is there a way, with Interactive Brokers, to "fake trade" in real-time? If not, what other tool or API should I use to test different strategies and algorithms on live markets?

Community
  • 1
  • 1
Denis Davydov
  • 463
  • 2
  • 8
  • 22
  • 3
    Not clear how this is programming but you can have a paper trading account at IB. If you're trying to test an algorithm, all you need is historical data. You can get some historical intraday data from IB if you have an account or you can buy it elsewhere. – brian Jul 10 '16 at 14:24

2 Answers2

2

Interactive Brokers provides account holders with a Paper Trading account and $4M of play money. This means that you trade in a simulated mode on the real market. You can monitor your trading performance as you would with an account with real money. If you choose this approach you should only need the API to execute orders and check the status of your portfolio. The API is not very good for obtaining real-time quotes especially if you are following a lot of symbols.

Brian O'Donnell
  • 1,836
  • 19
  • 29
1

Your intention is rather clear,
the solution is not so straight
as just loading an API

a) What is your set of trade-able instruments?

This is a step number one, depending on where is your Quantitative Modelling directed to going, whether into equities, in spot FX, futures, options, indices, commodities, virtual currencies, options on index, there will be different tools to solve the rest.

b) Is your model composed of a single instrument or portfolio based?

While this might surprise, not all tools support a portfolio based trading model. If going into this direction, be carefull, that your backtesting engine does multi-asset portfolio processing exact and realistic ( whereas some strategy might get "tested", the results ( outputs ) do not need to be guaranteed ( have seen backtesters with nonsensical outputs once working with a multi-asset strategy, so be cautious and rahter collect an independent set of records-of-evidence for being able to cross-validate manually, before you start to "believe" a product )

c) Is a real flow-of-time really what you want?

While real-time might look attractive on a first look, the common need in quant-modelling is not to wait for a flow-of-time and backtest / forward test each strategy ( typically many models can run concurrently ) "immediately", or at least, faster than a real flow-of-time. There is practically no benefit from event-sourcing directly from a real market. It is reasonably enough to record and store all relevant market-events and systematically split this know part of the history into InSample and OutOfSample parts of the reality, against which a trading strategy model is cross-validated ( at speeds much faster than a real flow-of-time ).

There is just one exception to this principle of fastest possible backtest, in case, when your trading strategy is going to be operated as a semi-automated tool -- augmenting a manual, discretionary type of trading -- there you naturally need to adjust the execution speed to the "human element".

In all other cases, including a massively distributed solutions, split among Trading / AI-ML analytics / GUI layers, the faster than real flow-of-time execution is beneficial ( the machines can and definitely do handle that much faster, than a live flow of events from market exhibits ).

d) Data-source adequately coarse to your level-of-detail

Simulators may provide EoD-data for backtesting, while your operation targets might need tick-by-tick data. Being in Switzerland, your needs could be easily covered by Dukas-Copy quant modelling data provider. Besides history data, your ongoing efforts will most probably cover your selected market access data-stream recording for the purpose of your further InSample + OutOfSample cross-validations.

Without the a), b), c) and d), one could hardly seriously say, what tools can be used.
With these having been decided, even a general purpose tool, alike the MATLAB is, can provide you a rock-solid ground for a quantitative modelling of your trading strategy.

One might like some additional posts on
[ >>> Quantitative Finance ]

or
[ >>> Algorithmic Trading ]

Community
  • 1
  • 1
user3666197
  • 1
  • 6
  • 50
  • 92