Blog / Trading systems
MT5, NinjaTrader or a custom engine: where to automate a strategy
Once a strategy is written down as rules, the next question is where it should run. For most traders the choice is between MetaTrader 5, NinjaTrader, or a custom engine that talks to brokers directly. We work with all three: our own system runs NinjaTrader, MetaTrader 5, Interactive Brokers and Tradovate behind one order manager.
MetaTrader 5
What it is: a trading platform offered by many brokers, especially for forex and CFDs. What you can trade depends on your broker.
How you automate it: Expert Advisors written in MQL5, a language similar to C++.
Strengths: very widely available, a built-in strategy tester, a large community, and many prop firms offer it.
Limits: you live inside the platform. Connecting to outside data, databases or other brokers takes extra work, and testing quality depends on the data your broker provides.
NinjaTrader
What it is: a platform popular for futures trading, used by many futures prop firms.
How you automate it: NinjaScript, which is C# on .NET.
Strengths: strong for futures, good charting, market replay for practising on recorded data, and C# is a full programming language with good tools.
Limits: the desktop platform runs on Windows, and you depend on its data connections. Like MT5, the platform shapes what you can build.
A custom engine
What it is: your own program, often in Python, connecting directly to broker APIs such as Interactive Brokers or Tradovate, or to a platform through a bridge.
Strengths: full control. Several brokers behind one interface, your own risk rules, your own data, your own simulator, and the freedom to run it on proper servers.
Limits: far more work. You build what the platforms give you for free: order handling, reconnection, position tracking, charting and testing.
How we choose
- Forex or CFDs with one broker, or a prop firm on MT5: MetaTrader 5.
- Futures, especially through a futures prop firm: NinjaTrader.
- Several brokers, unattended running, serious research, or rules the platforms cannot express: a custom engine, possibly with platforms as execution bridges.
The middle path
You do not have to pick one forever. In Naxfront Systems, strategy logic lives in our own Python engine, and NinjaTrader and MetaTrader 5 act as execution bridges alongside direct broker APIs. The strategy does not know or care which broker fills the order. Adding a broker means writing one new bridge, not rewriting the strategy.
Testing on each
- MetaTrader 5 has a built-in strategy tester, including a mode that uses real tick data where the broker provides it. Check what data your broker supplies before trusting the results.
- NinjaTrader has a Strategy Analyzer for backtests and optimisation, and Market Replay for running a strategy on recorded market data as if it were live.
- A custom engine needs its own simulator. That is more work, but you control exactly how time, fills and costs are modelled, which is how we made look-ahead bias impossible in ours.
Whichever you use, test with costs and slippage included, and test out of sample, as we explain in walk-forward testing explained.
This post is about software engineering. It is not investment advice, and no software can guarantee that a strategy makes money.
Where this comes from. We do this work for clients. See trading systems, or the case study on Naxfront Systems.
Questions about this post? Email contact@naxfront.com. Nancy reads every one.