Custom Trading System logo
NinjaTrader indicators, automated trading systems
Custom development and premium support
Connect with us
How many symbols a trading strategy can handle?

How many symbols a trading strategy can handle?

By CustomTradingSystem, on August 30, 2015

How many symbols can I trade with my multi-instrument strategy? Can I scan the whole market and select the qualified stocks to trade? We hear such question from our clients all the time.

In this article we will tell how many symbols can be used in a trading strategy and what factors may limit this number. While the article mostly targets NinjaTrader trading platform the considerations and conclusions are applicable to other trading platforms as well.

Most traders usually trade a single symbol at time. Some may use additional time-frames of the main symbol. Some may use 1-2 confirmation symbols in conjunction with the primary one. However, there are traders who would like to implement truly multi-instrument strategies. In some cases traders may even be willing to scan the whole market to find the qualified stocks and then trade them.

In order to understand where the maximum number of symbols a strategy can process is we must understand what factors may limit that number. Here they are:

  • Market data channel bandwidth - how fast market data can be delivered to the strategy?
  • Strategy processing time - how fast the market can be consumed by the strategy?
  • Order action limits - what are the limitations imposed by your broker?
Should the strategy be tick-based or bar-based?

Before we proceed to each factor let's consider an important nuance that affects all those factors together: tick-based vs bar-based strategies.

Tick-based strategy (CalculateOnBarClose=False in terms of NinjaTrader 7) is a strategy that processes each tick. In contrast, a bar-based strategy processes only one "tick" per bar and works on OHLC values. The former approach allows to get a much better precision and, therefore, a better match to live result for the price of performance. The latter approach is much faster but lacks precision and sometimes may give completely irrelevant results.

For example, ES-mini produces over 1M ticks per session and this number tend to grow. A tick-based strategy will process 1,000,000 ticks while a bar-based strategy will process just about ~1440 1-min bars (or less). This impressive difference will grow even faster if you would like to trade multiple instruments.

So generally speaking a bar-based strategy will allow to process much more symbols than tick-based.

Market data channel bandwidth

Market data provider sends each trade (tick) that occurs on exchange to your computer. It may be insignificant when you trade 2-3 symbols but it will certainly be the more noticeable the more symbols you subscribe for. Note that most market data providers offer is limited by 200-500 symbols, i.e. a trader cannot get quotes simultaneously for 501 symbols. Some providers may offer more expensive packages that allow to get additional 200 - 500 symbols. However, considering that the total number of US stocks currently traded on the market is above 7000, such limits are hardly enough for market scanners.

One could subscribe for a chunk of symbols, process them, unsubscribe, the proceed to the next chunk, and so on. If the trading algorithm allows such processing then it may be an option. The problem is that NinjaTrader7 doesn't allow dynamic symbol subscription, meaning all used symbols in strategy must be declared during initialization phase.

Strategy processing time

When a tick arrives, a strategy should process it. This takes time and that time depends on the strategy internal logic. The problems usually begin when market data comes at much faster rate than the strategy can consume it. This creates a backlog of pending ticks, which eventually gets bigger and bigger, meaning the strategy lags more and more and cannot process the latest ticks anymore.

This is a typical problem for tick-based strategies as they must consume every incoming tick for every instrument. Even after algorithm optimizations this factor will always be a limitation, i.e. it's impossible to eliminate this factor completely. By the way, that's the reason why NinjaTrader 7 Market Replay cannot run at ultra high speeds - running a strategy at each tick has its own physical limits.

Note, that since trading activity on markets fluctuates, this problem may become visible only at market peak times.

Order action limits

Each order action - submission, modification, cancellation - is processed at broker side and therefore is a subject for the limitations because broker spends the his resources to process those requests. Such limitations may vary from broker to broker and are usually between 20 and 50 requests per second. Thus, a broker may limit the number of submitted orders, including modifications and sometimes even cancellations.

When you trade a single stock these limits are pretty much transparent. However, the limits may become a problem if you deal with many symbols. Your strategy may send tens of entries per second. Don't forget to add all profit target and stop loss / trailing stop orders. Furthermore, if you deal with partial fills, some strategies may submit an individual brackets for each partial execution. That increase the number of working orders by times.

Note that broker may halt the account after exceeding the limits.

Conclusion

There is number of secondary factors that affect the maximum instrument number. Computer specs make the difference, network health would generally affect the capabilities of the application, and so on. In short, considering a notorious "average" case for tick-based strategy we can say that:

  • If you plan to work with 10 symbols or less it will probably work no matter what.
  • 50 symbols will work if you are careful with your trading algorithms.
  • 100 symbols should work as long as you don't use heavy symbols like ES-mini and avoid market peak time (usually, session open). Code optimization is a highly recommended.
  • The same applies to 200 symbols, just the problems tend to become more pronounced. Keep in mind that NinjaTrader may load that many symbols for 15-30 minutes, so (re)starting a script can be a pain.
  • It's certainly would not be possible to scan thousands of symbols. Well, from engineering point of view it may be possible but in practice this is too expensive and complicated option for retail traders.