Choosing an Automated Trading Framework for Broker-Connected Strategies
Summary
The document collects advice for a trader choosing a low-cost automated trading setup for futures and stocks through Interactive Brokers. The trader needs custom signals that combine technical rules with database lookups and breadth calculations, and wants to share signal logic between backtesting and live trading. Responses emphasize starting with the broker’s API and integration constraints, then selecting a framework or platform that supports the required instruments, data, order handling, and strategy logic.
Suggestions include direct API work in languages such as Java, using R or Python interfaces, and retail platforms with built-in backtesting and broker connections. One respondent cautions that maintaining a full independent trading platform can be complex, while another notes that older frameworks may need changes as broker APIs evolve. The thread does not compare the tools systematically, verify their current status, or establish that any one option fits the trader’s custom data needs. Its recommendations are historical and should be checked against present-day software support and broker interfaces.
Key ideas
- Broker API support is a foundational constraint when selecting a live trading framework.\nCustom database conditions and breadth signals may require flexible strategy code.\nUsing the same signal logic in backtests and live trading is a stated design goal.\nThe responses suggest both direct broker API integration and platforms with built-in backtesting.\nFramework maintenance and changing broker APIs can affect long-term reliability.
Tags
Full text
# Please advise on the choice of an automated trading framework # Please advise on the choice of an automated trading framework I'd like to start automating my trading strategies. I'm not looking for a fast and easy solution, therefore the programming language is not important for me, I am ready to spend an extra year to master the required technologies if needed. I'm very good with R, VBA and SQL, used Python a bit, but don't know any C++/C#/Java. I'm looking for a recommendation on what framework and related programming language to learn. I can't afford any expensive solutions, a free open-source framework would be ideal. I trade futures and stocks with IB and my trading strategies mostly use a combination of simple technical rules. However, sometimes I really need to get some extra data to generate an entry or exit signal, e.g. check if today's date is present in some list of dates in the database, or generate a custom breadth indicator (like at the moment some condition is true for at least X% of stocks from certain list of stocks). I can fairly easily backtest such strategies in R with my own backtester, but I have no idea if ready frameworks for automated trading allow that. Having read some articles and forum posts I realized that I probably need CEP to program such rules. If so, then as far as I know I'm limited to AlgoTrader among free solutions. However, I've read opinions that AlgoTrader is extremely complicated to understand even with a solid background in Java, which I lack at the moment, and that it lacks proper documentation. Is there anyone, who uses AlgoTrader, in here? Are there any alternatives that allow to program algos similar to what I described above? In theory I can send trading signals from R, but I'd like to get more reliability, speed (I don't need HFT, but recalculating custom breadth indicators for several systems takes time) and some ready framework that can be used to both backtest and trade using the same code to generate signals. In addition, there are probably other good reasons that I'm not aware of why hardly anyone uses R for automated trading. Any recommendations? ## Answer by chollida (score 6) https://quant.stackexchange.com/a/11227 To be honest you're not likely to get a very satisfying answer to your question. Not because its a bad question, but because "regular people" can't just go hooking their home grown trading systems up to a live market. > I'd like to start automating my trading strategies. First off you'll need a system that can interface with your broker. If you're not a fund then you won't be able to certify your own fix engine for trading, which means you're path of least resistance is probably to interface with something like IB. In that case your best bet is to read up on the Interactive Brokers api https://www.interactivebrokers.com/en/?f=%2Fen%2Fsoftware%2Fibapi.php%3Fib_entity%3Dllc ## Answer by brian (score 3) https://quant.stackexchange.com/a/11230 There's some pretty basic frameworks for IB. One that's pretty simple to modify is http://sourceforge.net/projects/jsystemtrader/ . I haven't looked in a while but it uses only market orders. The development has gone on to a version that uses market depth. There's also things like Ninja Trader but paid per month. It's what I do and I just use java with IB. I have a feeling you're going to write so much code that the framework isn't going to be much work in the end. Since you said R and Python I'll just add http://cran.r-project.org/web/packages/IBrokers/index.html and https://code.google.com/p/ibpy/ I haven't used either and don't know how well they work. I'm pretty sure the R package can download historical data. One thing to remember with un-updated frameworks is the API can change a bit and no longer work without some tweaks. ## Answer by Jon Grah (score 3) https://quant.stackexchange.com/a/32559 What about frontend like MultiCharts or NinjaTrader? Or even a cheaper one like SierraChart or AmiBroker? There is also cTrader Automate (cAlgo) and ProTrader PTMC. All of these are specifically built for real time trading of derivatives, including hooking up to a broker like Interactive Brokers, Lmax, etc. And they have their own programming language with built-in backtesting capabilities. Since you mentioned stocks, MC lifetime license is likely the better investment long term. Sierra Chart is also very stable and has lots of integration already. Retail Fx is currently dominated by Metatrader 4....but if the broker allows FIX or other api, you can still use MultiCharts or the other charting apps. The worst that can happen is that you have to switch brokers, but you should be able to reconnect the algo (which will run a similar trading platform) to the new broker. In the case of mt4/mt5, you just move your strategy (called Expert Advisor or EA) to the new broker's mt4/mt5 instance (or just copy the new broker's `[server].SRV file` to the existing mt4/5 and "open an account" add new `[server]` name and it should ping after a few seconds. Yeah, just easier to do a new mt4 installation with new broker's setup file) It's worth mentioning that metatrader 5 (five) may eventually overtake mt4, and it is setup to handle multiple asset classes (stocks, futures, forex, etc). Like mt4, it is free to the end user. Unfortunately, MQL5 is not backwards compatible with MQL4 and MT5 cannot import or run compiled mql4 strategies. You could actually rig mt4 to backtest stocks/futures if you have tick data available (or 1 min bars if tick data is unimportant); so basically making your platform investment minimal as mt4 is free. Also, mt4/mt5 is configured on the broker side. So the trader only has to open the platform and begin their analysis or trading. And it is incredibly easy to migrate from one broker to another. Of course, choosing a trustworthy broker is much more important, but that's a separate topic of discussion. Many of the answers put forward so far seem to focus on the user spending a lot of time either building their own trading platform or having to spend a lot of time to connect a platform. Maintaining an independent trading platform is a complex, expensive endeavor. IMO there is no reason to reinvent the wheel `^^`; spend that time developing and testing your algos in a deployable environment. `^^`(not recommended) > But if you want to have a go at your own proprietary platform consider Modulus M4 platform + source code to get you going. Updated 06 June 2018 to add urls and mention a few more platforms. ## Answer by Christoph Glur (score 2) https://quant.stackexchange.com/a/11326 There is also http://ibconnector.com/, which is free, afaik, and an alternative to IBrokers. I've worked with it before and for basic orders, it was very fast and reliable. ## Answer by ogukku (score 1) https://quant.stackexchange.com/a/42867 Update Dec 2018. Basic auto-trading code for R and Interactive Brokers API can be found at https://github.com/PhilGuerra I know the code works b/c it is the same code that I modified so that I could automate trading long/short futures portfolios.
Shown in full with attribution under the source's licence. Licence: CC BY-SA 4.0 (Stack Exchange)
This summary was written by Stratmill's research agent from the original; it is not a copy of the source.