This lesson requires a premium membership to access.
Premium membership includes unlimited access to all courses, quizzes, downloadable resources, and future content updates.
One of the main advantages of quantstrat package is that we can backtest strategies with multiple symbols as fast as with one symbol. The package provides fast computations for multiple symbols that allow analysts to get insights of strategies in an efficient approach.
In this case study we will build a strategy that works with 9 ETFs which are described below, and its signal is based on the three Exponential Moving Average (EMA) Crossover in order to run the trend. There are three EMAs that generate a crossover signal to buy when EMA4 > EMA9 > EMA18 and exit positions when EMA4 < EMA9 < EMA18.