40. Algorithm in Real Environment

Published at 1683736758.107528

After completing 08 stages from hypothesizing to small account tests, the algorithm can now trade on the real market and earn a profit. Handling 100% of transactions automatically is a step towards “financial independence”, “financial freedom”, or “passive income”. However, there are still a few critical aspects to consider in this phase.

Parameter Setting

The algorithm parameters for real market trading is usually the same as for small account tests, except for capital size. However, this may not be the same with hyper-large capital. It’s because investors have to modify the parameters during operation to ensure the algorithm’s reliability in the real market versus the testing phase. Therefore, market-making and market-neutral strategies require special attention.

Define Expectations

Based on backtesting, forward testing, and the algorithm group, traders can set basic expectations for the algorithm to detect any unexpectedly large deviations. Note that the criteria differ for each algorithm. However, here are some common criteria to meet before running the algorithm in real trading:

  • Expected annual profit;

  • MDD;

  • Sharpe ratio;

  • Average slippage.

Some algorithms need learning indicators and these indicators are often more important than the ones above. Some leading indicators for limit order strategies are as follows.

  • Number of signals per week;

  • Number of matched orders/signals.

Traders need to monitor any significant difference in any of the criteria and learn to adapt to this new information, especially during the first 3 months of algorithm operation. They also need to prepare for the worst-case scenario to stop the algorithm at a predefined threshold, usually a multiple of MDD.

Online Monitoring

At the start of the live operation, traders should monitor online to handle any real-time issues. Such can come from data, algorithms, systems, securities companies, and reporting systems. These issues are especially frequent with the first algorithms. In some special cases, the system cannot close the opened position, and manual intervention is required. After acquiring enough experience, algorithm traders can skip this task.

Fix Technical Bugs

Even after many testing phases, an operating algorithm is still not free from technical bugs. It’s totally normal to have occasional errors. However algorithmic traders should fix bugs as soon as possible. In our experience, technical failures often happen in the first month, and then drop by 90% in the next months.

System Fine-Tuning

There are three common factors that lead to system tuning:

  • Financial markets are always changing. Some changes are quick and sudden, such as laws and policies. This can completely change the investment environment and it’s necessary to fine-tune the system to quickly adapt.

  • The original concept to form the algorithm hypothesis has changed. Over time, more data and information are updated, making the initial hypothesis change. As these concepts change, traders should consider testing for plausibility and fine-tuning. If the change is too big, algorithm traders should consider forming a new algorithm instead.

  • Real trading data provide further important information. This is an effective feedback loop in algorithmic trading. Traders create algorithms and algorithms generate data. This gives algorithmic graders more information and more relevant perspectives. They can upgrade the algorithm to a more complete version.

Capital Allocation

It’s important how the trader will act when the algorithm makes a profit or a loss. Will they use the strategy of having a fixed capital for the algorithm, meaning taking profits if any, and vice versa? Will they choose a compound interest strategy that will use the maximum available capital at each time? This decision can greatly affect the long-term performance of algorithmic trading, especially for multi-algorithm trading.


After backtesting and forward testing in a scientific way, algorithm traders can trust the profitability of their algorithms, at least in the short term without major changes in the environment. They still, however, need to check for risks periodically.