Learning mathematical model-based strategies
We will now look at the various mathematical model-based strategies in the following sections.
Minimization of the portfolio volatility strategy with monthly trading
The objective of this strategy is to minimize portfolio volatility. It has been inspired by https://github.com/letianzj/QuantResearch/tree/master/backtest.
In the following example, the portfolio consists of all stocks in the Dow Jones Industrial Average index.
The key success factors of the strategy are the following:
- The stock universe – perhaps a portfolio of global index ETFs would fare better.
- The rolling window – we go back 200 days.
- The frequency of trades – the following algorithm uses monthly trading – notice the construct.
The code is as follows:
%matplotlib inline from zipline import run_algorithm from zipline.api import order_target_percent, symbol, set_commission, schedule_function, date_rules, time_rules...