Strategy automation is the ability to take a backtested set of rules and apply them to live or simulated market data. These entry and exit rules are processed and executed automatically, hands-free. This is true programmed trading, instilling discipline and consistency while helping remove emotional decisions from your trading.
Now, you might be wondering, “Why should I automate my strategy?” It’s all about discipline, expectations, and consistency. Discretionary trading often comes with negative emotional reactions: hesitating when you should act, jumping in too early, or even staying out of the market altogether due to fear. Automation helps remove these emotional tendencies, enforcing the backtested rules of your strategy trade after trade.
In the final segment of our strategy trading series, we explore the concepts and processes of automated trading strategies. You will learn how to automate a trading strategy within the NinjaTrader Desktop platform, best practices for monitoring orders and positions, and how to track real-time performance.
Learning Points
- What is strategy automation?
- How can strategy automation improve my trading?
- What are best practices for automating a trading strategy?
Setting Up the NinjaTrader Environment for Automated Trading Strategies
Let’s walk through the process of automating a strategy in the NinjaTrader Desktop platform. Strategy automation is managed in the Control Center.
- Go to the Strategies tab in the Control Center to select a strategy to automate.
- Right-click and select New Strategy; in the dialogue, you can select the strategy to automate and adjust any properties or input parameters if needed.
- Verify the strategy name, instrument to trade, and bar interval.
- Click the Enable checkbox to turn on strategy automation. (Figure-1)
Your strategy is now automating and trading based on your strategy rules. You can now monitor your real-world strategy position from the Positions tab in the Control Center. Here you can track your strategy position profit and loss. Check to see that the strategy position matches the real-world position in the Positions tab. When first applied, they will not be in sync until the first real-time trade strategy trade is executed. (Figure-2)
Understanding Sync
Ensuring your strategy position is in sync with your actual real-world account position is crucial. The strategy position you see on the Strategies tab and real-world position you see on the Positions tab are two different things that must be in sync for the strategy to automate correctly.
The first time the strategy makes a trade and that trade is executed in your real-world account, the strategy position and your real-world position will sync. They must stay in sync while this strategy is running, otherwise your automated trades may not execute as you expect, and you might end up with no new positions or positions the strategy rules never intended to take.
- The Executions tab in the Control Center shows all your filled orders today. This could be a mix of discretionary trades and automated strategy trades. You can use this information to audit and trace the strategy trades made today. (Figure-3)
- The Orders tab in the Control Center shows all the open active orders and their current state. Here you can verify that the strategy is generating orders as expected. When you stop automating your strategy, it’s also a good idea to verify that there are no outstanding orders that have not been cancelled. (Figure-4)
Shutting Down Your Automated Strategies
You can turn off strategy automation any time by going to the Strategies tab in the Control Center and unchecking those strategies that are automated. This will stop the strategy from placing any new orders in the real world. This is just the first step—you’ll also need to verify that there are no open positions that need to be closed related to those strategies, and you’ll need to go to the Orders tab and make sure that there are no outstanding orders that need to be cancelled.
Best Practices
- Don’t intervene. While automating a strategy, it can be tempting to open or close positions or even cancel orders based on what you’re seeing in the chart. This type of discretionary trading is exactly what we're trying to avoid and will lead to your strategy becoming out of sync with your real-world position. You're automating this strategy for a reason, based on your backtested rules, and for the strategy to reach its potential, you must let it play out as designed.
- Monitor your strategy in a chart. As we’ve discussed, strategy automation is managed in the Control Center and not in a chart. However, it’s always advisable to observe an active automated strategy in a price chart while it’s running to verify orders are being generated as expected.
- Be present. Automation doesn't mean “set it and forget it.” While it may be tempting to hit “start” and walk away and go play golf, strategy automation requires active monitoring, because of unforeseen things that can (and will) go wrong. Imagine you’ve automated your strategy, everything is running smoothly, and then your internet goes off. The system can no longer place orders and manage positions. You need to be there for these potential hiccups and call the trade desk to level set as needed.
- Test before risking your money. Before automating a strategy with real dollars, thoroughly forward-test your strategy in a real-time simulated account. This helps to ensure that the strategy behaves as expected under live market conditions. Once you’re confident the strategy is generating orders as intended, you can gradually start trading small real-money positions, building up as your confidence grows.
Discover the Game-Changing Power of Automation
Automating a trading strategy can be a game changer for traders struggling with consistent profitability. It allows you to better follow your plan with improved discipline, and it can help you manage emotional trading decisions, with the added benefit of freeing up your time for other tasks like refining your strategy or researching and developing a new one.
Before you start, make sure your strategy has been rigorously tested. Forward-test it in a simulated environment, and always start small. Do not mistake automation for infallibility—just like any tool, it requires supervision and ongoing refinement.
So, grab that cup of coffee and watch your strategy trade hands-free, knowing that you’re on the right path to take your trading to the next level.
Watch the Complete Foundations of Strategy Trading Series
In this four-part strategy trading series, we’ve examined the core elements of strategy development and built a foundation to help you to take your strategy trading to the next level—from exploring strategy entry and exit rules, to evaluating historical strategy performance, to optimizing your strategies for refined stability. You are now ready to take the last step—automating your strategy for real-world trading—the ultimate expression of all the hard work you’ve put into developing your trading strategy.
- Foundations of Strategy Trading and Development: Part 1—Introduction to Strategy Trading in NinjaTrader
- Foundations of Strategy Trading and Development: Part 2—Strategy Trading Performance Evaluation
- Foundations of Strategy Trading and Development: Part 3—Trading Strategy Optimization
Unlock Free Exclusive Training
Explore the foundational concepts of technical analysis with our free multi-video trading course “Technical Analysis Made Easy.” Learn how to analyze and anticipate market movements using market prices, volume data, and more.
We’re Live Every Trading Day
Prep for the trading day ahead, analyze the markets in real time, and explore our award-winning platform during our daily livestream. Watch live here or catch what you missed on our YouTube channel.
Trade Futures with NinjaTrader
Haven't signed up for your free NinjaTrader account yet? Get started today with a 14-day trial of live simulated futures trading.
Risk Disclosure