In this chapter, I presented different concepts of trading using R. I started with trend following strategy and explained in depth how the trading signals are generated and how various parameters related to its performance are captured. Momentum strategies was followed by pairs trading using three different methods. The first method covered was distance based pairs trading, the second was correlation based, and the third and final method was co-integration based pairs trading. Sometimes, trading in a portfolio is important to control the risk and reward ratio and for that I have covered capital asset pricing, the multi factor model, and portfolio construction. I used Systematic Investor Toolbox for implementing portfolio ideas.
In the next chapter, I will explain trading strategies using machine learning algorithms, which are gaining in popularity. Machine learning algorithms learn automatically from historical market behavior and try to mimic this behavior.