Appendix III

Developing and improving strategies

In this appendix, we will cover a number of key points regarding algorithmic trading strategies that ought to be considered while executing them.

Strategy profitability is subject to seasons

Strategies may not return good results all year round. They can be seasonal, meaning they may perform well at certain times of the year and not so well at other times. So, it is essential to identify the right time or the right season for a strategy and to use it only at those times.

Strategy profitability is subject to its parameter values

A strategy depends on various parameters. The same strategy may perform differently for different instruments and for different values of the technical indicators. For example, an exponential moving average (EMA) strategy with parameters (time periods) 4 and 9 may perform well for STOCK X, but the same strategy with different parameter values, say 5 and 13, may not perform well for STOCK X, or even the same strategy with the same parameter values may not perform well for STOCK Y. Hence, finding the right instrument and parameters can make your strategies successful. 

You can use optimization algorithms to find the right combination of parameters that make your strategy profitable. The cost function can be your backtesting profit and loss (to be maximized) and drawdown (to be minimized). The variables can be instruments and strategy parameter values.

Backtesting alone does not ensure strategy profitability

A profitable backtesting report is one of the prerequisites for profitable trading, but not the only prerequisite. This increases the chances of a strategy performing well during actual trading, but does not guarantee it. There are many other factors that can affect the actual strategy performance besides historical results. Risk management conditions should be well placed in your strategy to minimize the adverse effects in case of any such unforeseen circumstances. One of the ways of ensuring this is through the use of bracket or cover orders, where a compulsory stop loss is placed at all times.

Broker limitations

Not all brokers provide APIs for algorithmic trading. Also, if APIs are provided, the broker may not provide support for all types of orders, such as bracket or cover orders that have in-built risk management. Check and verify all support and services offered by a particular broker before availing yourself of their services. Choosing the right broker may minimize strategy coding at your end. 

Staying connected with the community

You can get support for coding your own strategy by posing your questions to the community on the forum. You can also get insights and pointers in relation to proven and well-tested strategy coding guidelines. Moreover, you can learn more from books on technical analysis and other forums for algorithmic trading. Keep an eye on GitHub repositories providing free strategies along with their Python code (for example, https://github.com/algobulls/pyalgostrategypool).

Be prepared for technology failures during actual trading

No matter how robust your strategy is, strategy execution may not happen as planned during actual trading. This could happen for a variety of reasons:

  • Broker APIs may experience a timeout failure due to the overloading of their servers. This frequently happens during market opening hours, where a large number of traders place orders at nearly the same time to grab market opening opportunities. 
  • A broker technology stack may depend on multiple vendors, besides its own proprietary technology, which means that even if just one of them fails, you can fall victim to it as your order placements might not go through. 
  • If you are using an algorithmic trading platform, it may fail for the same reasons as mentioned in the first point above.
  • Your strategy might fail as it may have encountered a new condition that was not covered in testing. For example, if you place an order involving a very large quantity during actual trading, the order may split into multiple smaller orders that are executed individually. If your strategy hasn't accounted for this, it may fail. Moreover, such scenarios cannot be caught during backtesting as this is virtual trading and orders never split there, so providing a solution for this may be tricky.
  • Historical data feeds may go out the window. There can either be stale data or no data, both of which can result in incorrect decisions being taken in relation to your strategy.
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.190.219.65