Trading Robot – Automated Stock And Futures Exchange

Robot Trading. Many day traders who trade a precisely defined strategy every day soon want to automate trading. There are many trading platforms on the market that allow the creation of trading robots. The most popular of these are available for free and allows you to trade CFDs and Forex.

However, many underestimate the complexity of programming and properly testing these automatic trading systems. In this article we look at the trading algorithm and testing of these trading robots as part of growing technology and its impact on trading.

Read also: The Impact of Technology on Stocl Trading

This article is the beginning of a series of texts and videos on the implementation of automatic trading ideas in day trading. Articles on the topics of backtests, tips & tricks for programming, the definition of trading strategies, and others are planned.

The trading algorithm

An algorithm is a clear rule for solving a problem, in this case, a precise definition for buying, selling, and determining position sizing in stock exchange trading. It is the basis for every trading robot and assumes that a trading strategy can be precisely described and defined. Things like “the chart actually looks short” or “my gut feeling tells me to exit the trade now” are not enough. The algorithm defines how the trading idea on which the robot is based is implemented in detail. Trading ideas can relate to the evaluation of one or more indicators or take advantage of market behavior ( breakouts from consolidation zones, gap closings, etc.).

A well-defined set of instructions needs at least:

  • Rules for entering a position
  • Rules for exiting a position
  • Rules for choosing position size – an often underestimated part of the strategy

Defining these rules forces you as a day trader to think carefully about the elements of your strategy and write them down. You should have already done this in your trading plan if you have been trading this method manually up to now!

Testing trading systems

Almost all robots have a set of parameters that can be used to influence trading. These can be, for example, settings for the stop-loss limit, the period length of a moving average indicator, or the position size. Testing trading programs with historical data to optimize these parameters is called “backtesting”. The English term has also become common in German literature on the subject, and this applies to almost all terms in this context. Some programs, such as the Metatrader program presented below, offer the option of automatically optimizing the input parameters.

You will often find that a successfully tested robot with fresh current data (“forward test”) fails. The problem goes back to the over-optimization of the parameters on the old data, the so-called “curve fitting”. The parameters are then precisely adapted to the test data and only earn money in this previous period. Example: If you find that your system makes money with a moving average length of 11.15 and 17 but loses money with 12.13.14 etc., then the system is not robust enough for live trading.

When calculating performance, you should also exclude random hits, as these can distort the track record and create unrealistic expectations of the system. There is a separate article on this with a simple method.

Testing and evaluating trading systems is a complex activity. The subject is so extensive that books have already been written about it. That is why we can only give initial general information here in this article, but we are planning further articles on this.

At this point, a warning about a stumbling block brings down many system developers. Many developers try to stick to a losing system because they put a lot of effort into design and implementation. Be honest with yourself! It hurts to retire a system you’ve been writing on for weeks. However, it’s still better than losing money all the time.